L
L
littleguga2015-07-07 00:50:48
big data
littleguga, 2015-07-07 00:50:48

How is data storage organized?

Good day.
Where and what can you read to answer the question: "How is the VK database arranged, and specifically, such a moment is of interest - a group can have subscribers, but they can be stored in different databases (for example, a group of 3 years and 3M participants) and even on different servers, how do you get the entire list of participants?"
Thanks in advance for your reply!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Viktor Vsk, 2015-07-07
@littleguga

To find out how the VK database works, you need to read their documentation, specification, terms of reference, wiki or something else where they can store a description of the system.
To answer the rest of the questions in general and in particular about how to store data on different servers, the keywords for searching are database replication, sharding, distributed databases and derivatives.

L
Lesha Kiselev, 2015-07-07
@Yakud

Obviously, an index of user IDs is built for each group.
The index does not have to be stored on one base instance, it is sharded. The counter of the number of users is stored separately.
Profiles are also stored in shards.
VK has a fast mechanism for loading profiles in a "batch".
The algorithm is something like this:
1. Haven't reached the end of the index?
2. We get a "pack" of identifiers.
3. Load profiles.
4. go to 1
5. done! Loaded all users from the group.
The trick is that in a "unit of time" access to all data of group users is not needed.

X
xmoonlight, 2015-07-07
@xmoonlight

It's simple: the group object stores ITS list of user identifiers (subscribers) that are included in it. Thus, flags are simply checked when a new record is notified: the user exists (and is not blocked) and notifications are allowed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question