I
I
Ivanoff-i2016-05-13 20:48:47
PostgreSQL
Ivanoff-i, 2016-05-13 20:48:47

How to scale the database if the main load is on the record?

Actually, a question. It is clear with the load on reading, we write to the master, we read from the slaves. And what about the write load? How to ensure consistency if writing to different servers? How to ensure, for example, the uniqueness of values? How is all this done?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Lebedev, 2016-05-13
@swanrnd

Partitioning
https://ru.wikipedia.org/wiki/%D0%A1%D0%B5%D0%BA%D...

L
lega, 2016-05-14
@lega

How to ensure, for example, the uniqueness of values?

To do this, you can use sharding, the key field (index) is divided into ranges and the data is distributed across servers, while the uniqueness is preserved for the key field.
You can use ssd instead of hdd, you can put the database in RAM, you can use inmemory db.
If the resulting data is not immediately needed, then you can simply write to a file in a row (this allows you to write 1..10M records per second, no database will give you that much), and then, for example, rake and place them in a cluster or somewhere else.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question