X
X
xolnimda2014-11-16 23:13:22
PHP
xolnimda, 2014-11-16 23:13:22

Which of these technologies is used for what?

  1. memcache
  2. sphinx
  3. redis
  4. mongodb

Share your experience.
What is each of these technologies used for to maximize website performance?
For example, let's imagine a project like fl.ru, but for greater complexity, let there still be chats like in VK.
By default, the project is in php mysql.
What technology where would you screw it?
If I missed something in the list, please add it.

Answer the question

In order to leave comments, you need to log in

7 answer(s)
S
Sergey, 2014-11-17
Protko @Fesor

Ok. let's take your example with fl.ru + chats.
mongodb- hipster database. For a project like fl.ru, I probably wouldn’t use it (not because monga sucks, but because I personally don’t see the point in using it in the context of a project like fl.ru. We don’t need sharding, replication is implemented normally on any normal RDBS, document orientation is not needed, although with a competent approach it would be possible to implement good aggregated collections and optimize selects ... For myself, I did not find a single plus in mongi over RDBS like PostgreSQL). In any case, if you do not leave a choice, we will store all the data here. You will have to spend time getting rid of the desire to join something and implement map / reduce-s to update related collections. But it will be so hipster!
That is, if you have a bunch of queries of the same type with a bunch of joins, the data for which is rarely updated and the selections occur frequently, then you can arm yourself with a mongo and make collections as aggregations of these selections. If you insert references and try to emit joins in monge, then you made the wrong choice of the main data store). True, you can denormalize data with RDBS ....
sphinx- search index. That is, if we have to implement a sane search (for example, according to the job description), then it’s worth using it. Sphinx is not the friendliest but one of the fastest search indexes. It integrates well with MySQL and the like, and when compared with ElasticSearch out of the box, it is a little better friends with the Russian language. But then again, elastics have their pluses. Some of them replace mongu, since they are the same for most features in terms of data storage.
redis - we kind of did a chat there. In addition to the fact that redis is a good key-value in-memory storage, which can also provide us with data storage reliability (it also maps to the file system), it also supports pub / sub. That is, purely theoretically, we can not add things like ZeroMQ and other *MQ to the stack to implement authorization and communication between the chat application and the main application (suddenly our chat will be written in go/node.js/erlang).
memcache - here it is worth considering whether it is needed if we have a radish. Previously, for fat cache, the choice was obvious - memcached, since reddis did not support clustering at that time. Now, according to the possibilities, the radish is far ahead. So even the fact that memcached is a little faster (but eats more memory and does not support authorization out of the box, for example) should not be a reason to use it. But to be honest, I haven’t used redis in clusters and I can’t say anything, but memcached has been tested for years.

D
Dmitry Entelis, 2014-11-16
@DmitriyEntelis

About redis, memcache and up to a bunch of queues www.slideshare.net/mobile/lenvendo/ss-41242835?qid...
Sphinx and elasticsearch - both general and parameterized search.
Mongodb and others - brief differences and cases kkovacs.eu/cassandra-vs-mongodb-vs-couchdb-vs-redis
Specifically about mongo, I don't know loaded projects who use it
. .js with socket.io, maybe some erlang

P
Puma Thailand, 2014-11-17
@opium

obviously all
radishes and memcache for cache
sphinx for mongo lookup
for database

A
Alexander, 2014-11-17
Madzhugin @Suntechnic

memcache, redis and mongodb used together - this is some kind of unrealistic overhead. What for?
One way or another, they are used for about the same thing. It would also be nice to have memcache + [redis | mongodb], but together - somehow silly. So you need to choose specifically for the task. I would choose redis, just because I have no experience with mongo and chats are mentioned - there is nothing better for chats than redis.
You can also use it to store session data (here valet keys to help) and user data. But for example, it would be better to store tasks in the usual database (muscle) or perhaps in mongo.
If it's only about performance and the nose is needed for caching - then memcache
sphinx - in this case, find the extra word. sphinx is a search engine. How can it be used to improve performance?

V
Viktor, 2014-11-17
@Levhav

As for the technologies that you have listed, you have already described them quite well.
But for chats, the listed technologies (memcache, sphinx, redis, mongodb) are poorly suited.
To organize a chat on the site, it is better to use a comet server

I
icoz, 2014-11-18
@icoz

Listen to Radio-T (radio-t.com) - it clearly shows the attitude towards php and mysql
:)

A
asArtem, 2019-10-15
@asArtem

MongoDB - for storing all data that does not need transactions. In fact, this is 90% of cases (addresses, account info, product details). The exception is Finnish. payments when transactions and ACID are needed. Correct use of 2 bases.
The rest has already been written above.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question