Symfony 8.2 Messenger Concurrency: What Breaks in Multi-Tenant Applications

https://hackernoon.imgix.net/images/pL08BO3ouKNkhrqPjjNqbI6Myh73-ge83bre.jpeg

Parts one and two of this series put many tenant databases behind one Symfony deployment: each request and each queued message names its tenant, a DBAL connection wrapper follows it, and a shared worker handles messages of every tenant placed on the deployment. Then Symfony 8.2 shipped messenger:consume --concurrency, and the two shared workers of the demo became one worker with four children.

The first run retried every message. The handlers saw no tenant, because the listener that sets it runs in the parent process, and the handlers now run in children. That was the easy one. The harder ones came with the numbers: on a cold worker, tenant A's twenty-second job held tenant B's one-second job for 21 seconds while three children idled, and a batch handler marked rows in tenant B's database with the ids of tenant A's notes.

This article walks through what --concurrency moved where, what...

Copyright of this story solely belongs to hackernoon.com. To see the full text click HERE

Read more

https://images.wsj.net/im-62197104/social

A profile of Meta President Dina Powell McCormick, who helped Zuckerberg win Trump's favor but now faces congressional scrutiny of Meta's spending and AI plans

Featured Podcasts Big Technology Podcast: Jensen Huang Goes To Washington — With Josh Rogin The Big Technology Podcast takes you behind the scenes in the tech world featuring interviews with plugged-in insiders and outside agitators. Subscribe to Big Technology Podcast. Great Chat: Nothing ever happens A podcast mostly about tech. Brought