Modular Redis connection and PUBSUB subscription manager for node. Easily extendable. Built for performance, powered by ioredis.

Related tags

Database core
Overview

RediBox

Coverage Status Downloads npm version dependencies build License

Redis connection and PUBSUB subscription manager for node. Built for performance, powered by ioredis (for now). Maintained by TeamFA.

What is it?

RediBox is a NodeJS library which interacts with Redis to provide solutions to common use-cases in your application. It features out of the box support for clusters, sentinels or standalone redis servers. RediBox core provides utilities for managing your Redis client including client connection monitoring, advanced subscriptions via PUBSUB, lua script management and more.

Features

The additional features RediBox offers are provided as extensible hooks which can be used on a per project level:

  • Cache - Flexible data caching service.
  • Job - High performance, robust and flexible queue/worker system.
  • Schedule - Cross server task scheduling.
  • Memset - Synchronised data sets stored in memory across all servers - for quick synchronous access to data that is commonly used but not likely to update frequently.
  • Throttle - Provides lua scripts to throttle things, i.e. 100 inbound http reqs per user every 10secs
  • Trend - Track trending data using Bitly Forget-Table type data structures.
  • API - A JSON API for RediBox (Work in progress).

Getting Started

Install via npm:

npm install redibox --save

If you're looking to integrate this with SailsJS, we've got a hook for that.

And include in your project:

// ES6
import Redibox from 'redibox';

const RediBox = new Redibox({
  redis: {
    port: 7777
  }
}); // optional callback for bootstrap ready status or use events:

RediBox.on('ready', clientStatus => {
  RediBox.log.info(clientStatus); // internal redibox instance of winston if needed.
  // use cache module to set a cached value with a 60 second validity time.
  RediBox.hooks.cache.set('myKey', 'myVal', 60); // use a callback or a promise
});

RediBox.on('error', error => {
  RediBox.log.error(error); // internal redibox instance of winston if needed.
});

For an example of connecting to a cluster see the Cluster Hook documentation.

Configuration

See the default config for all available configuration options.

Documentation

Contributing

Full contributing guidelines are to be written, however please ensure you follow these points when sending in PRs:

  • Ensure no lint warnings occur via npm run lint.
  • Implement tests for new features / functionality.
  • Ensure coverage remains above 80% and does not decrease.
  • Use debug logging throughout for ease of debugging issues, see core.js for example.
  • New modules should follow the same format as the default modules / template.

Note: For debugging purposes you may want to enable verbose logging via the config:

  new RediBox({
    log: {
      level: 'verbose'
    }
  });

License

MIT

Comments
  • Babel config

    Babel config

    • Remove stage-0 preset in favour of stage-2
    • Remove unnecessary references to ./node_modules/bin/ for NPM scripts
    • Swap ES6 import/export statements for CommonJS
    Ready for review 
    opened by rbrtsmith 2
  • Add utility tests

    Add utility tests

    • 100% coverage for the utility functions :tada:
    • Added showcoverage npm script utility that fires up http-server with the coverage. Should make it a bit more friendly for maintainers to get a good overview of test coverage.
    Ready for review 
    opened by rbrtsmith 1
  • Add new labels for PRs

    Add new labels for PRs

    In my previous role our team found these really useful we would have the following labels:

    WIP Ready for review Bug

    Never found we needed any more than that.

    I can add these in if necessary.

    What are your thoughts @Ehesp?

    opened by rbrtsmith 1
  • Fix regex, tidy up npm scripts

    Fix regex, tidy up npm scripts

    Ready for review 
    opened by rbrtsmith 1
  • Update dependencies

    Update dependencies

    • Did not update IO Redis dependency as they've had a major version change & don't want to potentially break something that hasn't been tested that could be being used by consumers of RediBox. https://github.com/luin/ioredis/releases
    • Did not update EsLint to V4 because AirBnB Config causes it to throw and has not yet been fixed. https://github.com/airbnb/javascript/issues/1447 . Instead updated to latest V3 patch release.
    • After the changes EsLint highlighted some missing trailing commas so they were added in.
    • Removed build task from prepublish task.
    WIP 
    opened by rbrtsmith 0
  • v3 release

    v3 release

    Todo's:

    • [ ] 90%+ coverage. More tests \o/ 💯
    • [ ] Pattern PUBSUB methods to match current non pattern methods.
    • [ ] Extend hook functionality and add creating clients with custom config.
    • [ ] Allow LUA script configs to provide a response parser function (example: use on throttle - we can add a function that returns an object instead of an array as the output)
    • [x] Documentation. Needs something better than a readme - readme also out of date, especially the cluster commands.
    opened by Salakar 0
  • Logging out Redibox hooks on ready provides an error

    Logging out Redibox hooks on ready provides an error

    Command >>> Symbol(util.inspect.custom) error: [RediBox] TypeError: command.toLowerCase is not a function at Promise.all.nodes.map.node (/Users/darrenackers/Projects/teamfa/noku.li/node_modules/redibox/lib/hooks/ClusterHook.js:62:55)

    RediBox.on('ready', () => {
        global.Job = RediBox.hooks.job;
    
        console.log(RediBox.hooks);
    
        console.log(' -> Ready');
        next();
      });
    
    opened by dackers86 0
