Skip to content

Redback - a high-level Redis library for Node.JS

redbackjs.com
31 pointschrisohara5 comments
On HN

Comments

Why did you make this instead of using existing solutions? What were they lacking that this adds?

It's a higher-level abstraction. With most traditional clients you call commands like `hget(key)`, `zinterstore(key1, key2, key3)` or `mset(key1, value1, key2, value2)`

Redback gives you the same power/flexibility but hides the complexity. You call `hash = redback.createHash(hash_key)` and then call something like `hash.set({key1:value1, key2: value2});`

It's more than just convenience though. I had a few goals with the library:

- Make Redis more accessible

- Create some useful derivative/hybrid structures (SocialGraph, etc.)

- Expose useful atomic constructs such as auto-incrementing keys

- Make it as easy as possible for users to create their own structures (e.g. see the Queue example in the README)

nolite - as far as I know most existing clients (in nodes case there aren't many) just expose the native redis command set. redback has added densityset, keypair, socialgraph and cappedlist - pretty cool commands if you ask me!

Cool. Have you thought about implementing any of these in lua to try out the experimental scripting support?

Yeah definitely - I'm waiting patiently for the EVAL stuff to make it into the main branch. Very excited to see what's possible now that atomicity can be retained with higher-level structures

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.