2

I am trying to make my first web app with was Lambda, Cognito, Amplify, API Gateway, and DynamoDB. I followed the tutorial aws made, and it went well. Now I need advice on how to store user information for my custom app (which will be written in python). I need to store a large amount of information for each user (the app is very similar to a todo list app) and I was planing on making a dynamoDB table for each user with the table name being the user's username. The problem with this is that I have read that it is not good practice for noSQL databases to have a lot of tables and I don't know how to get the user's unique ID from Cognito. Is there a correct way to do this? I want to ensure that each user can only access their information.

Seth A
  • 51
  • 7
  • 100% DO NOT CREATE a 1-to-1, table to user, relationship in dynamoDB that would get out of control and is highly unnecessary. To answer this question more accurately you would need to provide a rough estimate of what a 'large amount' of information is. – pkarfs Jun 20 '20 at 00:17
  • Thank you for your reply! I thought that a table for each user wouldn't be the best solution. Each table could store between around 100 KB and 5 MB depending on how much data the user inputs. So, "large amount" is probably not the best way of saying it. – Seth A Jun 20 '20 at 01:50
  • Yeah your better off using a single table which stores your users per row. Then you could either couple this with a secondary table for reference data or s3 links for large objects there are a few different solutions. Is the 5mb all information structures e.g. a big json file or photos ? – pkarfs Jun 20 '20 at 03:08
  • Thank you for the repies! I have no database experience so it has been a struggle. It is all a big json file. The app tracks invantory for electronics parts and screws and such. So, if I understand correctly, I should have a table of users and a table of json data which will be referenced based on the user requesting the data? – Seth A Jun 20 '20 at 03:25

0 Answers0