Owner
RediBox
A Redis powered toolbox for NodeJS - Jobs, Scheduling, Caching, PUBSUB & more.
RediBox
Run SPARQL/SQL queries directly on Virtuoso database with connection pool support.

?? virtuoso-connector Package that allows you to create a direct connection to the Virtuoso database and run queries on it. Connection can be used to

Tomáš Dvořák 6 Nov 15, 2022
A node.js locks library with support of Redis and MongoDB

locco A small and simple library to deal with race conditions in distributed systems by applying locks on resources. Currently, supports locking via R

Bohdan 5 Dec 13, 2022
Execute one command (or mount one Node.js middleware) and get an instant high-performance GraphQL API for your PostgreSQL database!

PostGraphile Instant lightning-fast GraphQL API backed primarily by your PostgreSQL database. Highly customisable and extensible thanks to incredibly

Graphile 11.7k Jan 4, 2023
A high performance MongoDB ORM for Node.js

Iridium A High Performance, IDE Friendly ODM for MongoDB Iridium is designed to offer a high performance, easy to use and above all, editor friendly O

Sierra Softworks 570 Dec 14, 2022
⚡️ lowdb is a small local JSON database powered by Lodash (supports Node, Electron and the browser)

Lowdb Small JSON database for Node, Electron and the browser. Powered by Lodash. ⚡ db.get('posts') .push({ id: 1, title: 'lowdb is awesome'}) .wri

null 18.9k Dec 30, 2022
NodeJS PostgreSQL database performance insights. Locks, index usage, buffer cache hit ratios, vacuum stats and more.

Node Postgres Extras NodeJS port of Heroku PG Extras with several additions and improvements. The goal of this project is to provide powerful insights

Paweł Urbanek 68 Nov 14, 2022
Database manager for MySQL, PostgreSQL, SQL Server, MongoDB, SQLite and others. Runs under Windows, Linux, Mac or as web application

Database manager for MySQL, PostgreSQL, SQL Server, MongoDB, SQLite and others. Runs under Windows, Linux, Mac or as web application

DbGate 2k Dec 30, 2022
The nestjs cache module based on cache-manager & decorators 🍃

A progressive Node.js framework for building efficient and scalable server-side applications. zirus-cache zirus-cache for Nest.JS - simple and modern

Yakov Bobroff 4 May 9, 2022
A simple, fast, reliable Object Relationship Manager for Bun.

Burm is an object relational manager for Bun, the fastest Javascript Engine. The name is a merge of "Bun" and "ORM", forming "Burm". Pronounce it howe

William McGonagle 70 Dec 28, 2022
A template for WebSockets powered Cloudflare Worker project using graphql-ws

?? graphql-ws on Cloudflare Workers A template for WebSockets powered Cloudflare Worker project using graphql-ws. The worker serves the following rout

Denis Badurina 26 Dec 18, 2022
First NestJS project powered by TypeScript (Simple CRUD)

First Nest TS (TypeScript) First NestJS project powered by TypeScript (Simple CRUD) Routes Get All GET http://localhost:3000/products/ Get one GET htt

Max Base 3 Feb 22, 2022
WriterAI is an AI based content writing tool that helps users easily write high quality emails, blogs, letters, thesis and other stuff.

WriterAI is an AI based content writing tool that helps users easily write high quality emails, blogs, letters, thesis and other stuff. One can also share their project with others and work as a team.

Ishant Chauhan 67 Jan 2, 2023
Take screenshots easily in multidisplay setups!!

Best Screenshot App for people with multiple Displays. here's the best way to take screenshot of whole displays in a single click: ???? Download the b

null 16 Jul 21, 2022
📄 Easily implement pagination into your Knex.js project.

knex-pagination Easily implement pagination into your application. Usage const knex = require('knex'); const paginate = require('knex-pagination'); co

Snoot 2 Apr 16, 2022
✏️ Extended Writer supercharges Kirby's built-in Writer field with useful marks, nodes and features you wish were built-in

Extended Writer Extended Writer supercharges Kirby's built-in Writer field and block with useful marks, nodes and features you wish were built-in. Fea

coralic 21 Nov 10, 2022
A simple Node.js ORM for PostgreSQL, MySQL and SQLite3 built on top of Knex.js

bookshelf.js Bookshelf is a JavaScript ORM for Node.js, built on the Knex SQL query builder. It features both Promise-based and traditional callback i

Bookshelf.js 6.3k Jan 2, 2023
A Gmail Clone which built with ReactJS and Redux. You can sign in with your Google Account, compose a new e-mail and send realtime emails to the project.

Gmail Clone with ReactJS A Gmail Clone that you can sign in with your Google Account, compose a new e-mail and send realtime emails to the project. Cl

Özge Coşkun Gürsucu 49 Nov 14, 2022