Answer the question
In order to leave comments, you need to log in
What is the real scope of MongoDb?
Hello. I'm a little behind the "fashion and youth" technologies and decided to catch up. Now I'm figuring out MongoDb and trying to figure out for myself where I can apply it.
On the Internet, mostly blog examples are given. But, if I correctly understood the essence of monga, then this is not her niche at all. Because, in my humble opinion, a blog should be written using a relational database.
After all, the blog has an author who has articles, which in turn are associated with categories, tags, etc. The articles also have comments. It turns out that there are a lot of connections.
As a rule, when displaying an article on a page, we indicate almost all of its links (author's nickname, tags, categories, comments with authors' nicknames, etc.).
If you store it in a mongo in separate collections, and collect all this with a bunch of requests with each request, then why use a mongo with so many relations at all, because a relational database is more suitable for these purposes. Am I wrong?
Since all of my many years of experience are connected precisely with relations, it is quite difficult for me to come up with a real scope for monga. The only thing that comes to mind is:
1. Logging user actions on the site (there is usually only one relation here, besides, we always search by userId)
2. Microservices. When the main application generates some kind of data set, puts it in the monga, and then the microservice takes it from there and does what it needs, for example, converts the file with the specified settings. I did something sub-house using DynamoDb (essentially the same mong, only from Amazon).
3. Also, here, on the toaster, I met an example about honey. patient charts, when they record various kinds of analyzes and readings from various devices.
So the question arises, where else can you use monga? I'm not interested in answers like "Where there is little relational data and documents are not strongly connected" and "Where each document can only have 5-6 common columns, and the rest can be different" or "Where scalability is needed" . I am interested in real and live examples that are encountered in practice.
Answer the question
In order to leave comments, you need to log in
Monga covers 80-90% of the functionality of sql databases if we consider an average project, but additionally gives more speed, speed and development flexibility, and scaling out of the box.
And you won’t hear much good from haters ;-)
After all, the blog has an author who has articles, which in turn are associated with categories, tags, etc. The articles also have comments.Categories, tags, and the author himself may already be on the client, especially if it is a web application, in this case, the relations do not have to be loaded, thus saving search / reading from the database and less traffic to transfer to the client - i.e. higher performance.
About the example with a bunch of requests - lookup, you won't have to make many requests.
From a personal point of view, it’s easy to prototype in Mongo, change collections, connections, and so on in the course of a song.
The states often make services about shops and services, in monge there are special data types for storing coordinates and finding the nearest one, within a radius, etc.
For blogs, I would take ES better.
Of the pluses, one can also note the most convenient driver out of the box on js, the orm is not needed.
Logging is also great.
Well, do not forget that monga scales perfectly horizontally, different replica policies allow you to very, very significantly increase the maximum load with small forces.
In turn, I want to note that I worked almost very little with sql databases, there are a lot of spaces, very much, but it’s easier to work with them, it’s much easier to make queries on sql, in the same mongo you can get stoned by optimizing queries.
If we go further in NoSQL, there are different approaches for implementing data storage, in monge it is a document, in apache casandra it is a key-value, for example, everything has its pros and cons, I won’t write them here, it’s easy to google. But both sql and nosql dbs need to be chosen based on what the business needs, and very often combinations of different databases are used in large projects.
The choice of the database does not depend on what you will store, but on what requests will be there.
It fits well on the rest, but the main feature is the loess scheme and horizontal scaling out of the box. There are no migrations needed, and you can do whatever you want with the data, coupled with an untyped language like js, this is a killer combination that literally allows you to launch a full-fledged product prototype in just days. Nodejs+express+mongo is a nuclear bomb with which a startup can blow up the market and easily survive a large load if successful. And in a bloody enterprise, I once used the abstractions that I threw in in a couple of hours, with the help of the triple indicated above, temporarily closed a big hole in the product (in fact, stupid cruds were needed there, but for overdohrillion entities with a bunch of attributes), until the backend caught up with the delay in terms.
A quick start, it is much easier for a beginner in IT to master monga than the popular MySQL.
It’s also good for logging, but you already voiced this option.
gee-gee
you yourself answered in paragraph 2
now "the era of big data" - RDBMS is certainly good, but - did you learn to do an instant alter table or what?
Monga is mainly for warehousing, and at least caching (although there are options with aerospike in the first places, but for an amateur)
for transactions, of course, nobody canceled relational
At least a couple of marketplaces use mongodb.
Modern mongodb features reliable replication and failover, as well as working sharding. When the base does not fit not only on one server, but lives on a hundred servers (albeit with triple replication), this begins to play a role.
What other common open source base out of the box, without third-party crutches, allows you to deploy this?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question