Reputation: 8960
I'd like to implement a fast, smooth search. Searched items are not that many: ~100 max. Each item holds the amount of data a facebook event would hold. They will all show up on initial load (maybe an infite scroll). Data won't change frequently. No more than 100 concurrent users.
What's the best caching strategy for search results, given above conditions?
What's the most scalable strategy?
Stack
Possible solutions
Upvotes: 1
Views: 398
Reputation: 1396
A cache layer definitely doesn't hurt. The user amount shouldn't be an issue. Even the smallest ec2-instance on aws could handle that easily.
You could try and add a tiny bit of delay in the textbox so not every keystroke fires a search but maybe give a leeway of ~50ms? Gotta try and see how it feels when typing in the searchbar.
For 100 items Vuex can be quite fast too, as long as you don't load static assets like images directly into Vuex. ~100 items in JSON data isn't a lot - but it doesn't scale as well if your app suddenly has 10000 items.
Best scenario in my opinion:
Edit: - have the api, cache and database close by eachother so communication between the instances don't have to travel far.
Upvotes: 2