Let's understand the difference between block and object storage with the help of an example. Suppose we have an excel file of 100MB in size.
How the 100MB file will be stored in Block Storage?
In the case of block storage, the 100MB file is divided into 10 blocks, each of 10MB and stored in the memory. Here ,by memory, I mean hard disk. Each block of data is given a unique identifier, which allows a storage system to place the smaller pieces of data wherever is most convenient.
Each block storage can be treated as an individual hard disk, and hence can access the data via an operating system. This operating system can be present locally or network-attached in case of cloud storage.
So, if I want to make changes in the few cells of the 100MB excel sheet, then in the memory only those blocks in which we have made changes are updated. Updates are not performed on all the 10 blocks.
- Read/Write operation is faster
- As storage needs grow, organizations can add block storage volumes without sacrificing performance but can hamper durability.
- Follows file structure hence is human friendly
- Block storage uses very limited metadata. This can affect application performance in metadata critical operations, such as search and retrieval, because the application cannot identify the storage location by meaningful metadata, and may have to scan a large number of blocks to find the required data.
- Greater the distance between storage and application, the higher is the latency.
- Block storage is expensive. Because it requires expensive hardware and highly trained maintenance personnel.
- Block storage is useful for highly structured data.
- useful for database and transactional data.
- AWS Elastic block storage (EBS), provides raw storage just like hard disk, which you can attach with your EC2 instance.
How the 100GB file will be stored in Object Storage?
In object storage, the data is broken into discrete units called objects and is kept in a single repository, instead of being kept as files in folders or as blocks on servers.
In the case of object storage, the 100MB file is not divided into chunks. Instead, entire clumps of data are stored in, as a single object. Each object consists of three things. The data (100MB file), expandable amount of metadata and a globally unique identifier.
Each object has a globally unique identifier and requires a simple HTTP application programming interface (API), which is used by most clients in all languages.
So, if I want to make changes in the few cells of the 100MB excel sheet, then in object storage, the entire file is updated.This makes the update operation very heavy.
- object-based storage, is a flat structure in which files are broken into pieces and spread out among hardware. In object storage, the data is broken into discrete units called objects and is kept in a single repository, instead of being kept as files in folders or as blocks on servers.
- Read operations are much faster
- Object-based storage architectures can be scaled up and managed simply by adding additional nodes
1.You can not use object storage to store transactional and database data.
2.It does not allow you to alter a piece of data, you must read and write the entire object.
- Used for storing unstructured data eg: image,videos
- AWS Simple Storage Service (S3), is used extensively for storing files, whose frequent operation is read.