WIP: PostgreSQL quota manager and storage backend
This PR is based on Trillian's existing MySQL quota manager and storage backend. The first several commits were auto-generated by this script, which forked the existing MySQL code into different directories (whilst preserving the git history) and then did a bunch of search'n'replacing to switch from the database/sql interface to the jackc/pgx interface.
Improving performance is my main reason for using the pgx interface directly. In particular, the pgx interface has allowed me to use PostgreSQL's COPY interface for fast bulk-upserts.
The current status of this PR is that go test in the storage/postgresql directory passes all the tests. (I've not yet attempted to stand up a "proper log"). I figure that now's a good time to share my efforts for wider review. :-)
My motivations for putting together this PR are that (1) I and my colleagues at Sectigo have a fair amount of experience with PostgreSQL, but almost no experience with MySQL/MariaDB; and (2) we suffered a CT log failure earlier this year due to MariaDB corruption after disk space exhaustion, and we are confident that PostgreSQL would not have broken under the same circumstances.
Checklist
- [ ] I have updated the CHANGELOG.
- [ ] I have updated documentation accordingly (including the feature implementation matrix).
/gcbrun
/gcbrun
/gcbrun
/gcbrun
/gcbrun
/gcbrun
/gcbrun
/gcbrun
/gcbrun
/gcbrun
/gcbrun
/gcbrun
/gcbrun
/gcbrun
This is super cool to get PostgreSQL in. Thank you so much for the great contribution, @robstradling! (and thanks @mhutchinson for the review)
Thanks @roger2hk. Adding postgres support for your CTFE 'extra data' storage saving feature is next on my list. :-)