Cloud storage
لم يُترجم بعد؛ يُعرض باللغة الإنجليزية
عن هذا الدرس
Cloud storage is disk space you rent and reach over a network. Meet its three kinds: a block volume that acts like a drive plugged into one server, a file share that many servers open at once, and an object bucket that holds whole files found by key. Then follow one photo as five lines of Python upload it to a bucket, the provider copies it into three zones, one zone goes dark, and a second server downloads it.
Disk space you rent
Cloud storage is disk space you rent from a provider and reach over a network. You pay for what you use or reserve, usually per gigabyte per month. It comes in three main kinds: block, file and object storage.
cloud storage = rented disk space, over a network pay for what you use or reserve (per GB per month) block a drive for one server file a folder many servers share object a bucket of files found by key
اقرأ الدرس خطوة بخطوة
Disk space you rent
Cloud storage is disk space you rent from a provider and reach over a network. You pay for what you use or reserve, usually per gigabyte per month. It comes in three main kinds: block, file and object storage.
cloud storage = rented disk space, over a network pay for what you use or reserve (per GB per month) block a drive for one server file a folder many servers share object a bucket of files found by keyBlock: a drive for one server
A block volume acts like a hard drive plugged into one server. The operating system formats it and saves files on it in fixed-size pieces called blocks. It is fast, so databases use it. AWS calls it EBS (Elastic Block Store).
Server 1 ── Block volume the OS sees a blank drive: /dev/xvdf format it, mount it, save files one server at a time, in one zone AWS EBS · Google Persistent Disk · Azure Disk StorageFile: one folder, many servers
A file share is a folder that many servers open at the same time, over a network protocol such as NFS. One server saves a file and another can read it. AWS calls this EFS; Google calls it Filestore.
Server 1 ─┐ ├── File share /shared/menu.txt Server 2 ─┘ NFS: Network File System AWS EFS · Google Filestore · Azure FilesObject: a bucket of keyed things
Object storage keeps whole files, called objects, in a bucket. Each object has a key (its name), the data and metadata (facts about it, like its size). The key menu/latte.jpg looks like a folder path, but the bucket is flat.
bucket "cafe" key menu/latte.jpg data the bytes of the photo metadata size, Last-Modified date "/" is just a character in the key: no real folders, one flat list of keysUpload: PUT by key
Server 1 runs line 4. The boto3 library sends the photo to the bucket over HTTPS as a PUT request, with its key. There is no drive to plug in and no folder to mount: any program with permission can do this.
s3.upload_file("latte.jpg", "cafe", key) PUT /menu/latte.jpg (to the bucket "cafe") <the bytes of latte.jpg> → 200 OKCopies in three zones
By default, S3 copies each object into at least three Availability Zones: separate groups of data centres in one region, each with its own power and network. AWS designs S3 for 99.999999999% (eleven nines) yearly durability.
one PUT → copies in three zones Zone A ✓ Zone B ✓ Zone C ✓ designed durability: 99.999999999% per yearA zone goes dark
Say Zone A loses power. The copies in Zones B and C still answer, so the photo is neither lost nor out of reach. S3 Standard is designed to keep data safe even if a whole zone is lost.
Zone A ✗ no power Zone B ✓ answers Zone C ✓ answers the photo is still safe and readable (S3 One Zone-IA keeps one zone only)Download: GET by key
Line 5 asks for the same bucket and key with a GET request, and the photo comes back as copy.jpg. Server 2 fetches it here: nothing was shared or plugged in, only a name and permission.
s3.download_file("cafe", key, "copy.jpg") GET /menu/latte.jpg (from the bucket "cafe") → 200 OK <the bytes> → copy.jpg on Server 2Which kind, when
Use block storage for one server's boot disk or database, file storage for a folder many servers share, and object storage for photos, videos, backups and logs reached by key. Most real apps use more than one.
block one server's boot disk or database file a folder many servers share object photos, videos, backups and logs most apps mix them: a database on block, uploads in a bucket
أسئلة سريعة: 5
اختر إجابة واحدة لكل سؤال. يمكنك تغيير اختياراتك قبل التحقق منها.
01Which kind of cloud storage acts like a hard drive plugged into one server?
A block volume (such as AWS EBS) attaches to a server like a drive. The operating system formats it and saves files on it in fixed-size blocks.
02Two web servers need to read and write the same folder at the same time. What fits best?
A file share (such as AWS EFS or Google Filestore) is one folder that many servers open at once over a network protocol like NFS.
03In an object bucket, what is menu/latte.jpg?
Buckets are flat. An object is found by its key; the / only makes keys look like folders when the console groups them by prefix.
04What does s3.upload_file("latte.jpg", "cafe", key) do?
boto3's upload_file(Filename, Bucket, Key) sends the file to S3 with an HTTPS PUT (a multipart upload for big files). download_file(Bucket, Key, Filename) gets it back with a GET.
05Why does S3 Standard keep copies in at least three Availability Zones?
Each zone is a separate group of data centres with its own power and network. If one fails, the copies in the others still answer.
المسرد
- Cloud storage
- Disk space you rent from a cloud provider and reach over a network, paying for what you use or reserve.
- Block storage
- A volume that acts like a drive attached to one server; the operating system formats it and stores data in fixed-size blocks. AWS EBS, Google Persistent Disk.
- File storage
- A shared folder that many servers mount at once over a network protocol such as NFS. AWS EFS, Google Filestore, Azure Files.
- Object storage
- Storage that keeps whole files (objects) in a flat bucket, each found by its key and read or written over HTTPS. AWS S3, Google Cloud Storage, Azure Blob Storage.
- Bucket
- A container for objects in object storage. In S3 every bucket name is unique across all AWS accounts within a partition (such as the standard AWS Regions).
- Key
- The unique name of an object inside a bucket, such as menu/latte.jpg.
- Metadata
- Facts stored with an object, such as its size, when it was last changed, and its content type (like image/jpeg) if the uploader sets one.
- Availability Zone
- One or more separate data centres in a cloud region, with their own power, cooling and network.
الملاحظات والمصادر
- Providers name the three kinds differently: AWS EBS, EFS and S3; Google Cloud Persistent Disk (or Hyperdisk), Filestore and Cloud Storage; Azure Disk Storage, Azure Files and Blob Storage. The ideas are the same.
- An EBS volume must be in the same Availability Zone as its server, and most attach to one server at a time; io1 and io2 volumes can use Multi-Attach to join several. The device name /dev/xvdf is only an example.
- S3 has a flat structure. The / in menu/latte.jpg is just part of the key; the console groups keys that share a prefix so they look like folders.
- Eleven nines is a design target for a year, not a promise that nothing can go wrong. S3 One Zone-IA keeps data in a single zone, so losing that zone can lose the data.
- upload_file sends a small file with one PutObject request and switches to a multipart upload for big ones (above 8 MB by default). download_file uses GetObject.
- The card sends no Content-Type, so the metadata shown is what S3 records by itself, such as the size and Last-Modified date. To store a type, call upload_file with ExtraArgs={"ContentType": "image/jpeg"}.
- The code card is real Python with the boto3 library. It needs an AWS account, credentials and a bucket you own; bucket names are shared by everyone, so pick your own instead of cafe. The lesson test runs it against a stubbed S3 client.
- NIST SP 800-145: The NIST Definition of Cloud Computing
- Amazon EBS User Guide: Amazon EBS volumes
- Amazon EBS User Guide: Multi-Attach
- Amazon EFS User Guide: What is Amazon EFS?
- Amazon S3 User Guide: Amazon S3 objects overview
- Amazon S3 User Guide: Organizing objects using prefixes
- Amazon S3 User Guide: Understanding and managing storage classes
- Amazon S3 User Guide: Data protection (durability)
- Amazon EC2 User Guide: Regions and Availability Zones
- Boto3 docs: Uploading files
- Boto3 docs: Downloading files
- Google Cloud: Storage products
- Kubernetes docs: Persistent Volumes
اختبار يتاح بعد الخطوة الأخيرة.