You should also really use hiredis, it will make a huge performance difference. The other thing to keep in mind is that with redis, you might want to pipeline multiple writes writes at once. Finally, Postgres has to parse the SQL query which is more expensive than reading the binary protocol used by Redis.
But, in all honestly, I wouldn't pick a technology simply based on these kind of benchmarks ;) - Matt On Wed, Jun 27, 2012 at 11:51 AM, Guyren Howe <[email protected]> wrote: > On Jun 27, 2012, at 0:02 , Nathaniel Barnes wrote: > > > So after Guy's talk introduced me to postgres' hstore (thanks for that > btw), I was curious to see what the performance difference between it and > redis would be in serializing objects. A couple of others at the meeting > expressed some interest in it and I finally got some spare time to throw > together a script to get some results. So with that in mind, here's the > quick script I wrote, and the results it generated. > > > > https://gist.github.com/3001890 > > > > Not sure what's with that massive spike with selects from postgres at > 10,000 selects. I figure most likely my macbook just ran out of memory or > some such. I should likely try this again in an EC2 instance for giggles. > That being said, the base key/value store is clearly faster, which was > largely expected since it doesn't have to deal with any of the normal > relational overhead. However that also means you don't get all that > delicious relational overhead. > > > > Just thought I'd share with everyone :) > > This is great, thanks! > > The obvious question is whether Postgres was configured to work similarly > to Redis. That would mostly mean using an unlogged table in a RAM disk. > > -- > SD Ruby mailing list > [email protected] > http://groups.google.com/group/sdruby > -- SD Ruby mailing list [email protected] http://groups.google.com/group/sdruby
