I am interested to know the performance impacts of using MySQL as a key-value database vs. say Redis/MongoDB/CouchDB. I have used both Redis and CouchDB in the past so I'm very familiar with their use cases, and know that it's better to store key/value pairs in say NoSQL vs. MySQL.
But here's the situation:
So basically, I'm looking for some info on the scalability of having a key/value table in MySQL. Maybe at three different arbitrary tiers:
A practical example is in building something like MixPanel's Real-time Web Analytics Tracker, which would require writing very often depending on traffic.
Wordpress and other popular software use this all the time: Post has "Meta" model which is just key/value, so you can add arbitrary properties to an object which can be searched over.
Another option is to store a serializable hash in a blob but that seems worse.
What is your take?
The scalability of key-value database is achieved through which method? The scalability of this database is achieved through sharding replication.
Mysql is best as because they are sql based and still many web company are using it with happy endings but still no-sql opened a gate way for high web scalability, has u must know, in mysql you cannot scale but in noSQLl you can scale parallely and it is high performance, but still mysql benchmarks is high in DB field, ...
Avoid MySQL Scalability Limitations MySQL was originally designed as a single-node system and not with the modern data center concept in mind. Today's largest MySQL installations cannot scale by using MySQL as a single system and must rely on sharding, or splitting a data set over multiple nodes or instances.
The scalability of Key-Value database is achieved through sharding replication. Explanation: The Key-Value database is also known as key-value store. It refers to a data storage program that is specially designed for keeping and retrieving data structures.
There is no doubt that using a NOSQL solution is going to be faster, since it is simpler.
NOSQL and Relational do not compete with each other, they are different tools that can solve different problems.
That being said for 1000 writes/day or per hour, MySQL will have no problem.
For 1000 per second you will need some fancy hardware to get there. For the NOSQL solution you will probably still need some distributed file system.
It also depends on what you are storing.
I'd say that you'll have to run your own benchmark because it is only you that knows the following important aspects:
I'd also say that depending on the durability requirements for this data, you'll also want to test multiple engines: InnoDB, MyISAM.
While I do expect some NoSQL solutions to be faster, based on your constraints you may find out that MySQL will perform good enough for your requirements.
SQL
databases are more and more used as a persistance layer, with computations and delivery cached in Key-Value
repositories.
With this in mind, those guys have done quite a test here:
To answer your question, a Key-Value
repository is more than likely to outdo MySQL
by several orders of magnitude:
Processing 100,000,000
items:
kv_add()....time:....978.32 ms
kv_get().....time:....297.07 ms
kv_free()....time:........0.00 ms
OK, your test was 1,000
ops per second, but it can't hurt to be able to do 1,000
times more!
See this for further details (they also compare it with Tokyo Cabinet
).
Check out the series of blog posts here where the author runs tests comparing MongoDB and MySQL performance, and fights through the MySQL performance tuning mess. MongoDB was doing ~100K row reads per second, MySQL in c/s mode was doing 43K max, but with the embedded library he managed to get it up to 172K row reads per second.
It sounds a little complicated to get that high on a single node, so ymmv.
The writes/second question is a little harder, but this still might give you some ideas on configs to try.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With