Simple distinction between distributed, highly concurrent multi-threading and three concepts

Whenever mention of distributed, multi-threaded and highly concurrent these three concepts, many programmers will think highly concurrent distributed = = multithreading, namely that those three concepts are the same, but in fact this is considered wrong.

What is Distributed

On the concept of distributed, so we may be able to understand: it is optimized means to resolve performance bottlenecks and lack of a single physical server capacity issues adopted.

And distributed in this area need to be solved very many problems, and these problems are on different technical aspects, including distributed file system, distributed cache, distributed database and distributed computing. Some terms such as Hadoop, Zookeeper and MQ, are also related to distributed about. 

If you look at the conceptual level, a distributed implementation can be divided into horizontal expansion and vertical split in two forms.

Level expansion

The so-called horizontal scaling, referring to one of the machines burden when the cluster can not be huge traffic when it is by means of adding machines, these flow twenty-one add five for divided equally to all the servers, so that all the machines will We can provide the same equivalent service. 

Vertical Split

Similarly, when the front end of the demand for a variety of queries sometimes can not carry a machine, distributed to the different demands put on a different machine.

Ticketing system to an example, when a user queries the remaining tickets purchase and payment platform page will appear about the situation:

1. A machine to process the request I vote queries.

2. B machine processing a request for payment.

What is high concurrency

If we say that is distributed for huge traffic to increase diversion, and divide the pressure, then the problem is solved by high concurrent request concentration problems, it reflects how a small amount of the same time.

Such as online video service, while there are thousands of people watching, this is the high concurrency, stressed that the large number of requests for the same time. So high concurrency can be distributed to resolved through technology, concurrent traffic assigned to different physical servers. But in addition, there are still many other optimization methods: for example, using a caching system will put all static content using a CDN or message queue.

What is multi-threaded

Multithreading is more of a problem to solve CPU scheduling multiple processes, so that these processes appear to be executed simultaneously (alternating actually run).

In short, multi-threading technology is to achieve concurrent execution of multiple threads from a software or hardware, through multi-threading technology to maximize service capabilities of a server. Although relatively simple means of multi-threaded, multi-threaded but the biggest problem encountered is the best thread safe. In the Java language, the need for JVM memory model, instruction rearrangement have a better understanding, in order to write a high-quality multi-threaded code.

to sum up

1. distributed from the perspective of the physical resources to the different machines form a whole Foreign Service, the technical scope is very wide and very difficult. With this foundation long, high concurrency and high-throughput systems will be very easy to build.

2. high concurrency is from a business perspective to describe the capacity of the system, the means to achieve high concurrency may be distributed, can also be used, such as a cache, the CDN message queues, or the like, of course, include multiple threads.

3. Multi-threaded programming is focused on how to use language to maximize CPU scheduling capabilities.

 

"The so-called lonely, middle of the night looking for someone to talk to has doubled in less than trustworthy person contacts, but did not want to cry a shoulder to lean on, and people are eager to share do not get the slightest response."

Guess you like

Origin www.cnblogs.com/yanggb/p/11719143.html