Fillype Farias
Fillype Farias

Reputation: 660

Autocomplete from 50k records - which DB solution to use?

I want to create an autocomplete to Rails 5 app with PostgreSQL and I'd have a database with something around 50,000 records available to the user find out (neighborhoods from one entire country). I did some research on web and there are many tutorials outdated and some of them was using redis as the best option for this case. So, are there something new that I should follow in these days? Thank you.

Upvotes: 0

Views: 290

Answers (1)

Greg
Greg

Reputation: 6659

To summarize the comments under the question (writing it down, because users looking for answers usually gloss over comments... I know I do)

  • 50k records data set is not that big
  • nature of the data set is that it will be rarely updated
  • therefore there will be a lot of reads, and almost no writes

So PostgreSQL database should be more than enough, and Martin suggested great read about trigram indexes perfect for the task.

If the day comes that there are a ton of users trying to use this autocomplete at once - you should be fine with simple replication.

Upvotes: 1

Related Questions