Skip to content

Instantly share code, notes, and snippets.

@dg3feiko
Last active August 29, 2015 14:26
Show Gist options
  • Save dg3feiko/0915bd33bab3fa6bd0ee to your computer and use it in GitHub Desktop.
Save dg3feiko/0915bd33bab3fa6bd0ee to your computer and use it in GitHub Desktop.

class: left

Title

var redis = require("redis");
var mongo = require("mongodb");

class DataStore {		
	constructor(){
		this.redis = redis;
		this.mongo = mongo;
	}
	
	save(id, data){
		this.mongo.insert(id, data);
		this.redis.set(id, data);		
	}
	
	retrieve(id){
		let data = this.redis.get(id);
		if(data)
		{
			return data;
		}else
		{
			return this.mongo.findById(id);
		}		
	}
}

class: middle, right

Agenda

  1. Introduction
  2. Deep-dive
  3. ...

Introduction

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment