Hello there - new to this community but love how active it seems and looking forward to learn more.
I’ll keep it short, i’m looking for a good model that will fit my requirements. Will give short example of the bottlenecks i’m experiencing.
I have 2 ‘tables’, Company and Reviews
To keep it simple, assume i have >20k rows in Reviews.
I am currently, in my application, querying through the Reviews and filtering by the
companyid at runtime when a user lands on a page.
It is taking ~16 seconds to query and get that data (around 5-6k entities) - I am using google cloud Datastore and transitioning now to mongodb thus looking for best practices on this.
- What is high level advice which I can look into?
companyidseems like a good index to start with.
- Do you see anything wrong with this model growing quickly? the Reviews can be expected to go upwards of 500k in the next 3 months.
- I assume the best thing is to keep the Reviews rows on their own - or can i use the concept of ‘parents’ aka the companyid being the parent of a list of review rows - is that pretty much just another ‘index’? I’m bringing terms I have seen on GC Datastore so take it easy on me on this one Historically, I’ve worked with relational databases.
- Update 1: Inserted 25000 sample Reviews rows and created an index on the
companyid. To get all reviews for a company still took ~11 seconds - assuming right out of the gate that this is not the way to go about it. Now considering having a collection for each month and storing the review ids there. But then I’d have to be making 2 calls to the DB everytime i need to get reviews (not the worst solution, but looking for scalable alternatives)