What is the most efficient way of implementing a friend system?

Hello, I am implementing a friend system in my app, the friends list of a user can potentially go up to 100-1000.

The most basic way of doing this is saving a List of Users on the User. However because bubble downloads all the contents of the current user when loading the page,Ii feel like this approach is suboptimal for performance.
Is there a better way of doing this?

Maybe creating a “link” data type connected to the user which contains the list of friends, and it is fetched only when needed.

Or maybe creating a data type which just stores a connection, (ie just stores two users who are friends), which can then be fetched using a search.

Let me know what you think/what you have implemented!

Hello @nico.dicagno

That many entries warrants an indirect relation approach to your dB model. In other words, your idea about a data type with two fields of user types should work. Friend 1 and friend 2 of type user.