Balance stateless replicas with shared idempotency and measured failover scaling

This commit is contained in:
2026-10-16 16:02:33 +03:00
parent 0ab3a341aa
commit 4cb20cc68f
155 changed files with 77900 additions and 38 deletions
+10
View File
@@ -0,0 +1,10 @@
CREATE TABLE idempotency (
actor_id uuid NOT NULL REFERENCES users(id),
chat_id uuid NOT NULL REFERENCES chats(id),
key text NOT NULL CHECK (key ~ '^[A-Za-z0-9._:-]{1,128}$'),
request_hash text NOT NULL,
message_id uuid NOT NULL REFERENCES messages(id),
expires_at timestamptz NOT NULL,
PRIMARY KEY(actor_id,chat_id,key)
);
CREATE INDEX idempotency_expiry ON idempotency(expires_at);