4 ms·
Depends. Having a real schema can help with performance and correctness guarantees.
by bravesoul2 1y ago
Depends. Having a real schema can help with performance and correctness guarantees.
- speedgoose 1y agoI believe you can make constraints and indexes on jsonb fields.
- bravesoul2 1y agoYes you can. Ergonomically that'll end up being harder sometimes. Sometimes it might be easier too! E.g. mostly loose data but you need a user_id field. Not sure about performance. I imagine if that user_id field is a column you might get better performance. Not least because by choosing columns in a query you reduce the amount of data to be processed. Another benefit of doing it the boring way is tooling. Orms, schema migrations and so on. I work in this space somewhat and think alot about the DX of both key value and relational stores! Think of me as a "Just use postgres" and "Also just use dynamo" at the same time :)