forked from mtusi2026/mtusi2026lab3
Реализация ЛР 3 на оценку 3: HAProxy, 2 реплики API, идемпотентность, evidence
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
-- 002: общая идемпотентность отправки сообщений
|
||||
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 bytea NOT NULL, -- SHA-256 канонического тела
|
||||
message_id uuid REFERENCES messages (id),
|
||||
created_at timestamptz NOT NULL DEFAULT now(),
|
||||
PRIMARY KEY (user_id, method, path, idem_key)
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idempotency_created_idx ON idempotency_keys (created_at);
|
||||
Reference in New Issue
Block a user