droplets icon indicating copy to clipboard operation
droplets copied to clipboard

Embedded database instead of Mongo?

Open xeoncross opened this issue 6 years ago • 7 comments

Given the simple design of the stores and the goal of helping new developers structure their app; I would consider moving off MongoDB onto BBolt, GoLevelDB, Badger, or one of the many other embedded databases.

There are many helper libraries like Bolthold or Storm which can serve as higher-level access helpers.

I have demo repo with some benchmarks and usage samples here.

xeoncross avatar Nov 28 '18 15:11 xeoncross

Absolutely right. Initially I did think of using something very lightweight and simple that doesn't require external process (considered both boltdb and sqlite).. but writing SQL queries in case of sqlite or converting data into key-value in case of boltdb seemed like too much work (didn't really dig into wrapper libraries though.) So went with mgo which has a very simple API.

Now that mongo store is already implemented, it would be cool to add store implementations using boltdb or some embedded db and make it configurable I think. That way point of store interfaces might become clearer as well. Thoughts?

spy16 avatar Nov 28 '18 19:11 spy16

I get this error message after running ./bin/droplets

/bin/droplets FATA[0000] failed to connect to mongodb: no reachable servers

Should I install mongodb

skydev2020 avatar Nov 20 '19 08:11 skydev2020

Yes. Mongodb is required to run this.

spy16 avatar Nov 20 '19 08:11 spy16

Although I install mongodb and run "mongod" it still says "./bin/droplets FATA[0000] failed to connect to mongodb: no reachable servers" which file should I take a look at for database settings?

skydev2020 avatar Nov 20 '19 08:11 skydev2020

You can run MONGO_URI=<url> ./bin/droplets (replace <url> with whatever addr mongo is running on. By default this looks at localhost)

spy16 avatar Nov 20 '19 11:11 spy16

I would avoid BoltDB/Storm. I found it to be over 100 times slower than SQLite for even basic queries.

89z avatar Dec 31 '20 00:12 89z

@89z it depends on your queries. Every database is '100 times slower' for certain workloads. They aren't all designed for the same query paths. Dynamo vs MySQL vs Mongo vs Dgraph vs Redis does not make sense given their radically different architectures.

xeoncross avatar Dec 31 '20 01:12 xeoncross