New in Endora Commerce: a built-in CRM with sales opportunities See it →
Endora Commerce

Redis integration

Redis is one of the three services Endora Commerce will not start without. It holds the cache, speeds up session reads and underpins the queues that carry background work: webhooks, transactional emails, feeds, newsletters, bulk operations.

Where Redis sits in the stack

Redis is an in-memory data store, most often used as a cache and a queue broker. In Endora Commerce it is not an optional extra: together with PostgreSQL and Meilisearch it is one of the three services whose reachability the platform’s health endpoint checks. If any of them does not respond, the endpoint returns 503.

The division of responsibility is simple. The catalog, orders, prices and sessions have their system of record in PostgreSQL. Redis holds what can be rebuilt or is short-lived by nature.

What the platform keeps in it

  • Job queues built on BullMQ - more on those below.
  • Read caches: settings, sales channels, CMS pages, the blog, the mega menu, dictionaries and cart recalculations.
  • Sessions: the session row is stored in PostgreSQL, and Redis acts as a fast read layer so the database is not queried on every request.
  • Short-lived login state: second-factor (MFA) challenges and OAuth transactions, with a time to live set so that an abandoned login simply expires.
  • Locks: among others, the lock that serializes installing, enabling and disabling modules, and a lock used when orders are taken in through the API.

An administrator sees one part of this directly: the “Clear cache” page in the admin panel, where selected areas or everything can be cleared so that freshly published content and changed settings show up immediately.

Queues: what runs in the background

There is one rule: the code handling a request only enqueues the job and responds, and a separate consumer executes it. Every job is claimed atomically, so two worker processes running in parallel never process it twice.

QueueWhat it doesWhat shows in the admin panel
Webhook deliverySigns the event (HMAC-SHA-256) and sends it to the subscriber URL; up to 8 attempts with exponential backoffThe deliveries list under webhooks; a delivery that failed for good can be replayed manually
Transactional emailsSending the messages triggered by events in the store, such as an order confirmation or a shipment notification-
Catalog bulk operationsBulk edits of more than 50 products, and a full Meilisearch reindex after an attribute’s searchable flag changesThe “Bulk actions” page with status and counters; an in-app notification and an email on completion
Product feedsGenerating and delivering files, including for Google Merchant Center-
NewsletterCampaign planning and sending with one job per recipient, automation steps-
Server-side analytics eventsDelivering server-side events to Google Analytics 4 and GTM-

Invoice submissions to KSeF take the same route: a durable queue with retries. The practical effect is that a KSeF outage or a slow webhook receiver on the integrator’s side does not stall order intake: the job waits in the queue and retries with increasing delay until it succeeds or a person steps in.

Requirements and configuration

  • Redis 7.x. The platform connects through a single address in the REDIS_URL variable, so it can be Redis from a container, from distribution packages or on a separate server.
  • In the reference production Compose file, Redis runs on the same VPS as everything else, on the stack’s private network, with no published port.
  • The same file starts it with the append-only file enabled (appendonly yes), so that jobs waiting in a queue survive a restart. According to the Redis persistence documentation, with the default policy of syncing to disk every second you can lose about one second of writes in a failure.
  • If you set a memory limit (maxmemory), keep the noeviction policy. BullMQ requires it to work correctly, because evicting an arbitrary queue key corrupts the queue’s state. Eviction policies such as allkeys-lru make sense for a pure cache, not for an instance that queues live on.

Scaling the workers

By default, queue consumers run in the same process as the API, which is enough on a single VPS. Once bulk edits, imports or reindexing start to compete with response times, the BACKEND_ROLE variable splits the process roles: api serves HTTP only, worker handles queues only. Several worker processes can be started with no configuration change, provided they all point at the same Redis and the same database.

What happens if Redis goes away

Losing the contents of Redis does not delete any business record. The cache is rebuilt on subsequent reads, and sessions are read back from PostgreSQL. What can suffer is the jobs that happened to be waiting in a queue, which is why it is worth leaving AOF enabled. Bulk operations have an extra safeguard: their state is stored in the database, and at startup the worker re-enqueues those left in the pending state.

When troubleshooting, two symptoms come up most often. An operation that never leaves the pending state usually means there is no running worker, or its REDIS_URL differs from the API’s. Jobs piling up while consumers sit idle usually point to a disabled module: its consumers stay paused until the module is enabled again.

Let’s find out what we can connect at your end

Book a free consultation. We will walk through your ERP, warehouse and sales processes, and show you what the integration path looks like step by step.

Michał Zabielski, founder and CEO of Endora

Michał Zabielski

Founder and CEO, Endora

We reply within one business day.