S
S
SKEPTIC2021-02-10 14:02:06
Partitioning and sharding databases
SKEPTIC, 2021-02-10 14:02:06

Virtual shards as an entity?

I study the principles of building high-load projects.

The teacher talked about database sharding. In the part about virtual sharding, he said that as many processes rise on one server as there are virtual shards on one server.
That is, if we have 100 virtual shards for 2 servers, then we raise 50 virtual shards for each server - that is, we raise 50 DBMS instances on each server.

Is it so? Should it be separate instances or separate databases in one instance?

PS the DBMS process listening to connections on a certain port is understood as an instance.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dimonchik, 2021-02-10
@dimonchik2013

do not fool your head with
this: HOW to measure performance, the answer is Yandex Tank,
learn how to use it, and tuning settings is individual + you generally ask without fully understanding what ))

V
Vitsliputsli, 2021-02-10
@Vitsliputsli

Should it be separate instances or separate databases in one instance?

1 instance will also provide multi-thread processing, so there is no difference in this regard, and multiple instances will give a lot of overhead. But, the same long blocking occurs due to hardware limitations, for example, in terms of IO, which need to be solved by several physical servers. Therefore, the matter is different.
You create 100 or more shards in order to balance the load. Those. by transferring shards from one physical server to another, you can distribute the load, and by sharding into a large number of shards in advance, you can do it more flexibly without changing anything in the code. Setting up shards on separate instances is convenient for measuring the load on them, namely the load on the hardware, there is no other way to measure it. But setting up a separate instance for each shard is also fun, in terms of the overhead in the system for maintaining each instance. Therefore, there is no ideal solution, you need to decide for each specific task, and think about how it will be more profitable.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question