objectStorage

[TOC]

block storage

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.

另外, network-attached block storage devices (NAS设备,如Synology DSM, QNAP QTS) often have some unique advantages over normal hard drives:

  • You can easily take live snapshots of the entire device for backup purposes
  • Block storage devices can be resized to accommodate growing needs
  • You can easily detach and move block storage devices between machines

Some advantages of block storage are:

  • Block storage is a familiar paradigm. People and software understand and support files and filesystems almost universally
  • Block devices are well supported. Every programming language can easily read and write files
  • Filesystem permissions and access controls are familiar and well-understood
  • Block storage devices provide low latency IO, so they are suitable for use by databases.

The disadvantages of block storage are:

  • Storage is tied to one server at a time
  • Blocks and filesystems have limited metadata about the blobs of information they’re storing (creation date, owner, size). Any additional information about what you’re storing will have to be handled at the application and database level, which is additional complexity for a developer to worry about
  • You need to pay for all the block storage space you’ve allocated, even if you’re not using it
  • You can only access block storage through a running server
  • Block storage needs more hands-on work and setup vs object storage (filesystem choices, permissions, versioning, backups, etc.)

由于快速的IO 特性,块存储尤其使用于传统数据库。

using OpenStack Cinder, Ceph, or the built-in iSCSI service available on many NAS devices.

object storage

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 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

Some advantages of object storage are:

  • A simple HTTP API, with clients available for all major operating systems and programming languages
  • A cost structure that means you only pay for what you use
  • Built-in public serving of static assets means one less server for you to run yourself
  • Some object stores offer built-in CDN integration, which cache your assets around the globe to make downloads and page loads faster for your users
  • Optional versioning means you can retrieve old versions of objects to recover from accidental overwrites of data
  • Object storage services can easily scale from modest needs to really intense use-cases without the developer having to launch more resources or rearchitect to handle the load
  • Using an object storage service means you don’t have to maintain hard drives and RAID arrays, as that’s handled by the service provider
  • Being able to store chunks of metadata alongside your data blob can further simplify your application architecture

Some disadvantages of object storage are:

  • You can’t use object storage services to back a traditional database, due to the high latency of such services
  • 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
  • Operating systems can’t easily mount an object store like a normal disk. There are some clients and adapters to help with this, but in general, using and browsing an object store is not as simple as flipping through directories in a file browser

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.

Minio, a popular object storage server written in the Go language

or Ceph, or OpenStack Swift.