Zendist
✅ Typically how is an image stored?
If you can only see your own photo, I would probably base64-encode a thumbnail of the image into the DB and just cache it in-memory on first request, given how few users you have 😄. But good opportunity to learn about blobs and doing it right with SAS etc.
135 replies
✅ Typically how is an image stored?
As mentioned, I would generate a token for the entire container (probably named "user_images"?), per user. Then when the user goes to a profile, you use the token tacked on to the picture and can reuse that same token for all pictures for that one user.
135 replies
✅ Typically how is an image stored?
If it's ok to have public anonymous access to the pictures (definitely not OK in the real world 😄), you can skip the SAS token. Otherwise, the app can generate a container token per user that lasts for some time and keep reusing it.
135 replies
✅ Typically how is an image stored?
That's good advice. Azure blob storage sounds like the right approach for you, if you have a free subscription to play with. You don't always have access to persistent storage, that's why blob or cloud storage services can be useful.
Then you have a blob URL in your DB instead of a file path.
135 replies
✅ Is it possible to use union type in C#?
language-ext has some things like this if you prefer FP:
https://github.com/louthy/language-ext
The language doesn't have it by default (yet). What you're looking for is a discriminated union, right?
14 replies