A
A
Alex Raven2013-10-24 19:38:30
PHP
Alex Raven, 2013-10-24 19:38:30

MongoDB for dating site

Prologue. I have to design a dating site from scratch. There is no question of the expediency of creating a new such site when hundreds of others already exist: the customer is an American company that specializes in dating, and they already have 5 similar sites. I have experience with dating - I have been developing them for 6 years.

The new project should be initially designed for a high load, so I think to use everything that I have already used - server cluster, caching, CDN, plus - MongoDB. As the main backend - PHP + MySQL. I want to ask more experienced colleagues what data should be stored in MongoDB. I have the following guesses:

- User profiles
- Authenticated user sessions
- Image links
- Messages exchanged between users
- Localization strings

As for user profiles, I'm not sure yet - because I have to JOIN them with other tables in MySQL. I would be grateful for a hint.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
M
Max, 2013-10-25
@7workers

I have experience with mongo. Monga doesn't like going to the disc very much. indexes must fit in memory, then it rustles well. I strongly advise you to make a test setup and drive more data there, at least random ones. Inserts mongo records very quickly so you can play around. Mongo has many nuances, out of the box, it is difficult to use it in large projects without dancing (I change the data structure quite often, but I have a specific project). There are basic principles that you need to follow, such as storing data in the form in which it will need to be displayed, there are no joins, links to documents are actually quite slow. Try, try. Then, so as not to bite your elbows :) ask how I can help.

S
slayerhabr, 2013-10-25
@slayerhabr

I don't think you're coming from the right direction. If you paraphrase, then your question sounds like this - "I have a mong, where would I attach it."
It seems to me that you need to initially set the tasks correctly, and only then choose the tools for them.

W
Wott, 2013-10-25
@Wott

Think of mongo as a caching or accelerator, that is, find what slows down, is a bottleneck and redo it with mongo. It is clear that you can offer something offhand, but it would be more correct to fill in the test data and pull it, or even launch the beta. In general, optimization is driven by objective data and not offhand opinions.

E
Evgeny Gorbov, 2013-10-28
@DOLARiON

Of course, I don't have much experience with Mongo, but I think the idea of ​​storing profiles in the database is not bad enough. Starting from the profiles themselves, ending with the data for obtaining an avatar - everything is convenient, in a tree form ... and very quickly. That's what I would do. Also, I absolutely agree with the wording that “all the money is in MySQL”.
However, it was not very pleasant for me to stumble upon a “delayed write” in Mongo ... at first they could not understand what was the matter for a long time ... it seems to be saved, but when reading, they received old data. It is treated simply - by waiting for the record, but that's if you know. Pay attention to this too.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question