Redis01 - Redis background

Redis background

1.1. The history of the development of data storage

1.1.1. Disk era

Before long, our data storage is disk storage, each disk has a track. Each track has a lot of sectors, a sector close 512Byte.

Disk addressing millisecond speed, bandwidth GB / M's. Memory is ns-level, large disk bandwidth than the Shang Hao several orders of magnitude. Overall, the disk memory is slower than on addressing nearly 10W times.

In this history, we are faced with the question, I / O problems. When reading and writing files, we often face a lot of I / O cost. But first there is the initial solution is to add a buffer.

科普:什么是buffer?
  buffer是指一个缓冲区,我们在缓冲区来进行一个暂时的存放,之后统一运输给内存,这样会使得I/O的性能有略微提升。
1.1.2 generated database

Any technology is no reason not to produce.

Our database technology is due to the I / O bottleneck disk. To solve this problem, we will be divided into a small disk sectors of 4K partition, constitute the index. With these index values, we can index, a more easy to find. For faster we can find, we will use the B + tree index is stored.

科普:B+树是什么?
  我们普通的1-0树,又称二叉查找树(二叉排序树),二叉查找树和排序树是同一种树,就是单纯的1-0树,按照中序遍历的存储方式进行从小到大(从大到小)进行存储。(初学者可能误以为两种树,包括我刚开始学习数据结构的时候)。
  二叉查找树(二叉排序树)由于在插入和删除的时候,容易出现不太ok的情况,例如,可能在删除过程中删除为一个链表,这样查找效率依旧会变得很低。所以,我们使用旋转,通过左右旋转,将这种“链表”式(极端情况下)的树转化为左右平衡的树,这就是所谓的B-树。(注意误区,B树和B-树是一个树么?初学者认为后面一种是B减树,实际不是,是翻译过来的时候加的分隔符。B为Balance平衡的意思)
  当然,我们的数据库文件不是二叉的,文件系统也不是,所以,我们多叉的查找树,就是所谓的B+树。+号代表每个节点不止二叉的意思。
  
  (用自己的话粗略总结,详细还是看B-tree,B+tree的定义)

Find in our database, we have a problem? That is byte-wide problem. We must give the building a database schema, we row-level storage, even if the column is blank, still be occupying, then, when a large amount of data, will waste a lot of storage space. But this benefit is that we do not need to position data at the time of the update.

Produce 1.1.3.key-value database

Any technology is no reason not to produce.

We will develop a database to the extreme, resulting in a similar SAP's HANA database. This database, large hardware requirements, memory about 2T, hardware, software and services a total of about 200 million packages.

With the development of the Internet, we are faced with a new problem. How can withstand high concurrency and large data resulting from slow to find it? (Note that the large amount of data, only affects multi-data search, find and order data will not affect the performance of our business logic, usually find pieces of data, so there will be a bottleneck)

So we had a database of kv, which relies on two infrastructure. Von Neumann architecture of hardware, Ethernet, and tcp / ip network. Reference accessories: Von Neumann architecture diagram

科普:什么是冯诺依曼体系?
  我们的操作系统老师是个年纪很大的教授,这边引用他的上课原话。
  冯诺依曼体系,至今没有一个明确的定义。有的书说有5个,有的书说有7个,但是,我依照某年考研题,来规范一下冯诺依曼体系。
  冯诺依曼体系由五部分组成,控制器,运算器,内存,总线,硬盘和I/O接口6部分组成。
  
  (如何记忆冯诺依曼体系构成:CPU分为控制器运算器,其他都为CPU服务,运算需要内存,连接需要总线,我们要读写必须要I/O接口。一切以CPU考虑,就能记全6个)
  
  参考附件:冯诺依曼体系图
  

Guess you like

Origin www.cnblogs.com/littlepage/p/11515541.html