why not edn in a text field?
how would you persist ‘a text field’?
Postgres is highly optimized for indexing and searching data at a granular level. If you do JSONB, you get all the indexing and search stuff for free. If you do EDN in a text field, it’s just an opaque blob as far as Postgres is concerned, so you can’t look inside it and search on / index its constituents.
@paul.legato What are lib are you using to convert the edn game state into JSONB before saving it into Postgres?
JSONB just means ‘JSON binary’; it’s an optimized storage format used internally by Postgres. You can put any standard JSON in there. I use Cheshire, but any JSON will work.
you will wind up adding redundant metadata to the row that allows you to find, say, “inventory for player 1234” or “all players who have item XYZ”, which will eventually drift out of alignment with what it says in the EDN blob. Synchronizing two sources of truth is a hard problem.