Created
April 27, 2015 08:12
-
-
Save dg3feiko/d99df91913076f63667c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var dbs = require('dbs'); | |
//registeration | |
dbs.newStore("Address",{ | |
"config" | |
{ | |
}, | |
db_engine:"http://aws.us-1.dynomodb.com/postmen/postmen_address" | |
validator: | |
cache:null | |
}) | |
var dbstore = dbs.newStore({ | |
address: {}. | |
user: {} | |
}) | |
dbs.newStore("User",{ | |
db_engine:"http://aws.us-1.dynomodb.com/postmen/postmen_user" | |
validator: | |
cache: | |
}) | |
==================================== | |
var myMW = fucntion(req, resp, next) | |
{ | |
var dynamodb_client = dbs.store("User").db_engine; | |
} | |
=================== | |
var map = {}; | |
DBS.modules.export = { | |
getStore:function(key) | |
{ | |
return map.key; | |
}, | |
setStore: function(key, params) | |
{ | |
map.key = new Store(key, params); | |
} | |
} | |
Store.prototype.put = function(params) | |
{ | |
//validate input | |
//save to dynamodb | |
// cache it to redis | |
} | |
Store.prototype.findById = function(params) | |
{ | |
//load it from cache | |
//if cache hit, return result | |
//else load it from db and then insert to cache | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment