LightCloud: Distributed key-value database built on Tokyo Tyrant
opensource.plurk.com
opensource.plurk.com
my test results are the following:
[root@server test]# tcrmttest write -port 1978 localhost 100000 <Writing Test> host=localhost port=1978 tnum=1 rnum=100000 nr=0 ext= rnd=0
......................... (00010000) ......................... (00020000) ......................... (00030000) ......................... (00040000) ......................... (00050000) ......................... (00060000) ......................... (00070000) ......................... (00080000) ......................... (00090000) ......................... (00100000) record number: 200001 size: 6928736 time: 22.460 ok
[root@server test]# tcrmttest read -port 1978 localhost <Reading Test> host=localhost port=1978 tnum=1 mul=0 rnd=0
......................... (00020000) ......................... (00040000) ......................... (00060000) ......................... (00080000) ......................... (00100000) tcrmttest: tcrdbget: error: 7: no record found record number: 200001 size: 6928736 time: 21.996 error
[root@server test]# tcrmttest remove -port 1978 localhost <Removing Test> host=localhost port=1978 tnum=1 rnd=0
......................... (00020000) ......................... (00040000) ......................... (00060000) ......................... (00080000) ......................... (00100000) tcrmttest: tcrdbout: error: 7: no record found record number: 100001 size: 6928736 time: 22.692 error
how can I reach the 1M put/get?
Looks like TT is around 2-3K records / sec in read/write. I've tested with all kind of table structures (on-memory hash, b+ tree, disk based hash, b+ tree, table, etc). and it was the same speed all the time.
From some other comments, it seems I'm not the only one confused. Tokyo Cabinet+Tyrant are pretty new on the scene and there isn't a lot about them in English yet. So, if you add a level of explanation to the site that seems excessive to you, people would probably find it more useful than you expect.
When scaling upwards you would generally _really_ want to scale horizontally, since the vertical scale has a limit and you can quickly reach it (plus, buying bigger machines is generally much more expensive than buying extra machines).
Comparing the posted benchmark results with http://memcachedb.org/benchmark.html
You get around 2800 r/s using LightCloud vs. around 64000 r/s using Memcachedb
and around 1080 w/s using LightCloud vs. around 23500 w/s using Memcachedb.
I would be interested in seeing some benchmarks that compare both.
I really like LightCloud's idea of automatic scaling, failover and load balancing.
And if you liked, you could extend LightCloud with memcachedb support (which we also had at one point and ran it in production [see my posts on memcachedb mailing list for proof]), but really, when it comes to key-value databases, it's really hard to beat Tokyo Tyrant, which is the fastest and most feature complete key-value database out there (IMO and I have looked at most of the popular solutions).
Do you have any plans for developing a PHP API for LightCloud?
Thanks for your excellent work. I hope documentation will be improved.
This said, Tokyo Tyrant performs better than memcachedb and offers more features (such as master-master replication and Lua scripting).
I posted a comment a while back on Tokyo Tyrant vs. memcachedb: http://news.ycombinator.com/item?id=480055
You could also store this in MySQL, but generally, storing key-value data is not the force of a relational database such as MySQL and LightCloud (and other key-value databases) are optimized for this kind of storage.
btw, i'm also using tyrant myself, a very cool thing indeed!
You say it doesn't have any concept of eventual consistency. Yet how does it coordinate updates to nodes? Does it do two phase commit? Paxos?
Additionally, if high availability is really a big issue, then a node A''' can be introduced that can be in another data center.
If you add nodes to the storage ring, then some of the existing keys will be invalidated. To solve this issue and the issue of routing a lookup ring is created. Lookup ring holds a pair (key, storage_ring_location). The system will automatically update (key, storage_ring_location) if it's at some point invalidated (such as that key does not point to node A, but node D).
I have tried to find an easy solution for a rather complex problem. Keeping membership state, doing Paxos and keeping routing tables would have been much more time consuming to make - so I have tried to solve the problem from another angel (by using master-master replication for high availability).
I'd be more interested and might provide a somewhat less negative attitude if you were to do some real testing on a proper dataset (several hundred megabytes or gigabytes, not 10 bytes) and could show that adding servers actually improves performance.
The current test-data and test-script is simply insufficient to the point of being useless.
Try to benchmark your relational database by doing this: - create a new connection - fetch one row - close connection
And try to compare this to selecting multiple rows at once. The result will be MUCH different. And this basically outlines the difference between your benchmark and mine.
This said, you will only hit limitations with a relational databases if you are having lots of data. If you run a blog, a low traffic site or can keep all your data in memory, then you won't have any problems. And I do have experience in the world of relational databases and using MSSQL won't solve this problem for you (else you would see Facebook, Friendfeed, Twitter and Google etc. use MSSQL or Oracle).