File uploads for a social media app with Tigris
Social media apps live and die on media handling. Users post photos, upload videos, share documents. Your backend could route every file through your servers, but that burns bandwidth and adds late...

Source: DEV Community
Social media apps live and die on media handling. Users post photos, upload videos, share documents. Your backend could route every file through your servers, but that burns bandwidth and adds latency. Tigris gives you a way to push files straight from the browser to object storage, with the data replicated across multiple regions worldwide. Tigris is an S3-compatible object storage service. Your data lives in multiple regions at once. A user in Tokyo uploads a photo; a follower in Berlin loads it from a nearby cache. You do not pick a primary region. Tigris handles distribution. This post walks through using the Tigris JavaScript SDK to handle file uploads for a social media app. Setup Install the SDK: npm install @tigrisdata/storage Create a bucket at console.storage.dev and grab an access key. Put the credentials in your environment: TIGRIS_STORAGE_ACCESS_KEY_ID=tid_your_access_key TIGRIS_STORAGE_SECRET_ACCESS_KEY=tsec_your_secret_key TIGRIS_STORAGE_BUCKET=social-media-uploads Serve