Index user create account info

Hello everyone i'm bulding a social media app. I'm planning to use elasticsearch as the search engine for the user search in the app. I'm using currently a PostGreSQL database as my source of truth, where all my users information are stored at. I'm looking for tips on how to implement elasticsearch, while still keeping my postgresql database as my primary database for storage.

When a user creates an account, I create a new row in my database. However, with elasticsearch as a search engine a want a near realtime update so as when someone creates an account, I may search for it instantly. Should I then, when a user creates an account create two requests, one for storing the data on my database and one for my elasticsearch instance?. If so, should I do this using the index API or bulk API (it is a single request for each user)?

Thnak you,

checkout this post

HI I forgot to mention that I use logstash currently to send data from my databases to elasticsearch (for data analysis). Is it better to use logstash with a scheduler set to the minimum of time or index the document directly to elasticsearch.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.