rfx-stack icon indicating copy to clipboard operation
rfx-stack copied to clipboard

DB agnostic or rethinkDB support

Open carlditzler opened this issue 7 years ago • 5 comments

rfx-stack requires mongoose, and I am using feathers-rethinkdb; prefer a single DB. Enhancement supporting a flexible DB or add'l DBs would extend rfx-stack and reduce dependencies. Thanks

carlditzler avatar Jul 09 '16 14:07 carlditzler

I used mongo as demo. Because Feathers already supports more dbs out of the box you can change the implementation easly. For example, If you want to use rethinkdb, remove all the mongo dependencies first, then:

  • use the feathers-rethinkdb in /api/server.js instead of feathers-mongoosehttps://github.com/foxhound87/rfx-stack/blob/master/src/api/server.js
  • in the /api/connector.js you should implement rethinkdbdash(instead of mongoose) passing to it the configs. https://github.com/foxhound87/rfx-stack/blob/master/src/api/connector.js
  • in the /api/autoloader.js change the implementation here https://github.com/foxhound87/rfx-stack/blob/master/src/api/autoloader.js#L12 extending the ServiceConfig and passing the rethinkdb adapter to its Model property (rethinkdbdash will be this.adapter in your case).

You should remove the models because rethinkdbdash doesn't support a model schema. Consider using something like thinky if you want models: https://thinky.io

I will create a detailed guide.

You can follow the feathers database doc for more info on how to implement rethinkdb: http://docs.feathersjs.com/databases/rethinkdb.html

foxhound87 avatar Jul 10 '16 16:07 foxhound87

A detailed guide will be great. Thank you! 💃

briandpassa avatar Jul 11 '16 04:07 briandpassa

+1 for DB agnostic solution guide. Personally I would like to use this stack with NeDB (as it is a pure JS solution and no binaries required) and I'm stuck now understanding all the mongo dependencies implemented.

mishoboss avatar Jul 27 '16 13:07 mishoboss

+1. The example should include minimal dependencies, so I'd go with NeDB. It sucks having to strip out Mongo.

chriswessels avatar Jan 07 '17 11:01 chriswessels

@chriswessels I hope this can help you. https://github.com/Weifeng-Ying/rfx-stack-NeDB/commit/ff30437a0d825b74b2b471ad67042a1cddfca85e

Weifeng-Ying avatar Mar 09 '17 01:03 Weifeng-Ying