'Where should I keep data to continuously use in server?

Currently, I'm trying to build a dating app(server part).

I'm going to store each user's profile data like videos, photos, profile messages to AWS S3.

And I have user info including location(longitude, latitude) in my database server.

If you've ever used this kind of app, you might easily understand how it works.

First, whenever a user opens this app, the user gets to see the profile of other users one at a time based on the current location.

Second, the user gives like or dislike to the current profile and gets to the next profile.

So, in order to implement the first step, I'm going to search other users in a certain distance from the user's current location in the database, but here I'm only going to get unique user ID values from database. This only happens once when a user opens the app.

Now that I have other users' id values like [id1, id2, id3, id4...] I can load each user's profile data from AWS S3 with each unique id value one by one whenever the user needs to see the next profile.

Here my question comes. To build the recommendation logic like that, where should I keep the id values??

Thanks in advance.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source