vendredi 24 janvier 2020

System design pattern for recurring payments

I'd like to ask what are some common, widely adopted patterns to design a system which auto-renew user's subscription when it expires.

I'm specifically asking how to trigger that operation?

Assume there's a system, with some RenewSubscription method that do the all logic. The method should be triggered just after user's subscription expired.

The only way I see to implement it is to have some kind of background task (console app or lambda) that query DB every N seconds (or minutes) and checks if there is any expired subscription to renew.

Can this be implemented without querying DB every few seconds?

Aucun commentaire:

Enregistrer un commentaire