Skip to content

Database

Stephen Badger edited this page Apr 25, 2020 · 1 revision

It would be helpful to decide on a core DB technology or approach we want to use. It's not exactly tricky to switch in the early stages, so no worries there.

MongoDB

Thinking that a lot of our data (character sheets, monster stats, pre-populated encounters etc) seem to be liable to be quite flexible, depending upon the tabletop system people are using, this would seem to suggest a document / object store approach could work quite well. Concurrent writes are almost non-existent on the majority of our data I think, but in some areas concurrent reads might be common (such as monster compendium entries).

Due to our aim to use Elixir's Phoenix LiveView as the approach to sync live session data, a lot of the usual REST + HTTP concerns around data access perhaps do not apply. That said, there are non-live cases or secondary use-cases (API for 3rd party tooling etc) where a REST + HTTP approach could be useful. For those cases, it's quite handy to have decent support for generating ETags, taking advantage of native caching etc especially for slower changing information like monster compendium entries. This seems quite achievable through a "document hash" field on the relevant documents, which the Goblin Wrangler can do a basic indexed lookup on, returning a HTTP 304 if a match is found.

Clone this wiki locally