Connect with us

Internet of Things

Quiz HN: Cease you aloof utilize MongoDB?

No. Every time I’ve used mongodb we’ve ended up regretting it for one reason or another. And migrating to a different database after launch is a huge hassle.I’ve done a couple projects where we kicked off with postgres using JSONB columns for early iteration. Then we gradually migrated to normal SQL columns as the product…




No. On every occasion I’ve used mongodb now we hang ended up regretting it for one reason or every other. And migrating to a assorted database after starting up is a fundamental hassle.

I’ve performed a pair tasks the build we kicked off with postgres the utilize of JSONB columns for early iteration. Then we gradually migrated to fashionable SQL columns because the product matured and our produce choices crystallized. That gave us most continuously the total advantages of mongodb but with a if truth be told delicate hump toward classical database semantics as we locked down aspects and scaled.

No, I had a sour expertise in 2009 the build it ate my knowledge, the devs had been pretty cavalier with “there is a warning on the catch online page” (I acquired it by lawful), it ate my knowledge again when the OOM killer killed its project.

I didn’t cherish the venture perspective of a database being so lax with persistence, so I by no methodology used it again.

I am primarily the most standard non-MongoDB-employee reply at ‘to what extent are ‘misplaced knowledge’ criticisms aloof legitimate of MongoDB?’

My reply incorporates a historical previous of my experiences with MongoDB that is ultimate equivalent to yours:

I feel cherish MongoDB now is in most cases a ultimate stable product simply by time and funding, however I could perhaps perhaps no longer ever belief the firm for the utilize of our knowledge to beta check for a decade.

Sadly. And devs are aloof doing triple lookups (joins) cherish they’re the utilize of sql, forgetting so as to add indices, and doing melancholy n n schema produce because. Data is a mess and there’s an outage every few weeks. It’s moreover expensive af (doubtlessly as a consequence of sloppy utilize). It’s flexible whenever you’re attempting to “pick up going” but creates anguish later on.

I cherish SQL because it is advance extra expressive and helps you reply questions you didn’t know that you just would possibly hang. I procure that extremely treasured. Rather sophisticated to achieve in mongo. Essentially BQ is lawful for this (as well to to your app DB) but in case you utilize mongo you’re gonna hang a hell of a time stuffing that sloppy schema into any column-oriented dB.

I cherish about a of the serverless GCP dbs cherish datastore and firestore over mongo. They Index every subject and force you so as to add composite indices on first demand fling by spitting out an error with a link to create it. If their uncommon but straightforward API, limits, and quotas, they work predictably and scale close to limitlessly.

Sure, or no longer it is our predominant DB. I aloof cherish it moderately a chunk, we utilize Mongoose as ODM, it makes including new stuff so mighty more uncomplicated with out having to achieve issues cherish alter desk etc. But for our huge knowledge stuff we utilize BigQuery, straightforward as a consequence of trace.

I attain cherish how easy it is to make a selection up a mongo instance up and working in the neighborhood. I discovered upkeep tasks for mongo are mighty more uncomplicated than postgres.

One thing you aloof prefer to achieve is arrange indexes for performance, I’ve needed to utilize many a days tuning these.

I hang bump into some pretty stressful elements, for instance a rely paperwork call is accomplished as an mixture call, but it would now not attain projection the utilize of your filters. e.g you’ll want to perhaps perhaps also be seeking to rely how repeatedly the establish ‘hacker’ looks. It can attain the search in opposition to establish, then attain the $rely, but because it would now not attain a projection, this will most likely perhaps perhaps read the overall doc in to achieve this. Which is no longer lawful when the property you are browsing in opposition to has an index, so it set up no longer must read in the doc at all.

why no longer dazzling attain a lined demand with mixture pipeline by $match and $venture, hitting your total indexes, then pipe the outcomes to $rely.

No, I inherited a venture that turned into as soon as the utilize of it a different of years aid. After 6 months we migrated away to postgres. The files turned into as soon as if truth be told relational so it turned into as soon as dazzling the depraved instrument for the job. I will gaze that it could hang price as a doc retailer but with postgres’ json facilities this point out day or no longer it is titillating for me to study a scenario the build I’d grab it.

I am aloof the utilize of it for few legacy apps. I produce no longer if truth be told look after it but it it is rock stable for that payload: largely dazzling storing straightforward events. For fresh tasks I dazzling utilize Postgres, especially after they’ve launched json datatype I produce no longer hang want for noSQL database for model of tasks I am doing.

