Sample Header Ad - 728x90

Which database scheme will be better for dating app performance?

0 votes
1 answer
1554 views
My Schema Diagram I'm creating dating app like Tinder with Spring Boot and want to make sure that even with huge amount of data it will be working with best possible performance. My tables looks like above. All tables and actions reference profiles.id. **Question 1:** **Should I make separate table for men and separate for women or stay with one table and when querying filter by 'gender' using WHERE?** **Question 2:** **While fetching for 50 profiles to swipe, should I do it like that:** 1. Getting whole 'profiles' table with all columns filtering by 'gender' 2. Deleting already swiped ones (backend server job) 3. Shuffling (backend server job) 4. Selecting first 50 out of the rest of profiles (backend job) **or like that:** 1. Getting all profile ids 2. Deleting ids of already swiped profiles 3. Shuffling (backend server job) 4. Getting first 50 profiles by ids, one by one or using condition IN **?** Second way sounds better assuming huge database and many users requesting that simultaneously, but is it correct answer to that case?
Asked by Ugabugaman (3 rep)
Dec 6, 2022, 01:38 PM
Last activity: Nov 2, 2023, 05:41 PM