Architectural knowledge study notes (updated ing)

First, the middleware: RPC-- Remote Procedure Call

The main problem between telecommunications, do not need to understand the mechanisms underlying communication network. RPC transmission frame responsible for the underlying mask (TCP or UDP), and a communication serialization details. So in the actual development, communication details and do not care about the underlying process calls, let the business side focus on achieving business code. There are relatively well-known Ali HSF and DUBBO (open source).

By RPC, allows larger applications split deployment, realize distributed remote call. RPC framework of three core roles:

(1) Service Provider: External provide back-office services, their service information to the central register

(2) Registry: registration for the server and remote client service discovery service. zookeeper, eureka \ consul, etcd such as: to achieve at present mainly through open-source framework.

(3) Service consumers: obtain registration information from the remote registry service, and then make remote procedure calls.

Call the procedure:

1) service caller (client) calls to invoke a local call services;

2) client stub is responsible for receiving the process parameters and the like can be assembled into a network after a call transfer message body; in Java Serialization is the process of

3) client stub find the service address, and sends a message to the server through the network;

4) server stub decoding after receiving the message, is in Java deserialization process;

5) server stub calls the local service based on the result of decoding;

6) local service performs the processing logic;

7) Local service returns the results to the server stub;

8) server stub packaged into the return result message, Java serialization in;

9) the message through the network server stub packaged and sent to the consumer

10) client stub receiving the message, and decoding, Java in deserialization;

11) service caller (client) to get the final result.

1. Establish communication

First of all, to solve the problem of communication, mainly in this connection are transmitted in all data exchange through the establishment of a TCP connection, remote procedure calls between the client and the server.

2. Addressing

1) registration service

We first need to register the service to the service center. In fact, be registered in a registry, the registry stores the IP, port, call mode (protocol, serialization) of the service and so on. In zookeeper, make service registration, in fact, created a zookeeper znode node, the node stores the above mentioned service information.

2) Service Discovery

Service consumers in the first call to service, will find the appropriate service through the registry list of IP addresses, and cached locally for later use. When a customer calls the service, the request will not go to the registry, but take directly through the IP load balancing algorithm from the list of a service provider's server calls the service.

3) registration services

Reliable way of addressing (mainly to provide discovery services) is the cornerstone of RPC, for example, can be achieved zookeeper registration services.

High concurrency architecture series: How to Dubbo from 0-1 RPC framework for designing a class

  •  Active registered machine ip, port and a list of services provided to the service (registration) center after the service provider to start.
  •  Address List for service providers to the service (registered) service center when consumers start to achieve soft load balancing and Failover.
  •  After the providers need to regularly send heartbeat to the registration center, a period of time did not receive a heartbeat from the provider that the service provider has stopped, picked out from the registry corresponding services.

3. Network transmission

Data transmission protocol uses what, how data serialization and deserialization

4.NIO communication

Currently, many RPC frameworks are based directly on the netty this IO communication framework, such as Alibaba HSF, dubbo, Hadoop Avro, Netty is recommended as the underlying communication framework.

5. Service Call

For example: B local calling machine has been in the return value (by the Proxy Agent), and then returns the value required at this time is sent back to A machine, also need to go through a sequence of operations, then the binary data transmission through the network is sent back to A machine, and when the A machine receives the return value, the operation is performed again deserialize

 

Second, the middleware: MOM-- message-oriented middleware

https://blog.csdn.net/leexide/article/details/80035462

Three, Redis doing it

https://blog.csdn.net/lzl9421na/article/details/76651374

1) the era of big data Taobao, WeChat and microblogging are all widely used redis database, the number of fixed data such as fixed information schools, regions, etc. stored in a relational database. Then for constantly changing data such as Taobao Each festival will have a more popular search in the search box, the festival in the past when keywords are automatically deleted in order to facilitate the management, these data can be stored in redis database, and set the expiration time arrives time is automatically deleted.
2) In order to alleviate the pressure database, Weibo microblogging first save sent to redis database, they can immediately view, and then synchronize the data in memory to a relational database.

Fourth, the application server and WEB server

The application server business logic processing, web server it is designed to allow customers to access via browser with HTML files, web servers are often simpler than the application server.
WEB server : Apache, IIS, Nginx (also a reverse proxy server). Apache supports all operating systems, cross-platform, and only on IIS under windows operating system, in terms of open source Apache is completely open free of charge, while IIS is part of the open source code.
Application servers : Tomcat, Weblogic, Jboss

https://blog.csdn.net/jameswuang/article/details/80986789

Five, Web Service (web services architecture)

SOA service-oriented architecture Detailed  https://blog.csdn.net/fuhanghang/article/details/83961606

SOAP: Simple Object Access Protocol, is a protocol specification for exchanging data, a lightweight, simple, based on the XML ( Standard Generalized Markup Language a subset of the) protocol, which is designed to exchange the WEB structure and curing of the information. SOAP = HTTP + RPC + XML, is employed as the underlying communication http, as RPC call route, data were packaged xml format. soap format used to describe the transfer of information, WSDL is used to describe how to access specific interface, uddi used to manage, distribute, query webService.

Alibaba Dubbo is a typical implementation of SOA.

Published 49 original articles · won praise 3 · views 10000 +

Guess you like

Origin blog.csdn.net/figo8875/article/details/100018492