Kinto / kinto

A generic JSON document store with sharing and synchronisation capabilities.
http://docs.kinto-storage.org/
Other
4.33k stars 421 forks source link

Persistent memory backend? Load/dump fixtures? #1169

Open leplatrem opened 7 years ago

leplatrem commented 7 years ago

Our use case is the following: for kinto-http.js we want an integration test to reproduce the situation where the history plugin was enabled after the creation of the collection. Since we use the memory backend, there is no persistence of data after change of configuration. (See https://github.com/Kinto/kinto-http.js/pull/173)

We have several strategies there:

My favorite one would be the last one, since we already have synchronized calls on the write method of memory. And memory is a toy anyway...

Thoughts?

Natim commented 7 years ago

What about the idea of removing the memory backend and using a SQLite3 backend (we can use a temporary file in memory to keep the memory backend feature) plus we gain transaction for free? #754

leplatrem commented 7 years ago

I agree, this would be the cleanest strategy.

However the dump/load idea can be implemented in less than 50 lines, whereas the sqlite requires a lot more efforts (sql queries, migrations, ...)

glasserc commented 7 years ago

If we change the memory backend to write to a file and read it on startup, we ought to rename it.

Of the non-SQLite solutions, I think dumping/loading directly into the memory backend is the cleanest.