Table of Contents
See also https://github.com/hockeypuck/hockeypuck/issues/381
Motivation
There are ongoing issues with index consistency due to the dual-database structure of the SKS protocol. While these should be mitigated at runtime, in particular using writebacks, it would be more robust to unify the databases so that updates could be guaranteed transaction safe. It would also make it possible to run multiple hockeypuck front ends against a common database.
Design
The ptree could be stored in a postgres table, and updates to the ptree table would be performed as part of the same transaction as the (sub)key tables. Since this involves updates in-place, many potential issues could arise:
- Transactions might fail because of simultaneous updates to rows in the ptree table
- Bulk updates would need to be handled gracefully
- Performance may be adversely impacted
Due to the tight inner loops and updates in-place required, it would be preferable to implement the ptree at the lowest level possible. This may involve stored procedures or even a native postgres plugin.
Out of scope
Security considerations
There are no known direct security implications, however transaction consistency will automatically improve the security properties of the software.
Compatibility
Postgres schema migrations may be required (https://github.com/hockeypuck/hockeypuck/issues/252)