4 ms·
NoSQL with MySQL in Ruby - Friendly
- coltafever 17y agoSounds like active record.
- ivey 17y agoThe difference is that it's schema-less on the backend. It's using MySQL to store JSON (I assume), so schema changes happen at the code level, not at the database level. Like a NoSQL approach that uses MySQL as the backend.
- jasonwatkinspdx 17y agoYes, it's the converse.
- mark_l_watson 17y agoNeat - I just tried it. I am fairly much "in like" with both activerecord and datamapper, but Friendly is cool. I wonder how much work it would take to support PostgreSQL. Friendly looks especially good in MySQL shops - otherwise I would suggest taking a good look at MongoDB (or Redis, CouchDB, Cassandra, etc.)
- jamesgolick 17y agoIt already works with Postgres. Just set :adapter => "postgres" when you call Friendly.configure.
- mark_l_watson 17y agoCool, thanks for the tip.
- amix 17y agoThis seems to be a pretty good implementation of FriendFeed's schema-less MySQL ( http://bret.appspot.com/entry/how-friendfeed-uses-mysql http://bret.appspot.com/entry/how-friendfeed-uses-mysql ) and this option would probably beat most of the simple key-value stores in terms of perfomance, backup and replication. One should note thought that more modern NoSQL databases aren't only key-value stores. For example, Redis offers KEYS command which can scan the store by a pattern. Tokyo Tyrant (another "key-value" store) offers Lua scripting.
- viraptor 17y ago> this option would probably beat most of the simple key-value stores in terms of performance, backup and replication. I wonder why do you think so? Here's a sample test of plain and memcached mysql vs tokyo tyrant (http://www.mysqlperformanceblog.com/2009/10/19/mysql_memcached_tyrant_part3/ http://www.mysqlperformanceblog.com/2009/10/19/mysql_memcach...) It was done without the additional inserts for the index table... I don't see how it can be anywhere close to the TT's performance for example. While mysql's replication is very easy, TT's replication is trivial. Backup is probably comparable - just flush and snapshot... Unless you're comparing it to mysql+MC. Then yes - mysql's performance at 99.8% hits to MC can be ignored. We're left comparing MC with something else. Things might change dramatically if you have a write-heavy application. Or when you have more data than ram. Author's benchmarks will always show great results - let's wait for some real-world data.
- amix 17y agoMost != all :) Tokyo Tyrant and Redis are some of the fastest key-value stores and when I stated that it wasn't with them in mind. There are tons of other key-value stores that can't beat the perfomance of MySQL. I agree that replication in Tokyo Tyrant is generally good, but MySQL's is much more mature and one can get help more easily. It should be stated that I am the author of LightCloud (a distributed db built on top of TT) and I am running big installations of both TT and MySQL, so I speak from experience.
- jamesgolick 17y agoMy data is from a real-world application. One that gets plenty of traffic. Friendly has served almost 50 million hits since we put it in to production two weeks ago. It actually happens to be quite a write-intensive workload. We have definitely seen a slow down on writes, but the speed up on reads has more than compensated for it. We do have more data than RAM. But, most of the data that actually gets read is fresh, so it's hot in cache. Of course Friendly isn't going to be right for everybody. But, I just want to make it clear that my data isn't from synthetic benchmarks. It's from production.