Common methods of data transmission and data call

Common methods of data transmission and data call

With the Internet and the Internet of Things highly developed today, it seems that everything can be connected, and the way to connect and communicate with each other is API. For API, there are many ways to transmit data. Today we will talk about the evolution of API communication.

[[427409]]

SOAP

Its full name is Simple Object Access Protocol. It is the earliest communication protocol used for data transmission. It defines the parameters and types of service calls, the text format, and the response method through XML. It can be transmitted through HTTP protocol, SMTP protocol, or TCP protocol. Due to the length of XML, its transmission data will increase greatly when there are too many messages.

Therefore, the data transmission method of SOAP has gradually been eliminated from the stage of history.

JSON

When the XML format contains too much redundant data, people find that the JSON data format can transmit more information, and JSON is supported by many programming languages. Therefore, more and more APIs use the JSON data format to provide external services.

It can be said that the third-party APIs that are now open will definitely provide the interface data format of JSON. Of course, some third parties will also return the data communication format of XML in the payment interface.

REST

The full name of REST is the state change of resource representation. It is an architectural style used to constrain the search and location of resources.

It is not the data transmission format, nor does it simply constrain the data transmission format. It constrains the way the state of resources changes. It regards everything as a resource.

The representation here refers to any data format such as json, xml or html, including image format.

State change refers to modifying its state through actions such as GET, POST, DELETE, PUT, etc., so that its state increases, decreases, is deleted, etc.

REST provides a stateless service that does not record the visitor's last access status.

Although many problems can be solved by REST, such as transaction mapping, addition, deletion, modification and query mapping, and document mapping, there are still many cases where REST cannot use all mapping situations.

GRPC

gRPC is a modern lightweight communication protocol from Google. It is mainly used to solve the problem of remote procedure calls.

In a distributed system, each system often needs to call the services of other systems. In addition to calling through the http interface, there are other calling methods, and gRPC is one of them.

It is a very effective method that utilizes the characteristics of HTTP/2 and solves the problem of synchronous sending. It can perform broadcast sending and multiplexing. Through one connection, it can transmit more messages.

It uses a binary data format, which greatly reduces the volume of data transmission compared to text formats such as json and xml. The same bandwidth can transmit more messages faster.

GraphQL

GraphQL is a query language that is particularly advantageous for querying graphs (graph data), so it is called GraphQL.

GraphQL was invented by Facebook. It provides another way to query APIs. It can return different data based on different query conditions through an interface.

GraphQL allows you to ask for what you want in a single query, saving bandwidth and reducing waterfall requests. It also enables clients to request their own unique specification of data.

Using GraphQL, API developers create a schema that describes all the possible data that clients can query through the service. A GraphQL schema consists of object types, which define what kind of object you can request and what fields it has. When a query comes in, GraphQL validates the query against the schema.

GraphQL queries can not only obtain the properties of resources, but also further query along the references between resources. Typical REST APIs have to load multiple URLs when requesting multiple resources, but GraphQL can get all the data your application needs with a single request. In this way, applications using GraphQL can perform fast enough even on slow mobile network connections.

Summarize

In the era of the Internet of Things, people always need to deal with third-party interfaces or provide interface services to third parties. We always hope that our programs can be faster, more efficient and more convenient. Therefore, developers continue to develop and improve technology. The interface service of the future is not what services are provided by third parties for users to use, but what data users want can be retrieved from third parties.

<<:  Bharti Airtel, Ericsson trial 5G network in rural India

>>:  Automating network verification for smoother changes

Recommend

Forecast of China's Internet Market Development Trends in 2021

As the COVID-19 pandemic is gradually brought und...

Passive Optical Network (PON) Technology Video Surveillance System Solution

Faced with the rapid growth of security services ...

Don't use WiFi randomly, be careful with the bank card bound to your phone

Many people have Wi-Fi installed at home. However...

What is Power over Ethernet (PoE)?

Power over Ethernet (PoE) is a secure and conveni...

How is HostYun? Simple test of HostYun Hong Kong EPYC high bandwidth VPS

A few days ago, we shared the information that Ho...

Why do big companies have API gateways? It’s not as simple as you think!

[[319983]] In this article, we will explore the r...

The Smart Network: Cisco's most disruptive innovation in a decade

A little over a year ago, my colleague David McGr...

What is cloud network?

The future of cloud is bright. By 2024, more than...

Discussing the five key technologies for building 5G

It is widely believed that 5G mobile networks wil...

Why do you need to consider whether IPv6 is supported when adopting SD-WAN?

The Internet of Things (IoT) has fundamentally ch...