Difference between Distributed and Cluster? What is a cloud computing platform? Distributed application scenarios?

Mina Ayoub
6 min readFeb 10, 2016

--

Distributed refers to splitting a business into different sub-services and distributing them on different machines. Clustering means that multiple servers are grouped together to achieve the same service. It can be regarded as a computer, a cloud computing platform, or through A software system centralizes the use of distributed deployment resources. To cope with large concurrency, to achieve high availability, both distributed and clusters are indispensable.

What is the difference between distributed and cluster?

Distributed

Distributed : refers to splitting a business into different sub-services and distributing them on different machines.

The commonly used distribution is to add a bunch of web servers after the load balancing server, and then build a cache server on it to save the temporary state, and then share a database.

The only real distribution in this environment is the web server, and there is no connection between the web servers, so the structure and implementation are very simple.

Cluster

Cluster : It means that multiple servers are grouped together to achieve the same business and can be regarded as one computer.

A group of computers consisting of multiple servers, as a whole, provides users with a set of network resources, which are the nodes of the cluster.

Two features

Scalability : A service node in a cluster that dynamically adds machines to increase the processing power of the cluster.

High availability : If a node in a cluster fails, the services running on this node can be taken over by other service nodes, thus enhancing the high availability of the cluster.

Cluster classification

Common cluster classification

1. High Availability Cluster

High-availability cluster, common two-node dual-system hot standby, multi-node HA cluster.

2. Load Balance Cluster

Commonly used Nginx distributes requests to different web servers on the back end, and there is a database cluster. Load balancing is to ensure high availability and high concurrency of the server.

3. Scientific Computing Cluster (High Performance Computing Cluster)

Referred to as HPC cluster. This type of cluster is dedicated to providing powerful computing power that a single computer cannot provide.

Two abilities

Load balancing : Load balancing can distribute tasks to computing and network resources in a clustered environment.

Cluster Fault Tolerance : When a cluster environment is used in our system, cluster fault tolerance plays a key role when cluster calls fail for various reasons.

Failover Cluster

Failed to automatically switch, when there is a failure, retry other servers, usually for read operations, but retry will bring longer delays.

Failfast Cluster

Fast failure, only one call is initiated, failure is reported immediately, usually used for non-idempotent write operations, such as adding records.

Failback Cluster

Automatic failure recovery, background record failure request, scheduled retransmission, usually used for message notification operations.

Forking Cluster

Calling multiple servers in parallel, as long as one returns, is usually used for read operations with higher real-time requirements, but more service resources are wasted.

Simple summary

Distributed, in a narrow sense, is similar to a cluster, but its organization is relatively loose, unlike clusters, which are organized, one server is paralyzed, and other servers can be topped up.

Each node in the distributed network completes different services. When one node is smashed, the service is inaccessible.

1. Distributed refers to splitting a business into different sub-services and distributing them on different machines.

2. Cluster refers to a group of servers that are grouped together to achieve the same business and can be considered as one computer.

Each node that is distributed can be used for clustering. Clusters are not necessarily distributed.

What is a cloud computing platform?

A cloud computing platform is a centralized distribution of resources for distributed deployment through a software system. To cope with large concurrency, to achieve high availability, both distributed and clusters are indispensable.

For example, load balancing, if it is just a server, this machine will be finished.

The difficulty of distribution is that many machines do different jobs with dependencies. The resources and time required for these jobs may be very different. Some machines may also strike. How can we coordinate and achieve the highest efficiency and consumption? At least, no mistakes.

Distributed application scenarios?

There are many kinds of distributed systems that are usually exposed, such as distributed file system, distributed database, distributed WebService, distributed computing, etc. The scenarios are different, but is the distributed idea the same?

1. Simple example

Suppose we have a server, it can take 1 million / sec request, this request can access the web page through http, download files through tcp, jdbc execute sql, RPC call interface…, now we have a request for data is 2 Millions/second, obviously the server can’t hold it, it will refuse to access, even crash, take the opportunity, what should I do?

If a machine can’t solve the problem, then two. So we add a machine, each of which bears 1 million. If the request continues to increase, two problems that cannot be solved, then three.

This way we call it horizontal expansion . How to achieve the average allocation of requests is load balancing .

Another chestnut, we now have two data requests, data 1900,000, data 2800,000, the above machine can not hold, we add a machine to load balance, each machine handles 450,000 data 1 and 400,000 data 2, but the split is too much trouble, not as good as one processing data 1, one processing data 2, can also solve the problem, this way we call vertical split .

Horizontal expansion and vertical splitting are two ideas for distributed architecture, but they are not an alternative problem, but more are mergers and acquisitions. The following describes a practical scenario. This is also the corporate architecture of many Internet companies.

2. Practical examples

The computer system of the company I am at this time is very large. It is naturally a whole distributed system. In order to facilitate organization and management, the company divides the entire technical department into departments, orders, members, merchants, etc. according to business and platform. Each department has its own web server cluster, database server cluster, the links accessed through the same website may come from different servers and databases, and the access to the database and the underlying database is assigned to different server clusters. This is The typical vertical split by business , the server of each department will have flexible expansion when it can’t hold, this is horizontal expansion .

At the database level, some tables are very large, and the amount of data is in the billions. If it is only a pure level of expansion, it is not necessarily the best. If the table is split, for example, you can perform horizontal splitting according to the user id, and modulo the id. The way to divide users into multiple tables, and these tables can also be on different servers. Vertical unpacking by business and splitting by user level is a common solution in distributed databases.

3. Distributed consistency

In the distributed system, after solving the problem of load balancing, another problem is the consistency of the data, which needs to be guaranteed by synchronization. Depending on the scenario and needs, the way to synchronize is also optional.

In a distributed file system, such as a picture of a product page, if the modification is made, the synchronization requirement is not high, even a delay of several seconds or even minutes is acceptable, because generally there is no loss effect, so Simply by modifying the timestamp of the file, scanning the synchronization once every time, you can sacrifice consistency to improve efficiency.

But the distributed database in the bank is different. A little bit of unsynchronization is unacceptable. It can even guarantee complete consistency by sacrificing performance such as locking.

The paxos algorithm is recognized as the best algorithm in the consistency algorithm. Paxos in Chubby and ZooKeeper is the core of its consistency. This algorithm is more difficult to understand. I haven’t figured it out yet. I won’t go into it here.

--

--

Mina Ayoub

I'm enthusiastic about being part of something greater than myself and learning from more experienced people every time I meet them.