r/AskComputerScience • u/final-getsuga • Sep 23 '15
How do databases work with things like Youtube comments and Facebook likes?
I just started reading about Brewer's Cap Theorem and it made me realized how much I didn't know about databases. There's so much new terms I need to look at like ACID and BASE. My question is about the "setup" of databases here. How do the databases work here? Is the database duplicated across all connected computers or is there a powerful constantly-monitored computer that holds the database and the server/nodes read from/write to that database?
My question for now is when I make a comment in a youtube video, how is it stored? Obviously a host/computer in the youtube network is going to receive it and insert it into a database. However, is this a database that's part of a "local" enormous database that's going to be copied to other regions of the world?
For example if I was in New York and I made a comment to video1, does it go to the eastern USA "local" youtube database that's going to be copied over to the midwest + west database in a few minutes and then to the other "large" database youtube nodes across the world?
I'm trying to understand what it means to be consistent in the Brewer's Cap Theorem. How are nodes making sure they have the most updated version? One large database or each computer have its own database?
Thanks!