Sure, aloof utilize it, alongside with GridFS. We largely utilize it as a persistence retailer for SOAP message dumps from XML to JSON in Java; all the pieces else most continuously resides in a Postgres or Aurora RDS database on AWS or some legacy Oracle/MSSQL stuff in other areas (which we strive to make a selection up rid of).

The subject with most of these issues is that moderately heaps of tasks dazzling want some persistence and classy querying, and nearly any database can attain that equally ultimate. At that point, upkeep, ops workload in fashionable or reliability are the differentiators and most of these hotfoot away whenever you fling them as a provider alongside with your cloud provider of different. Which explicit one you utilize is practically chosen for you: prefer the total ones that are acceptable alongside with your software program or framework and model by trace.

I utilize postgres for ultimate mighty all the pieces this point out day, most continuously with Hasura if I’d like GraphQL.

There turned into as soon as a immediate timeframe (1-2 years or so?) the build I did my tasks with Mongo, but dazzling now I produce no longer gaze what it will provide over one thing extraordinarily stable cherish postgres, which moreover handles JSON amazingly smartly.

What advantages does Mongo hang over cloud managed NoSQL alternate choices lime cloud Firestore or aws dynamodb?

Can you provide benchmarks showing PostgreSQL is faster ?

Because from my expertise MongoDB turned into as soon as no longer much less than 10x faster and all of the benchmarks I’ve seen had been the utilize of pre-WiredTiger storage engine.

Sure, utilize it with Atlas for every of my companies’ tasks.

– The doc model is a no-brainer when working with JS on the front-end. I hang JSON from the patron, and Dictionaries on the backend (Flask), so or no longer it is as easy as dumping into the DB by the pymongo driver. No object relational mapping.

– Can scale up/down physical hardware as fundamental so we most efficient pay for what we utilize

– Sharding is painfully with out complications, with one click on

– Make stronger has been improbable

Sure, we attain at WaystoCap. It be our predominant DB. I cherish it largely for the flexibleness. I mediate or no longer it is one of primarily the most efficient DBs whenever you ruin up in pre-product market fit stage and making moderately heaps of modifications to the knowledge model.

One amongst the predominant cons I’ve experienced with it, is or no longer it is beginner pleasant nature and scientific doctors leads you to hang a non-optimum knowledge schema for No-SQL. Fancy even the advance it does pagination with Skip, is no longer the performant advance to achieve it.

As areas in our industry used and scale we suffer bottlenecks and hang ultimate huge modifications to optimize these areas of the knowledge model.

We utilize it broadly. Essentially the low overhead and nearly no upkeep requirement of startup world is wisely happy by Mongo.

In our final 3 years of usage, we by no methodology confronted any elements from DB. It be improved so much in final 2-3 years and I will tell or no longer it is rock stable dazzling now.

I am most continuously discovering no reason to swap to any other DB.

Sure, aloof the utilize of it for storing pretty unstructured blobs of JSON which I most efficient lookup by key but update with diversified operators ($addToSet, $region, $incr). Additionally the utilize of it as a power session retailer and nowadays for storing rate-limiting knowledge. I’ve attain to cherish the MongoDB update operators and aspects such because the Switch Occasions. On the opposite hand I could in the ruin be shifting off MongoDB as I’d like horizontal scaling by shards, and the sharding setup of MongoDB is needlessly complex and brittle. For the time being planning to transfer with ScyllaDB for my huge-volume key-price blob datastore and a few flavour of SQL for low-volume issues which want extra complex demand habits (particular person database, subscriptions). ScyllaDB will most fashionable challenges since I aloof are seeking to hang the flexibility to update single keys in huge JSON blobs, even when my most efficient lookup is by key.

If MongoDB came up with a better sharding expertise the build every box is equal and you produce no longer want the dance with shards on top of replica sets plus mongos plus config servers plus arbiters I’d prefer into consideration it again.

No offense, but when I fundamental to hang managed MongoDB I’d as smartly utilize AWS DocumentDB.

I if truth be told factor in that here’s a key differentiating feature for many databases. ElasticSearch, ScyllaDB, others too work the identical advance: Every node is equal and in inform to scale you dazzling hang including extra containers, end of myth. Overview that with what or no longer it is a must to achieve with MongoDB.

I am the utilize of it in production but I’d cherish to strive PostgreSQL someday, it looks to be the Rust of RDBMS, getting loads of look after.

MongoDB turned into as soon as most efficient if truth be told ever a competitor to memcached, redis, others and if truth be told most efficient lawful as a caching layer cherish these. It’s miles first rate for that.

