lab3: 2 API replicas behind nginx LB, idempotency, X-Instance-Id

This commit is contained in:
2026-11-16 21:54:29 +03:00
parent 0ab3a341aa
commit fbe686f521
23 changed files with 727 additions and 14 deletions
+13
View File
@@ -0,0 +1,13 @@
CREATE TABLE IF NOT EXISTS idempotency_keys (
user_id uuid NOT NULL,
method text NOT NULL,
path text NOT NULL,
key text NOT NULL,
request_hash text NOT NULL,
status_code int,
response_body jsonb,
message_id uuid,
created_at timestamptz NOT NULL DEFAULT now(),
PRIMARY KEY (user_id, method, path, key)
);
CREATE INDEX IF NOT EXISTS idempotency_created_idx ON idempotency_keys (created_at);