Welcome!
In recent years, increasingly hear mention about NoSQL and MongoDB in particular. The topic interested me, but can't find my information, so I ask here — surely many have time to experiment, and may develop serious high-load applications in conjunction with MongoDB.
Warns you in advance if somewhere I was wrong in relation to MongoDB — I didn't mean to. Just I haven't even tried to work, but only read articles on Habre, but those examples that lie at the office.website.
I am designing the network teaser. The task, at first glance, seemingly trivial, in fact it is quite microvillae in terms of organization of structure of a DB. A huge number of relations, multiple tables intermediaries for relationships M-M, etc... Than I was attracted to the idea of MongoDB is its principle of building relationships. Question No. 1:
whether working with Mongod with a bunch of ties is less costly in terms of resources? Well, at least the simplest example (I will write in "pseudo SQL") — sampling from 2 tables linked by relation M-M through the intermediate table:
table sites(
id int primary key auto_increment,
url varchar
)
table categories(
id int primary key auto_increment,
name varchar
)
table sites_categories(
site_id int,
category_id int
)
Task display a list of sites and categories in which it is:
SELECT * FROM sites
while(SITE = mysql_result...)
{
//display website
SELECT * FROM categories WHERE id IN (SELECT category_id FROM sites_categories WHERE site_id = SITE)
//in a loop display category
}
Also, I'm interested, is it possible to work simultaneously with MySQL and MongoDB? I mean, how is that right? To switch your DB to Mongo did not want to, only a few specially-cunning plots, the load of which is higher than desirable.
Also read that MongoDB can easily store files — is this so and what would be better to keep the old-fashioned way in a special folder with subdirectories for the names/user IDs, or use MongoDB? (let's say in this scenario: users about 1K, each 40-50 small pictures. pictures are given in a quantity of approximately 100-150 / min.
PS: I apologize for possible inaccuracies in the questions, redundant or untold information about the needs and current situation, development of database schema — not my main advantage...