



在本章中,我们介绍了二进制数据的组织方式:如何序列化原始数据类型、将它们组合成单元格、用单元格构建出分槽页,以及如何读写这些数据结构。
我们介绍了如何处理变长数据类型(例如字符串、字节序列和数组),以及构造为它们特殊设计的包含值长度的单元格。
我们讨论了分槽页的格式,它允许我们通过单元格ID从页外部引用某个单元格。在分槽页中,我们可以按插入的次序存储记录,并通过对单元格偏移量进行排序来维持键的顺序。
这些原理可用于各种二进制格式,包括构建磁盘数据结构和网络协议。
如果你想进一步学习解本章中提到的概念,可以参考以下资料:
Folk,Michael J.,Greg Riccardi,and Bill Zoellick.1997.File Structures:An Object-Oriented Approach with C++ (3rd Ed.).Boston:Addison-Wesley Longman.
Giampaolo,Dominic.1998.Practical File System Design with the Be File System (1st Ed.).San Francisco:Morgan Kaufmann.
Vitter,Jeffrey Scott.2008.“Algorithms and data structures for external memory.”Foundations and Trends in Theoretical Computer Science 2,no.4 (January):305-474.https://doi.org/10.1561/0400000014.