Thursday, August 8, 2019

Scaling databases

https://www.youtube.com/watch?v=dkhOZOmV7Fo



Scaling databases

too much load 

master - slave1, slave2,  replicate 

master  handles write, slave handles read, a lot of read compared to write. 

Downsides

- doesn't increase with speed
- replication log

Too much data in one machine 

Master - does not fit into one machine, one computer memory

Too much data

Shard

Hash to multiple machines

1-100   101-200  201-300

downsides

- complex queries 

- range query - hit all the machines - merge the result -> sort them in the memory - join becomes difficult 



replicate and sharding 

One setup for replicate 

another setup for sharding 

No comments:

Post a Comment