Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

236
Visualizações
Best design pattern for storing News Feed in ElasticSearch

We have an mobile app with 5 millions users and now we are trying to design news feed based on ES. The goal is to have an opportunity for creating posts, storing them and subscribing for another users. So we need to choose posts for everyone depending on his subscriptions.

After some researching and googling I found some popular ways that could be used in our use case.

  1. Creating index-per-user. I think it's not a good idea for us, cos it needs for inserting a new post for each of the indexes of subscribers. Also, what if we have 100 millions of users?

  2. Create one index for all posts. And then for each user we can create an alias with filter by user ids that he is subscribed to. But then we'll have to hip on many shards while creating news feed for user. So there is 3 way.

  3. Routing by userId. It's a similar to 2 way, but the difference is that we create an alias per user with routing by it's userId. The disadvantage is that for each post in our index there will be as many copies as how many people should take it.

There are another patterns, that I've read. But I still have no clear vision - what will the best practice in our use case.

Also, we have an alternative to ES - Cassandra. But the decision is still in process.

Maybe someone could say his expertise in this question and give an advice. Critique is welcome too.

Thank you in advance.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

You Can use Observer pattern, your news Will be sent to all your subscribers

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda