Menu

Shopify Expiring Offline Tokens Under Load: PgBouncer pg_advisory_xact_lock vs Redis Lua Single-Flight Refresh Locks
📰

Shopify Expiring Offline Tokens Under Load: PgBouncer pg_advisory_xact_lock vs Redis Lua Single-Flight Refresh Locks

DEV Community: redis·spleyapp·about 8 hours ago
#QqR8NY7M
#devtoredis#devto#dev#string#shopify
Long article (1112 words) — no AI summary yet.
Reading 0:00
15s threshold

In our Shopify Dec 8 allowed_sources & Jan 1, 2027 expiring offline token guide , a sharp question came up in the comments right away:

How does pg_advisory_xact_lock actually behave behind **PgBouncer in transaction pooling mode , and when should you use **Redis SET NX PX + Lua * instead?*

When Shopify's 60-minute expiring offline tokens roll over during a merchant flash sale (10–50 concurrent orders/create and inventory_levels/update webhooks hitting your app at the same millisecond), picking the wrong locking primitive either causes 401 OAuth token rotation storms or exhausts your Postgres connection pool .

Here is the exact breakdown of all three patterns in production.

1.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.