4 ms·
And can you explain why? I think not. What's the superior alternative, for every use case?
by tgv 10mo ago
And can you explain why? I think not. What's the superior alternative, for every use case?
- vivzkestrel 10mo agohttps://www.manning.com/books/just-use-postgres https://www.manning.com/books/just-use-postgres
- winrid 10mo agoPG JSON write operations are document level whereas with Mongodb it's field level. Would you use a DB that only let you write an entire row instead of setting a single field? Race conditions galore. Be very careful choosing PG for JSON in production systems...
- rafaelgoncalves 10mo agoon postgres I can update a field easily and atomically with transactions (or there is something I don't know about?), like (postgresql 14)[0]: UPDATE users SET profile = profile || '{"lastname":"Washington"}' WHERE profile->>'name' = 'George Washington'; [0] https://stackoverflow.com/a/38045827 https://stackoverflow.com/a/38045827
- winrid 10mo agoNope. If two writes happen concurrently on different fields you'll lose one write, unless you lock. The storage layer just stores the data as a blob that gets overwritten every time, it doesn't support partial updates.
- empthought 10mo agoOf course it supports partial updates. It just requires you to know the difference between a document and a field, and model your data appropriately.