Citus 14.0 is out! Now with PG18 Support. Read all about it in Mehmet’s 14.0 blog post. 💥
In any as-a-service business, which bills monthly, a key metric you track is MRR or monthly recurring revenue. It's good practice to have this on a dashboard and check it on a monthly, weekly, or even daily basis. If you have a simple pricing model that has set monthly plans, say like Netflix this is pretty easy to calculate:
SELECT sum(user_subscriptions.price)
FROM user_subscriptions
WHERE users_subscriptions.ended_at IS null;
The above will give you the run rate as of this exact moment in time. It gets a little more complicated to do this in a single query that gives it to you over time.
Keep reading