I am working on a small ml app, where some image can be uploaded and an estimation is given in return. There will be 5 to 50 users and I need to keep track of the usage of these users to create monthly reports and maybe limit the usage to some amount (counter). I am using fastapi and would like to know what would be a good pathway.
Store the usage in SQL ? Extra DB table for: user ID, usage count, filename, date
Or create one nested list with all the data for all clients and sort it out each month for each user . list = [[ID, Date, Filename], […]]
Or create a nested list for each customer with ID, usage count, filename, date. list_user_ID = [[Date, Filename], […]]
I am not sure what to do. SQL might be safe and provide nice API options but needs fancy SQL queries to set up the limit and extra DB requests in API ? Lists are maybe good for setting up a limit direct in api with a counter function but need to be in memory when used ?
I have looked at many Fastapi APPs but could not find a single one with this kind of monthly reporting. Most big APPs use stripe or other payment tools which I don’t need .
What is a common strategy for this concept. Any Idea or hints for me ?