TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Have you switched from Postgres or relational data to MongoDB?

5 pointsby busymom0almost 2 years ago
I am dealing with data which is stored as JSONB data type in postgres currently. This column needed to be used in the `where` as filter. For example, a json can contain title, body, url, some boolean values etc.<p>While Postgres does allow creating an index on this JSONB column, I am wondering if MongoDB would be better suited for this instead of Postgres?<p>Have you switched any project from postgres or relational data to mongoDB or similar nosql db?<p>When dealing with JSON data, is Postgres better or MongoDB?

1 comment

penne12almost 2 years ago
Postgres by far. The inbuilt json support is great. In addition, Postgres as a whole has decades of bullet proofing behind it. MongoDB doesn&#x27;t have many advantages, has many bugs and sharp edges, and doesn&#x27;t have enough advantages to justify it&#x27;s use. In [an old analysis by Jepsen](<a href="https:&#x2F;&#x2F;jepsen.io&#x2F;analyses&#x2F;mongodb-4.2.6" rel="nofollow noreferrer">https:&#x2F;&#x2F;jepsen.io&#x2F;analyses&#x2F;mongodb-4.2.6</a>), MongoDB 4.2.6 exhibited &quot;read skew, cyclic information flow, duplicate writes, and internal consistency violations. Weak defaults meant that transactions could lose writes and allow dirty reads.&quot;<p>Will note that json&#x2F;text columns are better than jsonb. Lower serialization overheads and surprisingly smaller binary size. Or better yet, just normalize to a columnar format.
评论 #36463817 未加载
评论 #36463862 未加载