@Jean-Baptiste_Beau I did see Alex’s talk at MongoDB Live where he mentioned using server functions to cut up image files after uploading them. Although it could be done this way, there are a few reasons why it should still be done the old way.
First, one typically uses blob storage like AWS S3 or Azure to store these large image assets. MongoDB Realm is not a CDN, so you still have to use this type of storage. Typically, you get a write URL to upload your image to, and then a read URL to share it with other clients. In my opinion, the purpose of the server function is to compute the read and write URLs on behalf of the client, i.e. the client should not have to worry about the details of the blob storage. However, that is what I would limit the role of the server to. Second, I would let the client do the actual work of cutting up the image. Client compute power is cheap, free from the point of view of the developer, and does not encumber paid for server resources. Since the client has to upload the image anyways, uploading the image and the cuts is not that much ‘extra’ work. Plus, the act of uploading should not have to go through a server on its way to blob storage - it should just go there directly. As a rule, when developing collaborative applications, you always want to push work away from the central server towards the client. The server should do the lightweight management, not the heavy lifting.
I hope this was useful.
Richard Krueger