西维蜀黍

【Engineering】Semantic Versioning

Summary

Given a version number MAJOR.MINOR.PATCH, increment the:

  1. MAJOR version when you make incompatible API changes
  2. MINOR version when you add functionality in a backwards compatible manner
  3. PATCH version when you make backwards compatible bug fixes

Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.

  ...


【Database】索引 - 哈希索引 VS B+ Tree 索引

哈希索引 VS B+树索引

可能很多人又有疑问了,既然 Hash 索引的效率要比B+树高很多,为什么大家不都用 Hash 索引而还要使用B+树索引呢?

  ...


【Database】存储引擎(Storage Engine)

  ...


【Database】索引 - Build an LSM-tree Database

  ...


【Database】索引 - LSM Trees VS B+ Trees

The B-tree and the Log-Structured Merge-tree (LSM-tree) are the two most widely used data structures for data-intensive applications to organize and store data. However, each of them has its own advantages and disadvantages.

LSM Tree is not a single data structure as a whole but combines multiple data structures that exploit the response times of different storage devices in the storage hierarchy. Being append only, it provides high rates of writes while still providing low cost reads via indexes maintained in RAM. In contrast to B+ tree based storage engine which performs in-place updates, there are no in-place updates in a LSM Tree and this helps in avoiding random I/Os.

  ...


【MySQL】计算磁盘空间使用

统计每个DB的磁盘空间使用

mysql>  select table_schema "DB name (table_schema)",
    -> sum((data_length+index_length)/1024/1024/1024) AS "DB size in GB" from
    -> information_schema.tables group by table_schema;
+-----------------------------+-------------------+
| DB name (table_schema)      | DB size in GB     |
+-----------------------------+-------------------+
| information_schema          |    0.000167846679 |
| xxyyzz_coins_v3_db_00000004 |  210.166442871299 |
| xxyyzz_coins_v3_db_00000004 | 1387.163970947461 |
+-----------------------------+-------------------+
3 rows in set (0.85 sec)
  ...


【SQL】索引 - 增删查改

索引(Index)

索引(Index)是一种特殊的查找表,作用是给数据库搜索引擎用来加快数据检索。

简单地说,索引是一个指向表中数据的指针。一个数据库中的索引与一本书后边的索引是非常相似的。例如,如果你想在一本讨论某个话题的书中引用所有页面,则首先需要指向索引,索引按字母顺序列出了所有主题,然后指向一个或多个特定的页码。

索引有助于加快 SELECT 查询,但它会减慢使用 UPDATE 和 INSERT 语句时的数据输入。

索引可以创建或删除,但不会影响数据。使用CREATE INDEX语句创建索引,它允许命名索引,指定表及要索引的一列或多列,并指示索引是升序排列还是降序排列。索引也可以是唯一的,与 UNIQUE 约束类似,在列上或列组合上防止重复条目。

  ...


【Database】索引 - 数据结构

索引的实现

The B-tree and the Log-Structured Merge-tree (LSM-tree) are the two most widely used data structures for data-intensive applications to organize and store data. However, each of them has its own advantages and disadvantages. This article aims to use quantitative approaches to compare these two data structures.

  ...


【Data Structure】稀疏索引(Sparse Indexes)

稀疏索引(Sparse Indexes)

One quality that database indexes can have is that they can be dense or sparse. Each of these index qualities come with their own trade-offs. Let’s look at how each index type would work using the following user data.

  ...


【Data Structure】跳跃表(Skiplist)

跳跃表(跳表,Skiplist)

引言

Redis因为其完全基于内存、性能出色,加上具备丰富的数据类型,在电商环境中深受后端开发的喜爱。其中有序集合zset就是基本数据类型之一,并且每个member都带有score(可用于排序),因此很适合在打赏日榜、近一周收益这类场景中运用。

  ...