SShortSingh.
Back to feed

Hybrid Outbox Pattern Uses In-Memory Queue for Speed, PostgreSQL for Recovery

0
·28 views

A developer has proposed a hybrid implementation of the Transactional Outbox Pattern that combines an in-memory queue with PostgreSQL to balance low latency and durability in distributed systems. In the standard approach, a worker polls a PostgreSQL outbox table at regular intervals to forward events to Kafka, but this creates a trade-off between polling frequency, database load, and delivery latency. The new design commits only event IDs to an in-memory queue immediately after a database transaction, while PostgreSQL retains the full event payload as the durable source of truth. A Batch Publisher reads these IDs, fetches the corresponding events from PostgreSQL, and forwards them to Kafka, keeping the fast path lean. Database polling is not eliminated but is repurposed as a background recovery mechanism that detects unprocessed events and reintroduces their IDs into the same memory queue pipeline.

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 ·

Orbit: A Free, Self-Hosted Personal Assistant That Replaces Ten Apps

A developer built Orbit, a free and open-source personal assistant designed to run on the user's own machine. It consolidates tasks, calendar, finances, notes, habits, documents, health data, and more into a single dashboard with unified search. An optional AI assistant is disabled by default and can run locally through Ollama or use the user's own API keys from providers such as OpenAI, Anthropic, or Gemini. Its agent workflows require user approval for every change and lack any tools for deleting, paying, emailing, or sharing data. The project is available on GitHub and can be launched with Docker Compose, using SQLite by default or PostgreSQL as an alternative.

0
ProgrammingDEV Community ·

EU Set to Ban Dark Patterns in Web Design, With Penalties Up to 6% of Turnover

The European Union is preparing regulation that would outlaw deceptive interface designs, known as dark patterns, that mislead or pressure users into commercial actions. The proposed rules, reportedly targeting entry into force on January 1, 2025, would cover digital services offered to EU consumers, including e-commerce, apps, and SaaS tools. Penalties could reach 6% of global annual turnover or €30 million, whichever is higher. Industry commentary suggests many violations can be fixed with incremental interface changes rather than full redesigns, though some companies may see short-term conversion dips during the transition.

0
ProgrammingDEV Community ·

Dev.to Users Propose Customizable Profile Pages Like GitHub READMEs

A DEV Community member observes that author profile pages on the platform look bare and make it hard for writers to stand out. They propose adding a feature similar to GitHub's username/README.md, which renders a special page on a user's profile. Such a page would let authors include graphics and richer presentation rather than relying only on a plain bio. The post suggests two possible implementations: an article titled with the author's username, which could be a draft and would be pulled onto the profile automatically, or letting authors select an existing article in their settings. The post seeks community feedback on the idea.

0
ProgrammingDEV Community ·

Freelance seller turns a cheap VPS into a shared inbox to stop missing customer messages

A solo Vietnamese seller lost a sale after overlooking a loyal customer's Zalo message during a busy pre-Tết period. The incident showed that inquiries were scattered across Zalo, Facebook and email with no single place to track unanswered messages. To fix this, the seller set up a low-cost VPS in Vietnam for data control and low latency, hosting a shared mailbox and a request-tracking sheet. Each incoming message is logged manually, with a deadline and status, and requests are grouped into urgent, normal and can-wait tiers with color coding. The approach relies on simple tools and deliberate logging habits to ensure no customer request is missed.