Erlang (and by association Elixir) tooling has a nice progressive approach to managing state.<p>Agent -&gt; ets -&gt; dets -&gt; mnesia -&gt; riak (or sql tooling etc.)<p>(Agent <a href="http:&#x2F;&#x2F;elixir-lang.org&#x2F;docs&#x2F;v1.1&#x2F;elixir&#x2F;Agent.html" rel="nofollow">http:&#x2F;&#x2F;elixir-lang.org&#x2F;docs&#x2F;v1.1&#x2F;elixir&#x2F;Agent.html</a> is just a state-holding process. Erlang folks can probably write one of these in their sleep, Elixir added a bit of wrapping-paper around it.)<p>If you&#x27;re writing an app, I think it&#x27;s best to be storage-agnostic from the get-go. You shouldn&#x27;t be building up queries in your core app code- push it to the edge of your code, because otherwise it&#x27;s not separating concerns. All your app (business logic) code should delegate to some wrapper to work out the specifics of retrieving the data; your app code should just be calling something like Modelname.specific_function_returning_specific_dataset(relevant_identifier) and let that work out the details. That way, if you ever upgrade your store, you just have to refactor those queries but your app code remains the same. On top of that, in your unit tests you can pass in a mimicking test double for your store to do a true unit test, and avoid retesting your store over and over again wastefully. (You&#x27;d still of course have an integration test to cover that, but it wouldn&#x27;t be doing it <i>on every test</i>.)