
When Systems Talk Without Knowing Each Other: Pub-Sub
A few years ago, I worked on a customer loyalty platform for a large retailer. Every time a customer made a purchase, multiple systems needed to react. The billing system had to record the transaction. The loyalty engine had to calculate points. The marketing platform needed purchase data to trigger campaigns. At first, the team considered wiring these systems directly together. The billing service would call the loyalty service. The loyalty service would notify marketing. And so on. But within a few weeks, the design looked like spaghetti. Every new requirement added another direct dependency. One change in one system caused a ripple effect across the others. We needed a way for systems to talk without being tightly tied together. That’s when the Publisher-Subscriber pattern became the answer.