Skip to content

v3.0.6

Compare
Choose a tag to compare
@i-norden i-norden released this 26 Jan 19:10
16e17ab

v3 Database Schema

The primary objective of this upgrade from v2 is to move from a serial int based primary/foreign key scheme to a deterministic natural key scheme, this helps facilitate horizontal scaling by avoiding serial key conflicts when merging separate databases.

We also introduce sets of migrations split into pre- and post- historical batch processing units. The pre- set forgoes all FK and unique constraints, indexes, and sets the tables as UNLOGGED. The post- set adds these constraints and indexes and sets the tables as LOGGED. This is to improve performance of historical batch processing.

Additionally,

  • Adding some additional rows that will be useful for searches (e.g. header_cids.coinbase).
  • Removing some that are not particularly useful for searches (e.g. header_cids.base_fee).
  • Switching some BIGINT types to NUMERIC to avoid overflow.
  • Typo fixes in file names.
  • Split PK application to public.blocks into its own migration in the migrate_post_batch_set of migrations as we need to apply only that constraint prior to the v2 => v3 transformation.
  • Split application of log_cids related indexes into separate migration for logTrie fix processing; disable afterwards for v2 => v3 transformation.
  • Adjust migrations to (temporarily) apply log_cids.leaf_mh_key FK to ensure the logTrie fix was successful.
  • New Makefile targets for running up migrations one at a time: migrate_up_by_one and migrate_post_batch_set_up_by_one.
  • Fix issue where Makefile was failing to find goose if GOPATH was unset (#38).
  • New table to track the current version of the database schema, the version corresponds with the semantic versioning of this release.

Full v2 => v3 changelog: release-v2.0.0...release-v3.0.6