Do not stratified as decoupling!

The company's older employees they call it preferred a "decoupling" approach:

First such system analysis: dismantling the system operation into a number of sectors, perform A, then execute B, Step a a forming.

Followed by "decoupling": put each link into a service connection between MQ link. Input and output data link adapter Protocol Specification formed.

Benefits obtained after the "decoupling" is:

Links with MQ series, died when the service, can store MQ messaging, and other services can be restarted to continue; when MQ can not digest, can increase the machine for this part of the service; when this part of the service saturation, can cut machine.

This "decoupling" approach and sectoral division of the same strain, departments wealthy to cut, finish work on adding, documents are always piled in there.

Programmer is characterized by the hands of a hammer looking for nails everywhere, who see the system is not so divided, they felt that "decoupling is not sufficient." Life is a program of life continues to replicate this model.

Many companies also remain in the framework of this facility-level software architecture: How to implement KAFKA, how on SPARK, ZOOKEEPER how to play and so on, in an attempt to change the world by introducing these panacea.

However, the results so far? As it involves internal systems, security reasons not to expand here, simply put, is a rotten system over!

Why turn into this?

First, the system is rotten from business architecture to identify improper.

Aspects such as permission, I will engage in unlimited division of the organization in 2005, but this system companies are flush, do not they engage in a flat management?

Permissions are not present, the system's core business, the core business object recognition system is also a mess, but does not involve the company's business expansion here.

I think, systems analysis capability mainly refers to the ability of the business structure, identifying core business objects, so that traffic between the levels of active conduct business around architecture. A decoupling system proper, interspersed between the first few operations, independent between the plates, without mutual contamination wound. Secondly, high abstraction, does not affect the underlying abstract for top abstract logic.

Or take the division of the organization, in my design, the organization is only one table, regardless of the company, department, department or airports, hospitals, schools, departments, field stations, etc., affiliation are recorded in this table , the expression organizational structure to use this table, you need to focus on inherit from this table when expressed, shared by the primary key inheritance derived out of the hospital school table table table airports, etc., now we have JSON field, you can not even inherit. Such organizations table, fully express permission and only expressed a critical system hierarchy, regardless of the privilege system such as company contact address registered capital corporation and so forth, then exiled to JSON or derived table based on business needs in. Derived tables and organization tables are expressed in different companies side, both support and independence, this is the real essence of decoupling is in line with the structure of formal logic. By definition, the concept of a higher level of organization, the concept of a lower level of the airport hospital departments departments, organizations including the airport hospital departments departments, the nature of the organization is governed - attached. This decoupling is required for each system, it can really labor-saving investment in the formation of the code pleasant refreshing organizational structure.

Why even if all the code in a batch process and why not a project, it is not necessary to isolate the two isolation process! A clever architect, the mind must be adapted to local conditions specific issues specific analysis, there must be ripped phenomenon isolated nature of business insight and depth of thinking. In a human body, the nervous system, blood circulation, respiratory system, etc., a separate but share the physical area, the person can not be cut into several sections divided body area. Cut into paragraphs and who will not? It is a personal will, and what Mangfu not call the doctor, are not part of the original thinking scientific thinking.

Second, to curb their own playing everywhere impulse hammer

The company's older employees in particular, loves to play the message queue, but then AM models know nothing about.

To find out the best way Actor-Message model is to read the paper on erlang Joe Armstrong, and then end up doing a small application with erlang combat.

In addition to erlang virtual machines, virtual machines or other mainstream operating system is not as ActorMessage invention, they are not supported by the original model of AM, so some people do not need to do much with erlang the RabbitMQ, so that other virtual machines are not erlang program the price can dip the light and enjoy some of the benefits of AM, but this enjoyment is limited. Followed by another MQ other language implementation, after all, and because Java does not support true native Actor leads to the flow direction of the overall development here will not start.

Here we must recognize that a few questions:

1. MQ is not a true Actor-Message, is a cross-process access. In erlang where you can readily build one million Actor, and in the MQ, you can only pick a few key objects associated with the MQ sender and receiver. This is because, MQ taking the network protocol across process, no matter how fast the speed, can not be faster than the internal process calls. I did a test, by RabbitMQ do RPC, run a million times additions required 15s! When you do a real-time system is a system, not to engage in MQ! If your operation is very tight, do not engage MQ! Your computer has a lot of transmission, there are PCI, there PCIE, there are SATA, USB there, Why do not all use USB? Cross-process communication is always higher than the cost of calls within the process, a cross-process calls, data needs to be packaged into bytes, to be set MQ package, to set TCP / IP packets to be transmitted, and then resume from bytes to program objects, these steps overhead amazing, just please try to allow direct access, program objects on the same VM in the same process!

2. Your internal systems with the Actor-message it? In erlang in, Actor nodes and node located in the same process of cross-process, there is not much difference petition way. If your system is itself Actor-Message, you only need to copy the system will be able to get several ability to grow, no need to disassemble into several service! Of course, you are not playing erlang, that the use of such a framework AM Akka framework, and other languages ​​are also communication problems. But this does not prevent you nod pumping system, the injection point plus several MQ. The advantage of this is that your code still together, you can read the code, without the need to jump around between a bunch of engineering for a thoroughly understand the business logic. The company has a project, something small, core function on so little, actually come up with nine projects!

3. Do you consider other benefits too erlang do? There erlang hot deployment, no side effects, monitoring trees and so on edge, you thought MQ support you play it?

4. Do you know the task scheduling it? In the eyes of task scheduling, MQ is only a means, the task is the key! ! ! Task scheduling framework do have celery and so on. Why on task scheduling rather than stay in the MQ? People always want to know a higher level, a physical layer concept quite a distance away from the product, you need a real task scheduling and operational coupling. Business -> Task Scheduler -> MQ, this is the correct understanding. We know that in the real ActorMessage, the task is also an Actor, but after all, you are using MQ rather than erlang, erlang can quickly create one million Actor, MQ queues to try out one million.

A system of so-called decoupling, the most important is the operational level of decoupling, the operational level of decoupling from the more thorough knowledge of the business itself.

The technical level of decoupling requires awareness and find a neutral independent business or ignorance of business components or services. Components of such a kind of decoupling, the decoupling components can still get placed in a process to use. To understand the technology before implementing decoupling, after decoupling technology, your business will not fled to layer the various technical decoupling, if so, the impulse is the devil, you need to stop doing a good reflection'll decide.

Guess you like

Origin www.cnblogs.com/inshua/p/11948950.html