Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

234
Views
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 answers
Answer question

0

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

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!