
NoSQL with MySQL in Ruby - Friendly - madh
http://friendlyorm.com/
======
amix
This seems to be a pretty good implementation of FriendFeed's schema-less
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
> 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_memcach...](http://www.mysqlperformanceblog.com/2009/10/19/mysql_memcached_tyrant_part3/))
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.

~~~
jamesgolick
My 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.

~~~
viraptor
I didn't mean to imply that those benchmarks are synthetic. What I had in mind
is that when you write some software, you will improve it to solve _your_
problem better than other software (why would you do it otherwise ;) ). I
meant real-world as in -- from various sources and applications -- just so
that we can see how useful it is and in what situations it's better / worse.

~~~
jamesgolick
Totally fair.

------
mark_l_watson
Neat - 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
It already works with Postgres. Just set :adapter => "postgres" when you call
Friendly.configure.

~~~
mark_l_watson
Cool, thanks for the tip.

------
coltafever
Sounds like active record.

~~~
ivey
The 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
Yes, it's the converse.

