A
A
Anton V.2021-04-11 19:02:47
Data storage
Anton V., 2021-04-11 19:02:47

How best to provide access to files in a multiuser system?

Good afternoon, the question is most likely banal.
But I would like to know how it is customary to implement this.

There is a company chat where you can send photos and files.
Photos in the chat have a preview.

I see two options for implementing the provision of access to files, those who have access.
1. On the server side, make a layer that will check file access rights, make a request to S3 / Google storage, receive and send data to the client. (it is possible to cache on the server and clean up over time)

2. When generating chat messages, generate temporary links for access (for example, an hour) and receive data directly from S3 / google storage.

the first option has more load on the server, and the second one has a bad feeling, they say there will be problems ... (cache, and what will be the behavior when the time expires ... regeneration of the link as it is used ....)

What other options are there?

Thanks for the time!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question