SShortSingh.
Back to feed

Distributed Locks, Outbox and Inbox Patterns: Solving Consistency in Distributed Systems

0
·21 views

Distributed systems can behave correctly within each individual component yet still produce incorrect outcomes across components, because separate services do not share a common transaction boundary. Failures most often occur in the gaps between independently operating components rather than within any single component itself. Distributed locking addresses concurrent ownership of shared resources, ensuring only one service instance acts on a shared resource at a given time, though it cannot physically halt a stalled process from continuing after a lock expires. The Outbox pattern bridges the gap between a committed database transaction and reliable delivery to asynchronous messaging systems like Kafka or RabbitMQ, while the Inbox pattern ensures incoming messages are processed exactly once within a transactional business context. Understanding which consistency boundary needs protection — rather than simply categorising patterns by component type — is the key to selecting the right coordination mechanism.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

AI agents can use your browser session instead of your password, experts say

APX, a free open-source desktop app, lets users run their own AI agents locally, including for tasks on websites. The article argues that the key question is who signs in, which browser session is used, and what the agent may do afterward, rather than whether the agent can open a browser. Users are advised to start with narrow tasks, verify the site address before entering credentials, and complete one-time codes or CAPTCHAs themselves. APX offers a browser handoff feature so a person can take over the tab for sensitive steps, though this requires a desktop browser rather than a headless one. The piece also cautions that a successful login does not confirm the task was completed, and recommends signing out and reviewing permissions once access is no longer needed.

0
ProgrammingDEV Community ·

How BreathTime's petition system works: proposals, admin review and signing

BreathTime is a small civic platform where registered users can propose petitions, sign them and leave supporting comments. Any logged-in user submits a proposal with a title, description and addressee, which is saved as pending and reviewed by a human administrator who can approve or reject it, with rejection comments sent back to the author. Only administrators publish approved petitions, setting the goal (1,000 signatures by default), and each petition is signed once per user, enforced both in code and in the database. Signatures can include an optional public comment, and the platform openly lists current limitations such as no real-time updates, no pagination in the admin list, no audit log and no automated moderation.

0
ProgrammingDEV Community ·

Auditing AI C++ Patch Graders by Seeding Faulty Mutants

A hypothetical example describes an eval harness that reported PASS on AI-generated C++ patches for weeks while a signed modulo replacing a bounded comparison went undetected. The unit tests and sanitizer checks stayed green because no test case exercised the faulty branch, showing that a passing report does not prove the grader can still catch a given failure. The proposed remedy is a weekly self-audit that pushes known-faulty patches, called mutants, through the real harness and flags any grader that fails to reject them. Each mutant is declared in a manifest with the graders that must catch it, and a surviving mutant counts as a finding. The approach requires a clean git worktree and a harness that reports per-grader status in machine-readable form.

0
ProgrammingDEV Community ·

Declaring Degradation: A Fallback Contract for AI Agents That Lose Their Cloud Model

An illustrative scenario describes a nightly job that tags support tickets via a remote model, where a retry wrapper silently returns empty tags during timeouts and the failure goes unnoticed. The author argues this is a missing contract between a capability and its degraded form, not a model-quality issue. The proposed remedy is a three-tier declaration (local_only, cloud_preferred, cloud_required) that specifies whether each tool may leave the host and what it may return when the cloud path is unavailable. Declarations live alongside each tool as data, so reviewers can audit them and missing entries fail at startup rather than at runtime. A small outcome object reporting status (ok, degraded, refused) and payload source is recommended over resolvers that return inconsistent values.