DART Climbing
 · The future of speed climbing training

DB Viability Question

Hi, im developing a training app where users log almost every day a form with 5-6 questions(mostly integers). They will have a stats page where they will see personalizaed statistics. these stats will come from querys made in the db to search for certain data and later perform a few mathematical operations with this data befor displaying it. Data structure I thought to setup is: everytime a user logs info it creates a document with 5 values and a timestamp of the day. these documents are stored like a collection depending of my user document which is at the same time in the users collection. I though this could be efficient for my needs, however these are my main needs

In order to provide the athelte accurate stats I must perform the following actions:

  • Query all the documents of the last 90 days for a calendar feature using the timestamp in each document to effectively filter

  • Query within the last 30 days documents for the value of a variable named ´DailyMax´ which should be a decimal number and receive a list so that I can perform an average of the DailyMax.

  • Also to be suitable for a reward system that will query among your data and if a conditional becomes true the you receive a reward

This is to begin with my main needs. it would be great if some Firebase/Flutterflow expert can shares its coments about the viability of the project as well as the setup of the db. if someone has any idea of how to setup the db in a more efficient way I would be very grateful to hear it.

Thanks in advanced,

Yago

3
3 replies