The Java engineers from JD don’t even know the difference between distributed, high concurrency, and multithreading?

When mentioning these three words, do many people think that distributed = high concurrency = multithreading?

When the interviewer asks what methods can be used to solve the high-concurrency system, or is asked how the distributed system solves the problem of consistency, is it confusing?

Indeed, at the beginning of the contact, many people will confuse the three, mistakenly thinking that the so-called distributed high-concurrency system can be accessed by a large number of users at the same time, and the use of multi-threaded means can provide the system's concurrency capabilities. ? In fact, the three of them always came together, but they have different focuses.

What is distributed?

A more distributed concept is an optimization method used to solve the bottleneck problem of the capacity and performance of a single physical server . There are many problems that need to be solved in this field. At different technical levels, they also include: distributed file system, distributed cache, distributed database, distributed computing, etc. Some terms such as Hadoop, zookeeper, MQ, etc. are related to distributed related. Conceptually, there are two forms of distributed implementation:

Horizontal expansion: When a machine cannot handle the traffic, the traffic is divided evenly among all servers by adding machines, and all machines can provide equivalent services;

Vertical splitting: When there are multiple query requirements on the front end, one machine can't handle it, and different requirements can be distributed to different machines. For example, machine A handles the request for query of remaining tickets and machine B handles the request for payment.

What is high concurrency?

Compared with distributed, high concurrency will focus on the problems it solves, and its response is the amount of simultaneous : for example, online live broadcast services, which are watched by tens of thousands of people at the same time.

High concurrency can be solved by distributed technology, and concurrent traffic can be distributed to different physical servers. But in addition, there are many other optimization methods: such as using a cache system, putting all the static content in the CDN, etc.; you can also use multi-threading technology to maximize the service capacity of a server.

What is multithreading?

Multithreading refers to the technology that implements concurrent execution of multiple threads from software or hardware. It is more to solve the problem of CPU scheduling multiple processes, so that these processes appear to be executed at the same time (actually run alternately).

Among these concepts, the problem solved by multithreading is the clearest, and the method is relatively single. Basically, the biggest problem encountered is thread safety . In the JAVA language, it is necessary to have a deep understanding of the JVM memory model and instruction rearrangement in order to write a high-quality multithreaded code.

in conclusion:

 ●Distributed is to form a whole external service from the perspective of physical resources. The technical scope is very wide and difficult. With this foundation, high concurrency, high throughput and other systems are easy to build;

● High concurrency is to describe the capabilities of the system from a business perspective. The means to achieve high concurrency can be distributed, such as caching, CDN, etc., of course, including multithreading;

● Multithreading focuses on how to use programming languages ​​to maximize CPU scheduling capabilities.

Distributed and high-concurrency systems involve a large number of concepts and knowledge points. If there is no systematic learning, it is easy to mix concepts and become unrecognizable, and encounter difficulties in interviews and actual work. If you are engaged in Java development, have more than one year of work experience, want to understand Java distributed, high concurrency and other technical points in a simple way , and are eager to achieve double breakthroughs in technology and professional growth, then the following benefits are suitable for you:

Java high concurrency actual combat practice

A full set of pdf tutorials such as multithreading, high concurrency, distributed, algorithm, and big data, as well as learning documents, system map plus V: MXW5308 can be received for free

Multi-threaded actual combat practice

Principles of Distributed Architecture

The information package mainly includes "Big Data Container Database Architecture Technical Documents", "Technical Digests of Large Companies", "Java Development Reference Books", "Java Development Learning Graphs" and other contents to expand your knowledge system in all directions.

A full set of pdf tutorials such as multithreading, high concurrency, distributed, algorithm, and big data, as well as learning documents, system map plus V: MXW5308 can be received for free

algorithm

practical!  50 large factories, 987 pages of big data, algorithm project landing experience tutorial collection

 

practical!  50 large factories, 987 pages of big data, algorithm project landing experience tutorial collection

 

Big Data

practical!  50 large factories, 987 pages of big data, algorithm project landing experience tutorial collection

Guess you like

Origin blog.csdn.net/weixin_45132238/article/details/108549896