[Reading notes] website scalable architecture

Foreword

I had a reading notes before this chicken dish, arrange a "large-scale Web Site Technology Framework," a book five architectural elements described Zhihui teacher's book. These five factors are performance, availability, flexibility, scalability, security . In this paper, the expansion of a simple discussion of the elements of the content is the main reference from "large-scale Web Site Technology Framework" This book (a very recommend this book, personally think that this book can be said to exist as the introduction of technology architecture ).

The so-called scalable website, referring to the application had no effect on other existing systems while adding new features, which requires different applications have low coupling characteristics.

Note the difference between sex and expansion flexibility, not confused.

Extended refers to the expansion of the functions , such as adding new features.

Stretching means stretching on performance , such as increasing the number of servers.

Scalable There are two main ways:

  • Using the message queue for decoupling between applications communicate by message passing;
  • The use of distributed services to business and reusable services separate from business calls using a distributed service framework of reusable services. The new product can be accomplished by calling the business logic reusable services, it has no effect on other products.

Next, specific introduction of these two methods.

Using a distributed message queue to reduce coupling system

First, event-driven architecture

Event-driven architecture (Event Driven Architecture), coupled between the low pass module to transmit the event message, loosely coupled than the holding module, and with the completion of a communication event message cooperation between modules, EDA architecture of a typical operating system is common producer-consumer model .

Here Insert Picture Description
Message sender sends a message to a message queue that is distributed ends the processing of the message.

Recipient of the message just from distributed message queue for processing after acquisition news, do not need to know that the message comes from.

It can be seen, with the message sender and the message recipient is not directly coupled .

For new business, as long as the interest type of message, you can subscribe to this message, no impact on existing systems and services, enabling the scalable business website design.

Second, distributed message queue
Here Insert Picture Description
message producer application through the remote access interface the message server pushes the message queue , the server message queue messages written immediately after the local memory queue returns a success response to the message producer.

Message Queue Server subscription list to find the message subscribe news consumer applications according to the message, the message queue of messages to send messages via remote communication interface to the message consumer program in accordance with the FIFO principle.

In addition, in order to avoid the message queue server downtime caused by the loss of a message, it will successfully sent messages to the message queue of messages stored in the message producer server, and so on after the news consumers actually processed the message server to delete the message.

After the message queue server downtime, server producers will choose Distributed Message Queue Server cluster other server news release.

The use of distributed services to build reusable business platform

If the distributed system message queue coupled by decomposing the message object, a different subsystem processes the same message; then coupling the distributed services, the different subsystems of the same system call interface description decomposing system through the interface.

Consider the following maintenance difficulties, difficulties in the development, deployment difficulty giant system .
Here Insert Picture Description

The solution is to split the module independent deployment, reduce coupling system.

The resolution can be divided into two types.

  • Longitudinally split
  • Lateral resolution

Vertical split : a large application into multiple small applications, if the new business is more independent, then set it directly deployed as a stand-alone Web applications.

Lateral resolution : the multiplexed service spun off, independent deployment of distributed services , the new service need only call the distributed services, does not depend on the specific module code can quickly build a system application, the internal module business logic changes, it can just be consistent interfaces will not affect the business processes and other modules.

Here Insert Picture Description

Guess you like

Origin blog.csdn.net/u013568373/article/details/91367311