2019-11-16 21:56:40 +02:00
---
2019-11-08 14:20:32 +08:00
layout: pattern
title: Sharding
2019-11-16 21:56:40 +02:00
folder: sharding
2019-11-08 14:20:32 +08:00
permalink: /patterns/sharding/
2019-12-13 21:09:28 +02:00
categories: Behavioral
2021-05-19 10:49:05 -06:00
language: en
2019-11-08 14:20:32 +08:00
tags:
2019-12-13 21:09:28 +02:00
- Performance
- Cloud distributed
2019-11-08 14:20:32 +08:00
---
## Intent
Sharding pattern means divide the data store into horizontal partitions or shards. Each shard has the same schema, but holds its own distinct subset of the data.
A shard is a data store in its own right (it can contain the data for many entities of different types), running on a server acting as a storage node.
2019-12-07 20:01:13 +02:00
## Class diagram

2019-11-08 14:20:32 +08:00
## Applicability
This pattern offers the following benefits:
- You can scale the system out by adding further shards running on additional storage nodes.
- A system can use off the shelf commodity hardware rather than specialized (and expensive) computers for each storage node.
- You can reduce contention and improved performance by balancing the workload across shards.
- In the cloud, shards can be located physically close to the users that will access the data.
## Credits
2020-07-26 11:30:42 +03:00
* [Sharding pattern ](https://docs.microsoft.com/en-us/azure/architecture/patterns/sharding )