Code Monkey home page Code Monkey logo

redis-oplog's Introduction

Welcome to Redis Oplog

LICENSE: MIT

Build Status

RedisOplog

A full re-implementation of the Meteor's MongoDB oplog tailing. This time, reactivity is controlled by the app, opening a new world into building reactive applications, highly scalable chat apps, games, and added reactivity for non-persistent data.

Incrementally adoptable & works with your current Meteor project.

Installation

meteor add cultofcoders:redis-oplog
meteor add disable-oplog

Configure it via Meteor settings:

// settings.json 
{
    ...
    "redisOplog": {}
}

// default full configuration
{
  ...
  "redisOplog": {
    "redis": {
      "port": 6379, // Redis port
      "host": "127.0.0.1" // Redis host
    },
    "retryIntervalMs": 10000, // Retries in 10 seconds to reconnect to redis if the connection failed
    "mutationDefaults": {
        "optimistic": true, // Does not do a sync processing on the diffs. But it works by default with client-side mutations.
        "pushToRedis": true // Pushes to redis the changes by default
    }
    "debug": false, // Will show timestamp and activity of redis-oplog.
    "overridePublishFunction": true // Meteor.publish becomes Meteor.publishWithRedis, set to false if you don't want to override it
  }
}

To see what you can configure under "redis": {} take a look here: https://www.npmjs.com/package/redis#options-object-properties

meteor run --settings settings.json

Notes

RedisOplog is fully backwards compatible, so there won't be any change in how you use Meteor, unless you want to fine-tune your application for absolute performance.

To make sure it is compatible with other packages which extend the Mongo.Collection methods, make sure you go to .meteor/packages and put cultofcoders:redis-oplog as the first option.

RedisOplog does not work with insecure package, which is used for bootstrapping your app.

Stats

If you are interested in viewing how many observers are registered or memory consumption:

meteor shell
import { RedisOplog } from 'meteor/cultofcoders:redis-oplog';

// works only server-side
RedisOplog.stats()

The levels of scaling reactivity

  1. Just add RedisOplog, you will already see big performance improvements
  2. Fine-tune your reactivity by using custom namespaces and channels
  3. Implement your own custom reactivity by using Redis Vent

Optimistic UI

If you are using Optimistic UI (Latency Compensation) in your application, you should give this a read.

How It Works

Find out what RedisOplog does behind the scenes

Fine Tuning

Find out how you can use the advantages of Redis Oplog to make your app very performant.

Redis Failover

Find out how you can hook into redis events to customize, when it fails.

Redis Vent

Find out how you can customize your reactivity and enable it across multiple languages/microservices with ease.

Outside Mutations

If you have different workers/services that perform updates to mongo and they exist outside Meteor, you can still trigger reactivity for the Meteor instances with a few lines of code.

Premium Support

If you are looking to scale your business using this package and you need to have your back covered. We are here to help. Feel free to contact us at [email protected].

redis-oplog's People

Contributors

claudiuroman avatar jamesgibson14 avatar maxnowack avatar ramezrafla avatar theodordiaconu avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.