but how do I serialize those pages back forth to disk.
are you tryng to write a database?
but as far as I know that's an overkill for this
Why do you think so?
Though arguably there is almost notihing to "serialize" for the page. Basically page contains already serialized data for the row (though there can be a lot of details). And probably a header to navigate the storage faster.
For example consider the overall page layout for PostgreSQL (Database Page Layout doc):
| Item |
Description |
| PageHeaderData |
24 bytes long. Contains general information about the page, including free space pointers. |
| ItemIdData |
Array of item identifiers pointing to the actual items. Each entry is an (offset,length) pair. 4 bytes per item. |
| Free space |
The unallocated space. New item identifiers are allocated from the start of this area, new items from the end. |
| Items |
The actual items themselves. |
| Special space |
Index access method specific data. Different methods store different data. Empty in ordinary tables. |
