-
Notifications
You must be signed in to change notification settings - Fork 4
Database schema
Douglas Naphas edited this page Feb 17, 2019
·
4 revisions
Mad Liberation's database is one DynamoDB table, called seders.
seders is a heterogenous table representing:
- seders,
- participants,
- scripts, and
- libs.
The primary key is room_code|lib_id.
room_code is the partition key. It is six capital letters.
For participants and libs, room_code gives the associated seder. For scripts, room_code is a unique identifier starting with AAA that must be different for each script.
lib_id is the sort key.
lib_id is:
- The type of item, which can be seder, participant, script, or lib, and then, in the case of everything but seder:
- A # (hash)
- Further information about the item, which is:
- For participants, the lowercase, 64-byte, hexadecimal, SHA256 hash of the Game Name.
- For scripts, the script number.
- For libs, the lib number. It must be different for each lib within a seder.
There is a global secondary index script_index, a number, that:
- Identifies the record as being a script, and
- Gives the order in which the scripts should be listed on the Pick Your Script page.
There is a local secondary index, lib_order, a number, that gives the order in which libs appear.
TODO: check whether LSIs can be sparse.
This document describes the schema as it will eventually be.