Facebook uses MySQL, but mainly as a vital-value persistent storage, moving joins and logic to the web servers since optimizations are simpler to perform there (around the “other side” of the Memcached layer).
Can someone explain how can we implement simple key/value stores with mysql? Could it be just a table with bigint as primary key + just one column of
The beginning point should certainly be "is the data relational?" If that's the case, make use of a relational db!
Key-value is a superb solution for non-relational data, but when your computer data is relational, use SQL and that would be that.
To reply to the first question, yes, a vitalOrworth store is simply that, you store a vital along with a value connected with this key. And also you query in line with the key.
The large advantages you receive out of this is,
- Scalability. Now you can easily distribute your computer data across many(1000's) machines. This really is something traditional RDBMS isn't proficient at, joins and acidity guarantees across many machines is either impossible or super slow.
Facebook in addition have a large amount of data that does not fit the relation model that regular RDBMS uses, namely graphs. Which means they query/store/handle the graph character from the data themselves rather than handling with SQL.
The price of doing the work this way is complexity, and frequently you need to quit a couple of points of ACID qualities.
The relaxation people, that isn't facebook/google/linkedin/etc. that only have to handle sites with as many as only a couple of million customers usually can just stay with utilizing a traditional database.