lab3: Nginx, реплики и идемпотентность

This commit is contained in:
2026-11-06 20:20:43 +03:00
parent 0ab3a341aa
commit 69102247bc
69 changed files with 5271 additions and 38 deletions
+14
View File
@@ -0,0 +1,14 @@
-- Additive migration: compatible with the lab2 schema and existing messages.
CREATE TABLE IF NOT EXISTS message_idempotency (
user_id uuid NOT NULL REFERENCES users(id) ON DELETE CASCADE,
method text NOT NULL,
path text NOT NULL,
key text NOT NULL,
request_hash text NOT NULL,
response_status integer NOT NULL,
response_body jsonb NOT NULL,
created_at timestamptz NOT NULL DEFAULT now(),
PRIMARY KEY (user_id, method, path, key)
);
-- Results are retained indefinitely in this lab (therefore at least 24 hours).
-- There is intentionally no independent cache expiry that could allow duplicates.