![](https://csdnimg.cn/release/download_crawler_static/10945237/bg5.jpg)
3.3 Three Layers within a Storage Stamp
Also shown in Figure 1 are the three layers within a storage stamp. From bottom up these are:
Stream Layer – This layer stores the bits on disk and is in charge of distributing and replicating
the data across many servers to keep data durable within a storage stamp. The stream layer can be
thought of as a distributed file system layer within a stamp. It understands files, called “streams”
(which are ordered lists of large storage chunks called “extents”), how to store them, how to
replicate them, etc., but it does not understand higher level object constructs or their semantics. The
data is stored in the stream layer, but it is accessible from the partition layer. In fact, partition
servers (daemon processes in the partition layer) and stream servers are co-located on each storage
node in a stamp.
Partition Layer – The partition layer is built for (a) managing and understanding higher level data
abstractions (Blob, Table, Queue), (b) providing a scalable object namespace, (c) providing
transaction ordering and strong consistency for objects, (d) storing object data on top of the stream
layer, and (e) caching object data to reduce disk I/O.
Another responsibility of this layer is to achieve scalability by partitioning all of the data objects
within a stamp. As described earlier, all objects have a PartitionName; they are broken down into
disjointed ranges based on the PartitionName values and served by different partition servers. This
layer manages which partition server is serving what PartitionName ranges for Blobs, Tables, and
Queues. In addition, it provides automatic load balancing of PartitionNames across the partition
servers to meet the traffic needs of the objects.
Front-End (FE) layer – The Front-End (FE) layer consists of a set of stateless servers that take
incoming requests. Upon receiving a request, an FE looks up the AccountName, authenticates and
authorizes the request, then routes the request to a partition server in the partition layer (based on
the PartitionName). The system maintains a Partition Map that keeps track of the PartitionName
ranges and which partition server is serving which PartitionNames. The FE servers cache the
Partition Map and use it to determine which partition server to forward each request to. The FE
servers also stream large objects directly from the stream layer and cache frequently accessed data
for efficiency.
3.4 Two Replication Engines
Before describing the stream and partition layers in detail, we first give a brief overview of the two
replication engines in our system and their separate responsibilities.
Intra-Stamp Replication (stream layer) – This system provides synchronous replication and is
focused on making sure all the data written into a stamp is kept durable within that stamp. It keeps
enough replicas of the data across different nodes in different fault domains to keep data durable
within the stamp in the face of disk, node, and rack failures. Intra-stamp replication is done
completely by the stream layer and is on the critical path of the customer’s write requests. Once a
transaction has been replicated successfully with intra-stamp replication, success can be returned
back to the customer.
Inter-Stamp Replication (partition layer) – This system provides asynchronous replication and
is focused on replicating data across stamps. Inter-stamp replication is done in the background and
is off the critical path of the customer’s request. This replication is at the object level, where either
the whole object is replicated or recent delta changes are replicated for a given account. Inter-
stamp replication is used for (a) keeping a copy of an account’s data in two locations for disaster
recovery and (b) migrating an account’s data between stamps. Inter-stamp replication is configured
for an account by the location service and performed by the partition layer.
Inter-stamp replication is focused on replicating objects and the transactions applied to those
objects, whereas intra-stamp replication is focused on replicating blocks of disk storage that are
used to make up the objects.
We separated replication into intra-stamp and inter-stamp at these two different layers for the
following reasons. Intra-stamp replication provides durability against hardware failures, which
occur frequently in large scale systems, whereas inter-stamp replication provides geo-redundancy