D
Resources of any end server. Every connection to the client consumes memory, processor, part of the network. So if you have a large number of users and connections, you try to use a few servers by assigning a load between them.The first thing that comes to mind is to separate static files (CSS, JavaScript), annex and database. We put them on different servers.Further, we increase the grouping of servers for static files by assigning a separate dose to them, either a balancer can be placed in front of them or each server has its own sub-distance, choosing them by accident. If the pressure on the statistic is increasing, you're just increasing the number of servers in the statistic pool.Next, we'll scale up the application server, and we'll increase their grouping. You can't afford to keep the user's media files on the same server, otherwise you're gonna have to use the avatar on one server to spread it to all the servers of your bullet. If they're hundreds, you'll forget all the channels. That's why all the media files are stored on individual servers, better in some infinite vault (Swift, S3, Ceph). In this case, all the servers with your application will only have the code and their number can be increased by comparing the balancer load.Next, the database is the hardest place. Usually, any database has a replication mechanism when you connect databases to the chain, recording data in one server(s) on the replication mechanism, it is reproduced on all sub-servers (slaves). There are two problems: the information is reproduced with some delay on the one hand, on the other, so you only scale reading, the record is not large. If you have a small number of users who write, you'll still be able to live with one master if their millions are the ones that should be scaled differently. There are several mechanisms: a replication by type of ring, when you combine a number of masters in the ring, say 10, and every tenth id-nick writes to your individual server, which is divided by the rest of the replicative masters (not seen in the living mechanism - very hemorrhoid for many reasons). We can calculate the user's hex, for example, by his name and distribute users to different servers, for example, you have 256 database servers, we're computing md5-hash, we're taking the first two hexa symbols, they're about to be 256 servers. All users with suitable hesh can be serviced by a dedicated database server. Usually, they try to select a mechanism that distributes users more evenly.Next thing you know, you're starting to set up separate software application modules, advertising runs your pool of servers, commentaries, your own, your news, your counters. It's only in the past that you don't want to do this unless you need real-time enumerators you need a separate system for them. Just spend time and effort. However, design the application so that it has a database, an application server, a statistician and a media file can be serviced by different servers, and better server pools are good.