3 ms·
My understanding, which is admittedly minimal, is that MongoDB provides some conveniences around partitioning and distributing your dataset that Postgres does n
by eyelidlessness 10y ago
My understanding, which is admittedly minimal, is that MongoDB provides some conveniences around partitioning and distributing your dataset that Postgres does not without additional work. Simply supporting JSON accommodates MongoDB's approach to schemas (not having them; er, pushing constraints to application code), but doesn't address the distribution concern.
How well does MongoDB support this need, and how hard is it to achieve equivalent results with Postgres? What are the drawbacks?
- twblalock 10y agoMongo's partitioning/distribution/replication does not work as well as it should. In particular, my team has seen several serious bugs pertaining to replication in release versions that were so bad, they should have blocked the release.
- elmigranto 10y agoSide note: you can have constraints, `check`s, indexes and triggers on `json` and `jsonb` columns in Postgres. In fact, you can have everything other data types have. So "no schema" or "moving schema to app level" doesn't have to be the case, when using PG.
- bonesmoses 10y agoExactly. With Postgres, you can add CHECK constraints to enforce specific keys, with any level of nesting desired. So an INSERT could reject a document for having missing fields, fields of improper type, etc. It all depends on how strict you want to be.