r/ProgrammerHumor • • Oct 18 '24

Other mongoDbWasAMistake

Post image
13k Upvotes

446 comments sorted by

View all comments

1

u/sebbdk Oct 19 '24 edited Oct 19 '24

Use the right tool for the job :)

MongoDB is not made for queries, it's a document database and not a proper indexed database like any of the SQL flavour databases.

edit, i mean not made for complicated queries

1

u/fisadev Oct 19 '24

A db that can only be used to store data and is not ok to retrieve data filtering by two fields, is not a db, is /dev/null, haha. Data is stored to then be read :)

1

u/sebbdk Oct 19 '24

Maybe i should clarify and say i meant complicated queries.

Sometimes a database does not have a bunch of rules/indexes and are just used to return the whole/most of a table.

Think what Elastic search was made for. :)

edit, fixed shitty english

2

u/fisadev Oct 19 '24

Elastic wasn't made to return the whole table or most of it, but quite the opposite. It was made as a full text search engine, to find the small subset of documents that contain some text inside a huge collection of documents.

But anyway, you're missing the point (respectfully): it doesn't matter how complex or simple the filters are, the query language is still super crappy, when it could have been as clean and readable as technologies that were decades old when MongoDB came out. Having to manually write the AST in json is crazy, hehe.

2

u/sebbdk Oct 19 '24

Yeah i know, but doing a text search does not include joins etc. i've used it. :)

Yeah you are right i think i am missing it a bit, probably because i dont mind the JSON queries much.

Cheers!

1

u/fisadev Oct 19 '24

Cheers!