There turned into as soon as a time when JSON wasn’t that in-constructed into databases, it is now. That turned into as soon as if truth be told MongoDB’s killer feature.

PostgreSQL does most of this better now and extra sturdy/reliable.

I hang no longer used it for years. I simply prefer relational databases in spite of all the pieces.

When a doc database is lustrous, it happens, I hotfoot with CouchDB. Its multi-predominant structure is pleasing when put next to MongoDB with a single predominant node. But I am concerned on the utilize of PostgreSQL and jsonb subsequent time.

No. I most efficient ever used it previously for issues cherish logging unstructured API responses. Now I dazzling shove that extra or much less stuff into PG JSONB.

I have not used it for a whereas and I have been planning on studying Postgres after mighty praise from a buddy (and the cyber web at huge). I procure DB produce and migrations moderately sophisticated though, any guide/direction suggestion?

No, we used MongoDB in 2009-2010 but it turned into as soon as a anguish as performance and integrity fell aside as our knowledge-region grew. Presumably it’s OK now, but I gaze no reason to return.

I hang by no methodology used MongoDB right now, but I will repeat you since their license shenanigans I prefer into consideration it toxic.

Their “we can strive some assorted produce of Delivery Source (which if truth be told is now not always if truth be told originate provide at all, but we aloof prefer you to mediate so, because we all know originate provide is standard) moreover AWS did one thing depraved by the utilize of our instrument accoding to the license that we used for our instrument” thing if truth be told didn’t encourage any belief.

yes. Because we predicament knowledge from assorted websites, and they every has very a assorted train material layout. mongodb handles unstructured knowledge smartly

jsonb is limited in or no longer it is querying capabilities. you are in point of fact casting the json as a string when storing and querying, or no longer it is no longer if truth be told json. therein lies the earnings of doc model, native secondary indexes, $ for everry nested layer, etc.

Postgres’s jsonb layout is with out a doubt no longer “if truth be told” a string. You should perhaps be ready to make a selection up native indexes on json fields in Postgres, and you’ll want to perhaps moreover demand fields however you cherish.

I produce no longer factor in that is dazzling, as far as I perceive jsonb is a binary representation, no longer textual train material. And there are with out a doubt ways to index jsonb columns, either a feature index on a particular jsonb expression or a GIN index in tell that you just’ll want to perhaps perhaps be moreover function incorporates (@>) queries in opposition to the overall jsonb contents.

MongoDB is a ultimate lawful database IMO. I’ve used it at so much of companies in the previous and would no longer mind the utilize of it again.

My popular DB is RethinkDB. It be a shame that the firm in the aid of it fizzled out and turned into as soon as absorbed by Stripe. I aloof cannot wrap my mind around why or no longer it is no longer extra standard. It be equivalent to MongoDB but mighty better. It be the superb database. It provides constraints which pork up the quality of your code. Additionally RethinkDB scales totally and the hang watch over panel that consists of it is mind-bendingly extremely efficient, I am no longer kidding; you’ll want to perhaps moreover click on a button to shard or replicate a desk over extra than one hosts! WTF! I cannot tell the identical about Postgres sadly. There’s nothing if truth be told unprecedented about it.

I utilize Postgres for one of my tasks this day but purely as a consequence of compatibility reasons with an existing plan. I produce no longer perceive what the total hype is with Postgres.

mighty of the anti-mongo sentiment is around those that used it in 2009-ish.

or no longer it is handy to point out that as soon as the utilize of the early version of any instrument, there shall be bugs. that is a trade-off early adopters repeatedly prefer to deal with. sadly, it hasn’t sat smartly over time despite every of the troubles being addressed since.

aid when mongo turned into as soon as around 2.6x, they’d a world write lock.

Additionally, you are going to encounter extra complications with mongodb if in case you wish transaction. You should perhaps perhaps perhaps aloof check out extra discussion here on db techniques.

IMO I’ve attain to study DB transactions as a hack because they restrict scalability.

It be that you just’ll want to perhaps perhaps be moreover factor in to make utilize of two-segment commits as a replace. Two-segment commits can scale with out restrict but or no longer it is a must to be extra cautious when designing your tables and specifying your indexes.

MongoDB 2.6 turned into as soon as released 7 years prior to now. Why are you bringing it up ?

Whenever you utilize MongoDB this day then (a) there is now not this kind of thing as a world write lock and (b) there are transactions.

Learn More

Continue Reading
Click to comment

Leave a Reply

Your email address will not be published.

twelve + 2 =