Self-irony picture
But what are the alternatives? Some argue that graph databases are best suited, but I will not consider them, since they are too niche for mass projects. Others say that documentary data is ideal for social data, and they are fairly mainstream for real use. Let's take a look at why people think that MongoDB is much better suited for social data than PostgreSQL.The statement that graph databases are too niche (???) for mass projects (???) working with social graphs is very difficult to justify even with the most authoritative source. From my own experience, I can say that graph bases, despite their name, work fine with graphs (including social graphs). Of course, you should not take graph databases as the main data repository. For these purposes, such tools as MySQL, MongoDB, Postgres, etc. remain indispensable. Similarly, when we need, for example, full-text search, we use Sphinx in conjunction with the main data repository, rather than making a painful choice between it, Redis and MariaDB.
We could also model this data as a set of nested objects (a set of key-value pairs). A lot of information about a particular series is one big structure of nested key-value sets. Inside the series, there are many seasons, each of which is also an object (a set of key-value pairs). Within each season, an array of episodes, each of which represents an object, and so on. So in MongoDB model the data. Each series is a document that contains all the information about one series.If Sarah had read the data modeling guide in MongoDB, then she would know that in this database one can work with more than one data model. But actually, I have one very simple question: did the author ever hold a calculator in her hands? About Google and Wikipedia will not even ask. What is it for me? Let's google the longest series. This masterpiece, entitled Guiding Light , contains 18.262 series of diversity and philosophy. In its background, Santa Barbara, with its 2.137 series, is a white dwarf in the starry sky of cinema. But this is all the lyrics. Now I’m getting bored again, and I assert that before you make a database choice authoritatively, you must not only become familiar with the recommended data storage models, but also with the limitations of this database. One of these limitations is the maximum document size, which cannot exceed 16 MB . And now we take in hand a calculator, hold the power and make a magic calculation, which I read in the book of spells DBA Architect:
The show has a name and an array of seasons. Each season - an object with metadata and an array of episodes. In turn, each episode has metadata and arrays of reviews and actors.
16 / 18.262 = 876 //
, Diaspora, . , ., . , . «best practice» Diaspora, , . , ? , , . . Skype , , . ! , ?
db.actors.aggregate( [
{ $match : { name: "Sisi" } }
{ $group : { _id : "$movieId", count: { $sum : 1 } } },
{ $group : { _id : null, avgMovieCount : { $avg : "$count" } } }
] )
MongoDB. , . . , .Web 3.0, , . , , . .
. ?, . , , , , . , — , . .
. , : . , . , , , .
« » :? ? , ? ? , , «». . , , , , . - , . , . , -, , - , MySQL, , , , .
—
—
—
, - —
. (), . — , . — .. . schemaless, , . — . , — , . . , , — 100 ? MongoDB , . , schemaless. MongoDB . .
? .
Source: https://habr.com/ru/post/243431/
All Articles