X
X
xerasy2021-11-01 15:47:23
firebase
xerasy, 2021-11-01 15:47:23

What is the optimal database structure for rating?

I use the firebase Cloud Firestore database, I make a user rating system:
each user has points (a rating is built on them). It is necessary to display to the user where he is.

The following scheme immediately comes to mind:
rating -> userID -> score: N
then get the entire list, sort by the score field, find the desired userID and show where it is.
But it does not sound optimal - if there are tens of thousands of users, then such a search will not be the fastest. Can you please suggest how else can it be implemented?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question