Hacker News new | past | comments | ask | show | jobs | submit login
Redis 101 (no.gd)
68 points by mace on June 25, 2010 | hide | past | favorite | 7 comments



Uh-oh :-) Just leaving a comment here as I created these slides and shared the URL on Twitter for a few interested parties to check out.. I had planned to finish and clean them up based on the results of a talk I gave today before promoting them online. So caveat emptor, and all that, but enjoy!

(And yes, I was reminded during my talk that memcached does expiration too! :-))


It's an excellent slide deck for getting started as is! Reminded me of a few things I wanted to try out a while back.


Impressive presentation. I like the slide layout quite a bit (after I zoomed out a couple times and got used to it).


I'd love to start using Redis as my main datastore, but I think I'm scared because I don't realize how "persistant" it actually is -it looks and behaves like an advanced cache, but does it work out as well in practice as your main datastore as your good old mysql does?

There's another nice feature of SQL databases is that you can quickly get a view of all the data by browsing through the tables and they are kind of self explanatory. With Redis and other NoSQL datastores, that seems harder - but maybe it's just me.


To have more "persistance", at the sacrifice of speed, you can use the "Append Only File"[1] feature. You can also decrease the time it takes to make a snapshot.

To view all data you can use the KEYS pattern command [2]. Like it says in the link, the command is pretty fast ("entry level laptop can scan a 1 million keys database in 40 milliseconds"!) but not recommend for use in production.

The difference is that you don't have tables and have to name the keys properly, this is where the pattern argument of KEYS comes in. Just name the keys based on this template: <type>:<id>:<field> and you're set. (eg: Username from the user with id 1001 in the user "table": user:1001:username)

[1] http://code.google.com/p/redis/wiki/AppendOnlyFileHowto

[2] http://code.google.com/p/redis/wiki/KeysCommand


A great introduction to Redis!


P.S. The Scribd version looks horrible. Lots of arrows and similar are missing so some slides won't make any sense.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: