input-output-hk / smash

Stakepool Metadata Aggregation Server
36 stars 7 forks source link

In-memory database #97

Open hasufell opened 3 years ago

hasufell commented 3 years ago

PostgreSQL is quite heavy to set up for e.g. integration tests. There could be an option to run everything in-memory.

Or... sqlite.

Related: https://github.com/input-output-hk/cardano-wallet/pull/2249

hasufell commented 3 years ago

It seems there's already some support for it, but it isn't exposed in the cli:

https://github.com/input-output-hk/smash/blob/d335fed93fdbfaf657a18fb0d83274f51b67cf2d/src/Lib.hs#L129-L137

hasufell commented 3 years ago

I actually think the way forward is SQLite. I've done some hacking on that in a local branch. The reasoning is:

  1. it might be interesting for end-users: postgres is a heavy dependency
  2. SQLite can be run in-memory for integration tests, which means I have more coverage for the smash implementation compared to the stubbed Configuration (since we still run through the persistent framework)
ksaric commented 3 years ago

I have some additional ideas about how to make this even nicer. Some of this will be covered by the upcoming issue creatively called "Add tests for the existing functionality" :smile:

Will report back to you, should be handled in this sprint as well.