File Storage and Object Storage
Think of a school where each teacher keeps the students' papers in a desk drawer. Ask the wrong teacher, and your paper is not there. A better school keeps every paper in one central archive, and any teacher can ask for one by its label. Object storage is that archive for your app's files. This page tells you why local files break on many servers, how object storage works, and what a tester can check.
5 min read5 মিনিটে পড়া যায় · 6 sections6টি সেকশন · 9 sources9টি সোর্স · updated Oct 2026আপডেট: Oct 2026
Where does the uploaded file live?আপলোড করা ফাইল কোথায় থাকে?
Upload on Server 1, read on Server 2: the file is lost on a local disk and found in a bucket.Server 1-এ আপলোড, Server 2-এ পড়া: লোকাল ডিস্কে ফাইল হারায়, বাকেটে পাওয়া যায়।
You’ll learnআপনি শিখবেন
- Why a local disk breaks on many serversঅনেক সার্ভারে লোকাল ডিস্ক কেন ভাঙে
- What a bucket and a key areবাকেট আর key কী
- What the database keepsডাটাবেস কী রাখে
- What a presigned link doespresigned লিঙ্ক কী করে
In plain words
On a single server, a file upload is simple. The app saves the file to its own disk. But with many app servers, each server has its own disk. A file that is on Server 1 is not on Server 2. So the local disk is not a good place for files.
Object storage is a shared store for files. Amazon S3, Google Cloud Storage, and Azure Blob Storage are examples Source 1সোর্স 1 Source 2সোর্স 2 Source 3সোর্স 3. In S3, an object is a file plus the metadata that describes it. A bucket is a container for objects Source 1সোর্স 1. Each object has a key, which is its unique name in the bucket Source 1সোর্স 1. Clients can read Azure Blob Storage objects over HTTP or HTTPS Source 3সোর্স 3.
Azure Blob Storage is made for large amounts of unstructured data, such as text or binary data Source 3সোর্স 3. Microsoft lists uses such as images or documents for a browser, files for distributed access, video, and backup Source 3সোর্স 3. AWS advises you to keep large files, such as images and documents, in S3. The app gets a file when it needs it Source 4সোর্স 4.
This tutorial advises one design: keep the file bytes in object storage, and keep only the file key or URL and its metadata in the database. Metadata is data about the file, for example the owner, the size, the type, and the upload date.
Object storage also helps with security and speed:
- Private by default. S3 buckets and objects are private until you give access Source 1সোর্স 1. New buckets do not allow public access by default. But a user can change the policies and make files public Source 5সোর্স 5.
- Short-lived links. A presigned URL gives time-limited access to one object Source 6সোর্স 6. The link works until its expiry time Source 6সোর্স 6.
- Direct upload. If the app server moves every file itself, the transfer uses its compute, memory, and bandwidth Source 8সোর্স 8. The Valet Key pattern gives the client a limited token, so the client talks to the storage directly Source 8সোর্স 8.
- Fast delivery. The storage can serve static files directly to the client Source 9সোর্স 9. A CDN can keep copies of them in many datacenters Source 9সোর্স 9.
Open the image in full sizeছবিটি পূর্ণ আকারে খুলুনসহজ English
On one server, the app saves a file to its own disk. With many app servers, a file on Server 1 is not on Server 2. So the local disk is not a good place for files.
Object storage is a shared store for files. Amazon S3, Google Cloud Storage, and Azure Blob Storage are examples Source 1সোর্স 1 Source 2সোর্স 2 Source 3সোর্স 3. In S3, an object is a file plus its metadata. A bucket is a container for objects. A key is the unique name of an object in its bucket Source 1সোর্স 1.
This tutorial advises one design: keep the file in object storage. Keep only its key or URL and its metadata in the database.
- S3 buckets and objects are private until you give access Source 1সোর্স 1. A user can change the policies and make files public Source 5সোর্স 5.
- A presigned URL gives access to one object until its expiry time Source 6সোর্স 6.
- With the Valet Key pattern, the client gets a limited token and talks to the storage directly Source 8সোর্স 8.
- The storage can serve static files directly to the client Source 9সোর্স 9.
বাংলা ব্যাখ্যা
শুধু একটি server থাকলে file upload সহজ: app file-টি নিজের disk-এ save করে। কিন্তু একাধিক app server থাকলে প্রতিটি server-এর নিজের disk থাকে। Server 1-এ থাকা file Server 2-এ থাকে না। তাই file রাখার জন্য local disk ভালো জায়গা নয়।
Object storage হলো file রাখার একটি shared store। Amazon S3, Google Cloud Storage এবং Azure Blob Storage এর উদাহরণ Source 1সোর্স 1 Source 2সোর্স 2 Source 3সোর্স 3। S3-এ একটি object হলো একটি file এবং সেটির বর্ণনা দেওয়া metadata। Bucket হলো object রাখার একটি container। প্রতিটি object-এর একটি key থাকে, যা bucket-এর মধ্যে তার unique নাম Source 1সোর্স 1। Azure Blob Storage বিপুল পরিমাণ unstructured data, যেমন text বা binary data, রাখার জন্য তৈরি Source 3সোর্স 3। AWS পরামর্শ দেয়, image ও document-এর মতো বড় file S3-এ রাখুন; app দরকার হলে file-টি নিয়ে আসে Source 4সোর্স 4।
এই tutorial একটি design-এর পরামর্শ দেয়: file-এর bytes object storage-এ রাখুন, আর database-এ রাখুন শুধু file-এর key বা URL এবং metadata (যেমন owner, size, type, upload-এর তারিখ)।
Object storage security ও speed-এও সাহায্য করে:
- S3 bucket ও object access না দেওয়া পর্যন্ত private থাকে Source 1সোর্স 1। নতুন bucket default হিসেবে public access দেয় না, তবে একজন user policy বদলে file public করতে পারেন Source 5সোর্স 5।
- একটি presigned URL একটি object-এ সীমিত সময়ের access দেয়, link-টি তার expiry time পর্যন্ত কাজ করে Source 6সোর্স 6।
- Valet Key pattern client-কে একটি সীমিত token দেয়, যাতে client সরাসরি storage-এর সাথে কথা বলে এবং app server-এর compute, memory ও bandwidth বাঁচে Source 8সোর্স 8।
- Storage সরাসরি client-কে static file দিতে পারে, আর একটি CDN অনেক datacenter-এ সেগুলোর copy রাখতে পারে Source 9সোর্স 9।
When you need it
- You run more than one app server.
- The system stores images, videos, PDFs, assignment files, certificates, or reports.
- The files are large.
- You need backup, durability, and access control for the files.
- You want to serve static files through a CDN.
সহজ English
You need object storage in these cases:
- You run more than one app server.
- The system keeps images, videos, PDFs, assignment files, certificates, or reports.
- The files are large.
- You need backup, durability, and access control for the files.
- You want to serve static files through a CDN.
বাংলা ব্যাখ্যা
নিচের যেকোনো একটি অবস্থা আপনার system-এর সাথে মিললে, আপনার object storage দরকার:
- আপনি একাধিক app server চালান।
- System-টি image, video, PDF, assignment file, certificate বা report রাখে।
- File-গুলো বড়।
- File-গুলোর জন্য আপনার backup, durability এবং access control দরকার।
- আপনি CDN দিয়ে static file serve করতে চান।
A real-life example
A student uploads a profile image to the LMS. The request goes to App Server 1. The next request, which shows the profile page, goes to App Server 2.
If App Server 1 saved the image on its local disk, App Server 2 cannot find it. The student sees a broken image. Now the team uses object storage. App Server 1 puts the image in a bucket and saves the image key in the database. App Server 2 reads the key from the database and loads the same image from the bucket.
সহজ English
A student uploads a profile image to the LMS. App Server 1 gets this request. The next request shows the profile page, and App Server 2 gets it.
If App Server 1 saved the image on its local disk, App Server 2 cannot find it. The student sees a broken image.
Now the team uses object storage. App Server 1 puts the image in a bucket and saves the image key in the database. App Server 2 reads the key from the database. Then it loads the same image from the bucket.
বাংলা ব্যাখ্যা
একজন student LMS-এ একটি profile image upload করেন। Request-টি যায় App Server 1-এ। পরের request, যা profile page দেখায়, যায় App Server 2-এ।
App Server 1 যদি image-টি নিজের local disk-এ save করে থাকে, তাহলে App Server 2 সেটি খুঁজে পায় না। Student একটি ভাঙা image দেখেন।
এখন team object storage ব্যবহার করে। App Server 1 image-টি একটি bucket-এ রাখে এবং image-এর key database-এ save করে। App Server 2 database থেকে key-টি পড়ে এবং bucket থেকে একই image load করে।
Common mistakes
- Large files in the database. Large images or videos in database rows make the database big, slow, and costly to back up.
- No split between public and private files. A course banner can be public. An exam answer sheet or a certificate must stay private.
- Metadata out of sync. The app deletes or replaces a file but does not update the database row, or the reverse. Then users see broken links, or old files stay forever.
- Permissions that are too public. S3 is private by default, but a user can change the policies to allow public access Source 5সোর্স 5. One wrong policy can expose every file.
- Large uploads time out. AWS calls multipart upload a best practice for objects of 100 MB or larger Source 7সোর্স 7. If one part fails, you send only that part again Source 7সোর্স 7.
- No way to undo a delete. S3 Versioning keeps old versions, so you can restore a file that someone deleted or overwrote by accident Source 1সোর্স 1.
সহজ English
- Large files in the database. Large images or videos in database rows make the database big and slow. They also make backups costly.
- No split between public and private files. A course banner can be public. An exam answer sheet or a certificate must stay private.
- Metadata out of sync. The app deletes or replaces a file but does not update the database row, or the reverse. Then users see broken links, or old files stay forever.
- Permissions that are too public. S3 is private by default. But a user can change the policies to allow public access Source 5সোর্স 5. One wrong policy can expose every file.
- Large uploads time out. AWS calls multipart upload a best practice for objects of 100 MB or larger. If one part fails, you send only that part again Source 7সোর্স 7.
- No way to undo a delete. S3 Versioning keeps old versions. So you can restore a file that someone deleted or overwrote by accident Source 1সোর্স 1.
বাংলা ব্যাখ্যা
- Database-এ বড় file। Database row-তে বড় image বা video রাখলে database বড়, ধীর এবং backup নিতে ব্যয়বহুল হয়ে যায়।
- Public ও private file আলাদা না করা। একটি course banner public হতে পারে। কিন্তু একটি exam answer sheet বা certificate অবশ্যই private থাকতে হবে।
- Metadata sync-এ না থাকা। App একটি file delete বা replace করে, কিন্তু database row update করে না, অথবা উল্টোটা ঘটে। তখন user-রা ভাঙা link দেখেন, অথবা পুরোনো file চিরকাল থেকে যায়।
- অতিরিক্ত public permission। S3 default হিসেবে private, কিন্তু একজন user policy বদলে public access দিতে পারেন Source 5সোর্স 5। একটি ভুল policy সব file উন্মুক্ত করে দিতে পারে।
- বড় upload-এ timeout। AWS 100 MB বা তার বেশি আকারের object-এর জন্য multipart upload-কে best practice বলে। একটি part fail করলে শুধু সেই part-টি আবার পাঠাতে হয় Source 7সোর্স 7।
- Delete ফেরানোর উপায় না থাকা। S3 Versioning পুরোনো version রেখে দেয়। তাই কেউ ভুল করে কোনো file delete বা overwrite করলে আপনি সেটি restore করতে পারেন Source 1সোর্স 1।
What a tester can check
Tutorial advice
These test ideas are the tutorial's own advice.
- Cross-server read. Upload a file, then load it many times so that different servers answer. Every request must show the file.
- Private means private. Open the direct URL of a private file without logging in, and as a different user. Both must be denied.
- Expired link. Get a presigned URL, wait until it expires, and open it again. It must fail.
- Delete is complete. Delete a file in the app. Check that the database row and the stored object are both gone.
- Big and slow uploads. Upload a file at the size limit on a slow network. Check the timeout, the progress bar, and the error message.
- Bad files. Upload a wrong file type, a file over the limit, and a file name with spaces or non-English letters.
সহজ English
These test ideas are the tutorial's own advice.
- Cross-server read. Upload a file. Then load it many times, so that different servers answer. Every request must show the file.
- Private means private. Open the direct URL of a private file without a login. Then open it as a different user. Both must be denied.
- Expired link. Get a presigned URL. Wait until it expires, and open it again. It must fail.
- Delete is complete. Delete a file in the app. Make sure that the database row and the stored object are both gone.
- Big and slow uploads. Upload a file at the size limit on a slow network. Check the timeout, the progress bar, and the error message.
- Bad files. Upload a wrong file type, a file over the limit, and a file name with spaces or non-English letters.
বাংলা ব্যাখ্যা
নিচের test ধারণাগুলো এই tutorial-এর নিজস্ব পরামর্শ।
- Cross-server read। একটি file upload করুন, তারপর সেটি অনেকবার load করুন, যাতে ভিন্ন ভিন্ন server উত্তর দেয়। প্রতিটি request-এ file-টি দেখাতে হবে।
- Private মানে private। Login না করে একটি private file-এর direct URL খুলুন, তারপর অন্য একজন user হিসেবে খুলুন। দুই ক্ষেত্রেই access deny হতে হবে।
- Expired link। একটি presigned URL নিন, সেটির মেয়াদ শেষ হওয়া পর্যন্ত অপেক্ষা করুন, তারপর আবার খুলুন। এটি fail করতে হবে।
- সম্পূর্ণ delete। App-এ একটি file delete করুন। দেখুন, database row এবং stored object দুটোই মুছে গেছে কি না।
- বড় ও ধীর upload। ধীর network-এ size limit-এর সমান একটি file upload করুন। Timeout, progress bar এবং error message পরীক্ষা করুন।
- খারাপ file। ভুল file type, limit-এর চেয়ে বড় একটি file, এবং space বা non-English অক্ষর থাকা file name দিয়ে upload করুন।
Key words
| Word | Meaning |
|---|---|
| Object storage | A shared store that keeps files as objects |
| Object | A file plus the metadata that describes it |
| Bucket | A container for objects |
| Key | The unique name of an object in its bucket |
| Metadata | Data about a file, such as its owner, size, and type |
| Presigned URL | A link that gives access to one object for a limited time |
| Multipart upload | Sending a large file in parts, so that a failed part can be sent again |
| Versioning | Keeping old versions of an object, so that you can restore it |