Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

235
Vistas
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 Respuestas
Responde la pregunta

0

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

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda