identify some concepts

A preliminary understanding of microservices, SOA, RPC, RMI, ESB, Web Service, Hessian, Thrift, Rest API

 

refer to:

Difference between SOA and Microservice Architecture?

1. There is an ESB difference between microservices and SOA

2. What is the difference between SOA and microservice architecture?

3. Use the API Gateway to manage the API

4. Talk about the background, architecture and implementation plan of API gateway

5. Development Talk: Don't Say You Don't Know Docker!

6. Detailed installation, configuration and use of docker under CentOS system

7. docker and virtual machine VM

A little understanding of SOA

Microservice SOA Architecture and RPC Remote Procedure Call

 

How to explain REST in plain language, and RESTful?

 

1.关于RPC(Remote Procedure Call Protocol)

 RPC refers to remote procedure call, that is to say, two servers A and B, and one application is deployed on server A. If you want to call the function/method provided by the application on server B, because it is not in the same memory space, it cannot be called directly. network to express the semantics of the call and convey the data of the call

 RPC uses the C/S method, adopts the http protocol, sends a request to the server, and waits for the server to return the result. This request includes a parameter set and a text set, usually of the form "classname.methodname". The advantage is that it is cross-language and cross-platform, and the C-side and S-side have greater independence. The disadvantage is that objects are not supported, and errors cannot be checked in the compiler, only at runtime.

 

2. About RMI (Remote Method Invocation)

RMI uses stubs and skeletons to communicate with remote objects. The stub acts as the client proxy of the remote object, and has the same remote interface as the remote object. The invocation of the remote object is actually done by calling the client proxy object stub of the object. Through this mechanism, RMI is like it is a local work, using tcp/ip protocol, the client directly calls some methods on the server. The advantage is that it is strongly typed, and errors can be checked at compile time. The disadvantage is that it can only be based on the Java language, and the client and server are tightly coupled. Note: RPC and RMI

(1) RPC is cross-language, while RMI only supports Java .

(2) RMI calls remote object methods, allowing methods to return Java objects and basic data types, while RPC does not support the concept of objects, and messages sent to RPC services are represented by an External Data Representation (XDR) language, which Abstracts the difference between endian classes and data type structures. Only the data types defined by XDR can be passed, it can be said that RMI is an object-oriented way of java RPC .

(3) On method invocation, in RMI, the remote interface makes each remote method have a method signature. If a method is executed on the server, but no matching signature has been added to the remote interface, then the new method cannot be called by the RMI client.

In RPC, when a request arrives at the RPC server, the request contains a parameter set and a text value, usually of the form "classname.methodname". This indicates to the RPC server that the requested method is in the class named "classname", named "methodname". The RPC server then searches for a matching class and method and uses it as input for that method parameter type. The parameter type here matches the type in the RPC request. Once the match is successful, this method is called and the result is encoded and returned to the client side.

3. About JMS ( Java Messaging Service)

JMS is a Java message service, and JMS clients can perform asynchronous message transmission through the JMS service. JMS supports two message models: Point-to-Point (P2P) and Publish/Subscribe (Pub/Sub), namely point-to-point and publish-subscribe models.

 

Note: JMS and RMI

With JMS services, objects are physically moved asynchronously from one JVM on the network to another JVM (a message notification mechanism)

The RMI object is bound in the local JVM, only function parameters and return values ​​are transmitted over the network (request response mechanism).

 

RMI is generally synchronous, that is to say, when the client calls a method of the server, it needs to wait for the return of the other party before continuing to execute the client side. This process calls the local method and feels the same, which is also a feature of RMI. .

JMS generally only sends a message to the Message Server at one point, and generally does not care who uses the message after it is sent.

Therefore, the general application of RMI is tightly coupled, and the application of JMS is relatively loosely coupled.

 

 

 

4. About Web Services

The service provided by the Web Service is based on the web container, and the bottom layer uses the http protocol. It is similar to a remote service provider, such as the weather forecast service, which provides weather forecasts to clients around the world. It is a request-response mechanism and is a cross-system and cross-platform of. Is through a servlet, to provide services out.

First, the client sends the WSDL from the server to the WebService, and at the same time claims a proxy class (Proxy Class) on the client side. This proxy class is responsible for communicating with the WebService.

The server performs Request and Response When a data (in XML format) is encapsulated into a data stream in SOAP format and sent to the server, a process object will be generated and the SOAP packet received by the Request will be parsed, and then the transaction will be processed. , and then perform SOAP on this calculation result after processing

Packaging, and then send the package as a Response to the client's proxy class (Proxy Class). Similarly, the proxy class also parses the SOAP package, and then performs subsequent operations. This is a running process of WebService.

Web Service is roughly divided into 5 levels:

 1. Http transport channel

 2. XML data format

 3. SOAP Encapsulation Format

 4. WSDL description method

 5. UDDI UDDI is a directory service that businesses can use to register and search for Webservices

 

Note: Webservice with RMI

 

RMI is to transfer serializable java objects on the tcp protocol, which can only be used on the java virtual machine, the binding language, the client and the server must be java

Webservice does not have this limitation. Webservice transmits xml text files on http protocol, independent of language and platform

 

Note: Webservice and JMS

Webservice focuses on remote service calls, and jms focuses on information exchange.

In most cases Webservice is a direct interaction between two systems (Consumer <--> Producer), while in most cases jms is a three-party system interaction (Consumer <- Broker -> Producer). Of course, JMS can also implement communication in the request-response mode, as long as either the Consumer or the Producer is the broker.

JMS can make asynchronous calls to completely isolate clients and service providers, and can resist traffic floods; WebService services are usually called synchronously and require complex object conversion. Compared with SOAP, JSON and REST are now good http architectures Scheme; (For example, in the distributed system of e-commerce, there are payment systems and business systems. The payment system is responsible for the user's payment. After the user pays in the bank, each business system needs to be notified. At this time, either synchronization or With asynchrony, the benefits of using asynchrony can be used to protect against temporary traffic spikes on the website, or to deal with slow consumers.)

JMS is the message specification on the java platform. Generally, the jms message is not an xml, but a java object. Obviously, jms does not consider heterogeneous systems. To put it bluntly, JMS does not consider non-java things. But fortunately, most jms providers (that is, various implementation products of JMS) now solve the problem of heterogeneity. Compared with WebService's cross-platform, it has its own merits.

 

5. About SOA

 

 

6. About Microservices

https://www.zhihu.com/question/37808426

https://www.zhihu.com/question/37808426

 

 

What is the difference between microservices and SOA?

Answer: Microservices can be thought of as SOA without ESB . ESB is the central bus in the SOA architecture, the design graph should be star-shaped, and the microservice is a decentralized distributed software architecture.

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326238390&siteId=291194637