First, what is distributed?
Distributed is more of a concept, is to solve the capacity and performance bottlenecks of a single physical server optimization means, this field needs to solve a lot of problems, at different technical levels, including: Distributed file system, distributed cache, distributed database, distributed computing, some terms such as Hadoop, ZooKeeper, MQ, etc. Conceptually, a distributed implementation comes in two forms:
Horizontal expansion
When one machine cannot carry the traffic, the traffic is evenly distributed to all servers by adding machines, so that all machines can provide comparable services.
The vertical resolution
When the front end has A variety of query requirements, one machine can not carry, different requirements can be distributed to different machines, such as machine A processing order query request, machine B processing payment request.
What is high concurrency?
As opposed to distributed, high concurrency is more concentrated in solving problems, reflecting how many are simultaneously available: for example, a live streaming service with tens of thousands of simultaneous viewers.
High concurrency can be solved by distributed technology, which distributes concurrent traffic to different physical servers. But there are a lot of other ways to optimize: using a caching system, putting all the static content on the CDN, etc.; You can also use multi-threading to maximize the capacity of a server.
What is multithreading?
Multithreading refers to the simultaneous execution of multiple threads in software or hardware. It is more of a solution to the problem of the CPU scheduling multiple processes so that they appear to be executing at the same time (actually running alternately).
Among these concepts, the problem solved by multithreading is the most clear, and the means are relatively single. Basically, the biggest problem encountered is thread safety. In the JAVA language, a deep understanding of the JVM memory model, instruction reordering, and so on is required to write high-quality multithreaded code.
Four,
Distributed is from the point of view of physical resources, different machines into a whole external service, technology is very wide and difficult, with this foundation, high concurrency, high throughput and other systems are easy to build;
High concurrency describes the ability of the system from the perspective of business. The means to achieve high concurrency can be distributed, cache, CDN, etc., of course, it also includes multi-threading.
Multithreading focuses on maximizing CPU scheduling power using programming languages.