WhiteflagProtocol / whiteflag-api

Reference implementation of the Whiteflag protocol in Node.js that acts as an API to connect applications with the underlying blockchains
https://api.whiteflagprotocol.org
Other
4 stars 5 forks source link

Add lightweight embedded datastore #27

Closed ts5746 closed 4 months ago

ts5746 commented 4 months ago

Description

Add a lightweight embedded alternative to the MongoDB datastore.

Rationale

MongoDB 5.0 requires use of the AVX instruction set, which is not available on all processors, limiting the number of systems that can run this software. Furthermore, an embedded solution with local data storage minimizes dependencies for this minimum viable implementation of the Whiteflag protocol that is primarily used for protocol and interoperability testing.

Solution

Add support for Simple.DB, or a similar solution satisfying the specifications below.

Specification

The datastore must be: 1. local; 2. embedded; 3. able to store JSON documents; and 3. able to query JSON documents.

Affected components

Requires addition of a module in datastores, and related configuration options in config/datastores.toml.

Alternatives

Alternatives are an external dependency and not as lightweight, e.g.:

... or more complex, e.g.:

... or not well maintained, e.g.:

ts5746 commented 4 months ago

Implemented and tested. Ready for merge into next release.