Hacker News new | ask | show | jobs
by Kluny 3489 days ago
I just read the about page. Could you help me understand a little more about how it works? It seems like a tool that could replace sessions and cookies, and possibly a browser-based database?

My current project is a tournament-scoring app where I'm using cookies to hold match scores, so that the score won't be lost if the page is refreshed before the match is over and saved to the database. Would redis be appropriate in that context?

3 comments

I'm not associated with redis, but I do use it daily. It's basically just a really good in memory db. You can use it for almost anything, from job queues, to message brokering, to session storage. Check out the different language clients, find you language of choice and read about how to fire it up and try it out https://redis.io/clients.
I love redis but I would recommend message brokering be done by something built specifically for the task, like rabbit-mq.
Well, yeah of course.
For example Celery supports a large number of message brokers, and a lot of people inexperienced with message passing etc. will use Redis as a broker because they already are familiar with it and running it in production. I myself made that mistake, and have since gotten much better results with the aforementioned change. So while it should seem obvious, theirs a lot of places where it is still accidentally done.
Redis is great for server-side caching to recall data that you normally get from a database often.

If you need client side storage, try jedis (a redis fork in javascript) or lokijs or pouchdb which are all client-side databases.

There's a javascript Redis fork called Jedis? That's extremely confusing as jedis is a common Java Redis client library...
It would be for keeping cookies, sessions and ranks there. I am doing exactly that with Redis and it's ultra fast and easy. Redis has special data structure for what you want to do, it's sorted set, check it out

https://redis.io/commands#sorted_set