I am trying to make an application like instagram using node.js. The problem that I am facing is how to store the user specific data? I am a beginner in making these type of projects.
An user registers -> then logins -> then uploads picture.
I have a collection of users from where I do the Authentication. Now, I am stuck. I have thought of the way the application works but I am confused on how to get the images that a user uploads? I know how I store the images in a database but I don't know how to make them user specific.
In other words : Suppose userA uploads an image and userB uploads an image. How can I store them in a database? - Do I store them together and when one userA logs in I GET the images with his name or do I store those differently?
If I store all the images of all users at a single collection then it would be really slow if a huge number of images and users are there. I want to know about some method that will let me store the images uploaded by user at a specific contiguous memory , maybe or any other way.
Any Resource and help is appreciated.
Thank You