Lab3: HAProxy, API replicas, idempotency for grade 4

This commit is contained in:
2026-11-11 01:29:57 +03:00
parent 0ab3a341aa
commit 9f25648c1b
37 changed files with 2083 additions and 26 deletions
+15
View File
@@ -0,0 +1,15 @@
-- Shared idempotency for POST messages across API replicas.
CREATE TABLE IF NOT EXISTS idempotency_keys (
user_id UUID NOT NULL REFERENCES users (id),
method TEXT NOT NULL,
path TEXT NOT NULL,
idem_key TEXT NOT NULL,
request_hash TEXT NOT NULL,
response_status INT NOT NULL,
response_body JSONB NOT NULL,
created_at TIMESTAMPTZ NOT NULL,
PRIMARY KEY (user_id, method, path, idem_key)
);
CREATE INDEX IF NOT EXISTS idempotency_keys_created_at_idx
ON idempotency_keys (created_at);