Storing data in ElasticSearch?

Use ElasticSearch as a primary data store. The question how to store additional user information.
At the moment there is 2 indexes
socket-apps-db : {
 users: {
 "user_id" : {
 "login" : "user_login",
 "email": "user_email",
 "password" : "user_password",

socket-apps-{game_name}-cloud : { // {game_name} - the name of the game for which the cloud

 "data" : {
 "user_id" : {
 "level" : 5,
 cloud: "{cloud_data}"


still planning so as to store the user's friends and messages for each conversation a separate index for the user's friends list too. ID are stored in Redis.

The question is whether I'm doing?
Preferably 1 index to create several types for these things, but ElasticSearch says that only 1 type per index.
Or how to realize such a structure and what databases/tools to use?
March 20th 20 at 11:40
1 answer
March 20th 20 at 11:42
It is not necessary to store the base - it's a search engine, not a normal base in the end) it's not up to it. But if you itch then treat it as a document-oriented
@Lydia_Weissnagree) the rest of their opinions and knowledge will leave with him - ruth commented on March 20th 20 at 12:30
@Nicola.Cole, let's finish holivar) But there is a small but ElasticSearch is written in Java and a lot depends on the version and tuning (GC for example) to which access does not have SaaS. And how it is configured is also not known. Yes, and the Elastic has its own fault-tolerance mechanisms - Adele.Fish commented on March 20th 20 at 12:27
Well, in this case to use? Will die if MySQL if the table is 2-3BN of rows and I want to do a search on it, login? - Mazi commented on March 20th 20 at 11:45
@Dandre_Jenkinsdepends on the architecture - what are the queries which indexes how much load which server is.... If something is elastic guzzles as not in itself, in contrast to MySQL and Postges - ruth commented on March 20th 20 at 11:48
Amendment: Elasticsearch needed exclusively for full-text search. - Shaun.Doyle commented on March 20th 20 at 11:51
@Gilberto, your truth) - ruth commented on March 20th 20 at 11:54
@Nicola.Cole, And if you imagine, how in MySQL to store user's friends, his message? For each bzero generat a new table? type userid_friends,
userid_userid_messages? - Mazi commented on March 20th 20 at 11:57
@Dandre_Jenkins, you should learn a lot about databases and horizontal scaling. Clearly not the scope of this question - ruth commented on March 20th 20 at 12:00
@Gilbertothere is no amendment and OLAP - Adele.Fish commented on March 20th 20 at 12:03
@Nicola.Cole, that's why he eats like a fish? If the arms are straight, all the rules. And given sortirovanie and resiliency so all the candy in contrast to PostgreSQL/MySQL. Oh well, geo-replication, but for the money, but at least she is out of the box - Adele.Fish commented on March 20th 20 at 12:06
@Lydia_Weissn, it's sort of a OLAP. There are much better tools - ruth commented on March 20th 20 at 12:09
@Lydia_Weissn, Yes, all this is good, I do not argue. Is the same comparison for OLTP tasks) there is already the comparison is not in favor of elastic - ruth commented on March 20th 20 at 12:12
@Nicola.Cole, clickhouse, vertica? - Adele.Fish commented on March 20th 20 at 12:15
@Lydia_Weissn, in my case are totally different tools. I am now on the vendor lock so AWS redshift, emr, Athena. - ruth commented on March 20th 20 at 12:18
@Nicola.Cole, this is the solution from Amazon, I mean your own instance. Here I agree, if you live in the Amazon, the life easier. Although again the same ElasticSearch as service disgusting works Amazon. Personally, people were recalibrated on EC2, raised their own ElasticSearch cluster, as a result, the response time dropped from 220 ms decreased to 25-27 ms. And the price decreased. Although I can understand Amazon, need to sell as much as possible, so about optimization and speech can not be. For no knowledge and lack of desire to pay) - Adele.Fish commented on March 20th 20 at 12:21
@Lydia_Weissn, actually went holivar, but all the same ES in AWS is promoted as HA Resilent Self-Management service, so it is more expensive, of course. Out of the box. The slow response can only be due to 2 reasons - wrong resources and the wrong network settings (hi inept novice in the clouds)

And now. About the cost. There is always the opportunity to greatly reduce the cost of compute resources using Reserved instances and spot instances. When you start to work with the resources constantly and plan on spending before it turns out very cheap. I saved up to 70-80% compared to on demand - ruth commented on March 20th 20 at 12:24

Find more questions by tags Elasticsearch