Flexible and scalable data storage is a baseline requirement for most applications and services being developed with modern techniques and tools. Whether storing large or small amounts of images, videos, or blobs of text, application developers need a solution for the storage and retrieval of user-generated content, logs, backups, and so on.
With today’s complex deployments, containers, and ephemeral infrastructure, the days of simply saving files to disk on a single server are gone. Cloud providers have developed services to fill the storage needs of modern application deployments, and they mostly fit into two categories: object storage, and block storage.
Let’s take a look at both, and discuss the general advantages, disadvantages, and use cases for each.
Block storage services are relatively simple and familiar. They provide a traditional block storage device — like a hard drive — over the network. Cloud providers often have products that can provision a block storage device of any size and attach it to your virtual machine.
From there, you would treat it like a normal disk. You could format it with a filesystem and store files on it, combine multiple devices into a RAID array, or configure a database to write directly to the block device, avoiding filesystem overhead entirely. Additionally, network-attached block storage devices often have some unique advantages over normal hard drives:
This is a very flexible setup that can be useful for most any kind of application. Let’s summarize some advantages and disadvantages of the technology.
Some advantages of block storage are:
The disadvantages of block storage are:
Because of its fast IO characteristics, block storage services are well suited for storing data in traditional databases. Additionally, many legacy applications that require normal filesystem storage will need to use a block storage device.
If your cloud provider doesn’t offer a block storage service you can run your own using OpenStack Cinder, Ceph, or the built-in iSCSI service available on many NAS devices.
In the modern world of cloud computing, object storage is the storage and retrieval of unstructured blobs of data and metadata using an HTTP API. Instead of breaking files down into blocks to store it on disk using a filesystem, we deal with whole objects stored over the network. These objects could be an image file, logs, HTML files, or any self-contained blob of bytes. They are unstructured because there is no specific schema or format they need to follow.
Object storage took off because it greatly simplified the developer experience. Because the API consists of standard HTTP requests, libraries were quickly developed for most programming languages. Saving a blob of data became as easy as an HTTP PUT request to the object store. Retrieving the file and metadata is a normal GET request. Further, most object storage services can also serve the files publicly to your users, removing the need to maintain a web server to host static assets.
On top of that, object storage services charge only for the storage space you use (some also charge per HTTP request, and for transfer bandwidth). This is a boon for small developers, who can get world-class storage and hosting of assets at costs that scale with use.
Object storage isn’t the right solution for every situation though. Let’s look at a summary of benefits and disadvantages.
Some advantages of object storage are:
Some disadvantages of object storage are:
Because of these properties, object storage is useful for hosting static assets, saving user-generated content such as images and movies, storing backup files, and storing logs, for example.
There are some self-hosted object storage solutions, though you will give up some of the benefits of a hosted solution (such as not having to worry about hard drives and scaling issues). You could try Minio, a popular object storage server written in the Go language, or Ceph, or OpenStack Swift.
Choosing a storage solution can be a complex decision for developers. In this article we discussed the advantages and disadvantages of both block and object storage services. It’s likely that any sufficiently complex application will need both types of storage to cover all its needs.
Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Excellent article! Specially the advantage/disadvantage part of both storage types added some points to my knowledge. I wonder how DigitalOcean is able to keep such valuable content free from marketing their own services. Thumbs up!
The following current limitations make it difficult to integrate spaces into anything I’m currently working on:
Is there an maximum of storage of files stored?
What if I want to extend my Plesk droplet storage? I have a bunch of email accounts hosted in Plesk that need more GB than my overall droplet storage actually is… Should I get a Volume or a Space to accomplish this task?
Hi Brain,
Really nice and simple explanation, Thank you for the article!
But here this disadvantage is not correct, object storage do have option to update a file with offset value, you can append content at any position in a file.
Some disadvantages of object storage are:
Object storage doesn’t allow you to alter just a piece of a data blob, you must read and write an entire object at once. This has some performance implications. For instance, on a filesystem, you can easily append a single line to the end of a log file. On an object storage system, you’d need to retrieve the object, add the new line, and write the entire object back. This makes object storage less ideal for data that changes very frequently
Thanks, Shruthi
Really helpful article. thank you for sharing.
This comment has been deleted
Excellent article! Thank you for all clarifications, you didna great job explaining advantages and disadvantages. Keep it up 👍👍
We recently ran into an issue where a script deleted a bunch of files in object storage. There is, of course, no inherent backup if an object is deleted. I wonder if your object storage has any data retention to restore the objects as they were 24 hours ago?
DO seems late to the party here but Ive always liked their UI. What I dont like is that they never give us pricing details up front. We try it, find their bugs for them, like the product then are slammed with the pricing afterwards. I hate this sort of business practice especially since nothing will convince me its not purposeful. iow: I know they’ve already figured out pricing so just tell it to us!
Having said all of that: having to use their domain means this product has no value what-so-ever to me or probably any real business.
Still love the company, but becoming unimpressed lately.