Menu

Where do you put a referral program when everything it touches lives in the monolith?
📰

Where do you put a referral program when everything it touches lives in the monolith?

DEV Community: php·Pierre-Laurent Medori·8 days ago
#n6LMAkw0
#devto#dev#code#voucher#table
Reading 0:00
15s threshold

On October 22, I picked up a referral program halfway through. A first version applied the referral discount by writing it straight into the order line. I refused it. I wanted the discount to go through the voucher system we already have, and the referral to stay tracked.

Some context. I run backend engineering at GoodBarber , an app platform, and our customers pay for their apps through a back office that is a PHP monolith. A referral program has to touch the coupon field at checkout, the payment confirmation, invoices and credit notes, vouchers, the credits we give apps, and renewals, which a cron of our older CMS creates. All of that lives in the monolith. The question was where the referral itself should live.

Between 14:37 and 15:55 that day, I went around five answers.

Five places for the same code

A new table in the shared database, with its model. The obvious answer, and the one I liked least.…

Continue reading — create a free account

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