This is probably a known pain to many of you, yet I’ve come across people here who’ve never had to use an external database, so maybe they can shed light on my problem.
I’m working on a project that helps people from a similar professional sector share leads with each other.
The basic logical structure are user profiles with professional preferences such as geographical area etc, and the relationship between the users:
- Colleagues, i.e. people I know personally and invited to join my network
- Colleagues of colleagues (AKA in LinkedIn as 2nd).
- The rest of the users
When a user gets a lead that they cannot service or that they need to transfer to someone in their network who has more accurate expertise, they create a search ticket. The ticket is based on several properties, and the results should be divided to three categories:
Colleagues of colleagues
As this is an MVP, I would like to try and stay on Bubble without going to more robust databases or backends.
I built what I considered the best data structure for the requirements and populated it with 4500 users, which is more or less the KPI that shows we have product market fit and it’s worth investing in scaling.
The data structure is as follows:
User datatype, which contains a list of the direct colleagues.
Relationship datatype that has From and To fields of type user.
With 4500 users each able to connect to around 100 colleagues, the relationship table size is almost 500,000 records after I populated it with random connections.
To limit the size of the results as close to the database level as possible, I took someone’s advice and added privacy rules so users could only see their colleagues’ colleagues only.
Still, when I want to limit the results of a search to the Colleagues of Colleagues population, which is around 10,000 relationship records per user, the search times out.
This is the “Do search for users” on the Colleagues of Colleagues group:
The first 4 items are constraints related to professional preferences, and the 5th constraint makes sure the returned user population is only from the Colleagues of Colleagues population.
To test where the bottleneck is, I tried to create a state that would only return the relationships, which timed out as well.
I know this is a lot, but I would be grateful if you could find an issue with my architecture, search, or have ideas on how to further test and optimize.
Thanks in advance!