-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Identity database schema and publishing algorithm (#374)
I've optimized for: - More expensive writes in exchange for more performant reads - Support for high concurrency/reentrancy - Consistency and correctness
- Loading branch information
1 parent
931e499
commit 98f26b4
Showing
6 changed files
with
161 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
SET statement_timeout = 0; | ||
|
||
--bun:split | ||
|
||
DROP TABLE IF EXISTS inbox_log; | ||
|
||
--bun:split | ||
|
||
DROP TABLE IF EXISTS address_log; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
SET statement_timeout = 0; | ||
|
||
--bun:split | ||
|
||
CREATE TABLE inbox_log ( | ||
sequence_id BIGSERIAL PRIMARY KEY, | ||
inbox_id TEXT NOT NULL, | ||
server_timestamp_ns BIGINT NOT NULL, | ||
identity_update_proto BYTEA NOT NULL | ||
); | ||
|
||
--bun:split | ||
|
||
CREATE INDEX idx_inbox_log_inbox_id ON inbox_log(inbox_id); | ||
|
||
--bun:split | ||
|
||
CREATE TABLE address_log ( | ||
address TEXT NOT NULL, | ||
inbox_id TEXT NOT NULL, | ||
association_sequence_id BIGINT, | ||
revocation_sequence_id BIGINT | ||
); | ||
|
||
--bun:split | ||
|
||
CREATE INDEX idx_address_log_address_inbox_id ON address_log(address, inbox_id); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.