【转载】sharding和partition区别

Partitioning is a general term used to describe the act of breaking up your logical data elements into multiple entities for the purpose of performance, availability, or maintainability.

Sharding is the equivalent of "horizontal partitioning".  When you shard a database, you create replica‘s of the schema, and then divide what data is stored in each shard based on a shard key.  For example, I might shard my customer database using CustomerId as a shard key - I‘d store ranges 0-10000 in one shard and 10001-20000 in a different shard.  When choosing a shard key, the DBA will typically look at data-access patterns and space issues to ensure that they are distributing load and space across shards evenly.

"Vertical partitioning" is the act of splitting up the data stored in one entity into multiple entities - again for space and performance reasons.  For example, a customer might only have one billing address, yet I might choose to put the billing address information into a separate table with a CustomerId reference so that I have the flexibility to move that information into a separate database, or different security context, etc.

To summarize - partitioning is a generic term that just means dividing your logical entities into different physical entities for performance, availability, or some other purpose.  "Horizontal partitioning", or sharding, is replicating the schema, and then dividing the data based on a shard key.  "Vertical partitioning" involves dividing up the schema (and the data goes along for the ride).

Final note:  you can combine both horizontal and vertical partitioning techniques - sometimes required in big data, high traffic environments.

I take sharding to mean the partitioning of a table over multiple machines (over multiple database instances in a distributed database system), whereas partitioning may just refer to the splitting up of a table on the same machine.

So a table that is sharded has been partitioned, but a table that has been partitioned has not necessarily been sharded.

Zz from: https://www.quora.com/Whats-the-difference-between-sharding-DB-tables-and-partitioning-them

原文地址:http://www.cnblogs.com/tcsbupt/p/7078267.html

时间: 06-24

【转载】sharding和partition区别的相关文章

转载: scala中span和partition区别

scala中的partition span splitAt groupBy 可把Collection分成:满足条件的一组,其他的另一组. partitionspan List(1,9,2,4,5).span(_<3)       // (List(1),List(9, 2, 4, 5)),碰到不符合就结束 List(1,9,2,4,5).partition(_<3) // (List(1, 2),List(9, 4, 5)),扫描所有 splitAt // (List(1, 3),List(5

转载 j2ee j2se j2me 区别,mvc 和ssh联系理解

[转]J2SE J2EE J2ME的区别 以及 MVC与SSH对应关系 2014-3-6阅读322 评论0 J2SE J2EE J2ME的区别多数编程语言都有预选编译好的类库以支持各种特定的功能,在Java中,类库以包(package)的形式提供,不同版本的Java提供不同的包,以面向特定的应用. Java2平台包括标准版(J2SE).企业版(J2EE)和微缩版(J2ME)三个版本:Standard Edition(标准版) J2SE 包含那些构成Java语言核心的类.比如:数据库连接.接口定义

C++对C的改进(2)

本文地址:http://www.cnblogs.com/archimedes/p/cpp-change2.html,转载请注明源地址 区别一:原型声明的区别 原型声明的概念: 函数要先定义再使用,如果先使用后定义则必须使用原型声明 #include <iostream> using namespace std; int main() { float add(float x,float y);//原型声明 float a,b,c; cout << "Please enter

LIB和DLL的区别与使用(转载)

转载自:http://www.cppblog.com/amazon/archive/2009/09/04/95318.html 共有两种库:一种是LIB包含了函数所在的DLL文件和文件中函数位置的信息(入口),代码由运行时加载在进程空间中的DLL提供,称为动态链接库dynamic link library.一种是LIB包含函数代码本身,在编译时直接将代码加入程序当中,称为静态链接库static link library.共有两种链接方式:动态链接使用动态链接库,允许可执行模块(.dll文件或.e

Mysql与Oracle区别(转载)

Mysql与Oracle区别 文章分类:数据库 转载于http://blog.sina.com.cn/s/blog_5d9ca4ea0100kmhy.html 周五去一家公司去面试,那公司经理问了关于Mysql与Oracle的区别问题,以前没有总结,回答也不是很好,只是凭感觉,先总结如下: 1. Oracle是大型数据库而Mysql是中小型数据库,Oracle市场占有率达40%,Mysql只有20%左右,同时Mysql是开源的而Oracle价格非常高. 2. Oracle支持大并发,大访问量,是

三种实现servlet的方式有什么区别?--转载

著作权归作者所有.商业转载请联系作者获得授权,非商业转载请注明出处.作者:郭无心链接:https://www.zhihu.com/question/38971252/answer/79165562来源:知乎 首先明确,Servlet并不是专门用于处理Http请求的.然后再说三种方式的联系和区别.1)原生Servlet接口 package javax.servlet; import java.io.IOException; public interface Servlet { public voi

Struct和Class的区别(转载)

尊重原创,转载来源:http://blog.sina.com.cn/s/blog_48f587a80100k630.html C++中的struct对C中的struct进行了扩充,它已经不再只是一个包含不同数据类型的数据结构了,它已经获取了太多的功能.struct能包含成员函数吗? 能!struct能继承吗? 能!!struct能实现多态吗? 能!!! 既然这些它都能实现,那它和class还能有什么区别? 最本质的一个区别就是默认的访问控制: struct是public的,class是priva

【转载】LINUX 和 WINDOWS 内核的区别

LINUX 和 WINDOWS 内核的区别 [声明:欢迎转载,转载请注明出自CU ACCESSORY http://linux.chinaunix.net/bbs/thread-1153868-1-1.html] 关于LINUX和WINDOWS的口水站已经很多了.本文企图从技术角度来比较下2个主流操作系统的异同.偏重于内核部分. 一.动机: 我最早是 WINDOWS 阵营的.在WINDOWS下写过2年多的驱动程序.后来由于学习需要,转投LINUX,一晃也快2年了.期间经历了很多曲折,也学到了很多

转载关于KeyPress和KeyDown事件的区别和联系

KeyDown:在控件有焦点的情况下按下键时发生. KeyPress:在控件有焦点的情况下按下键时发生. KeyUp:在控件有焦点的情况下释放键时发生. 1.KeyPress主要用来接收字母.数字等ANSI字符   KeyDown 和 KeyUP 事件过程通常可以捕获键盘除了PrScrn(在键盘右上角)所有按键(这里不讨论特殊键盘的特殊键) 2.KeyPress 只能捕获单个字符   KeyDown 和KeyUp 可以捕获组合键. 3.KeyPress 不显示键盘的物理状态(SHIFT键),而只