Some amount of future-proofing can be done in the case where your data is currently unstructured JSON, but you may need what a relational database offers in the future by using something like Postgres with the JSON data type. But there are tradeoffs between Postgres + JSON and Mongo that you may need to play with to decide which is better for your usecase.
Cons: No transactional consistency, you lose all the Pros of relational databases.
Unless you absolutely know why you want to use Mongo (and there are cases, probably), you don't want to use it.
Mongo is a JSON repository.
Good for: When you have to transact with an ever changing and evolving API that you do not have control.
Looks good on Resume, Looks bad on Costs.
Using JSON with either PostgreSQL (JSONB) or MySQL is probably a much better bet. If you scale to the point that you really need sharding and not just multi-master and/or read replicas, then you can probably afford the migration.
All this is to say: from a software engineering standpoint I like defining my schema rigidly at the DB level. The added flexibility that NoSQL provides is not something I actually find desirable. That said, I've never had to share one of these DBs with other programmers.
Currently, my go to library is MartenDb which has the best of both worlds.
Documents with duplicated properties for queries.
https://martendb.io/documentation/documents/customizing/dupl...
If you want a more detailed answer, let me know, since it could take a while to write everything down :p
The alternative for this with mongo db is an elastic search on top of it for queries. But yeah, that doesn't feel good/overkill.
As soon as you need to scale it up by sharding or replicating, you’re fucked.
Do I want smaller scale JSON DB? Postgres fits perfectly. And it works until surprisingly large scales, unless your update load is massive.
Do I need a truly distributed HA DB with JSON support? Well, Cassandra used to be fine.
I just posted a "Show HN" of a simple demo app I made that uses CouchDB installed on the client side. CouchDB will run a Mac, Windows, and Linux desktop PCs.
The demo uses PouchDB.js to interact with CouchDB. PouchDB is really pretty sweet.
Take a look at the demo and play around with it a bit. There are two web pages that are both self contained. One sets up a user and db, the other demonstrates crud routines.
https://cherrypc.com/app/editor/setup.html
https://cherrypc.com/app/editor/index.html
Also check out the PouchDB docs: https://pouchdb.com/