#dred - Metered Subscriptions

1 messages · Page 1 of 1 (latest)

candid flame
#

Hi dred. Are you looking for a way to improve efficiency in your application to record usage? How are you currently doing things?

sage dove
#

@candid flame sorry for not responding. I am currently in the early development stage of a product and am trying to figure out what the most scalable solution is

river karma
#

codename_duchess had to step out but I can help you. Can you expand a bit upon what you are trying to decide here scalability-wise?

sage dove
#

sure. lets say I have a single product, called product x, which has metered billing in monthly periods. Product x represents a service that customers will be able to use on my platform. When a user signs up for the service, I will create a subscription entity and store the subscription_id in my db. Then, every subsequent day that the user is using the service, I want to record usage. So, if I have 1,000 users all using my service every day, I need to record their usage. My initial thought is just to query the db for all active subscriptions and iteratively record usage for each one, but I don't think that will scale so well

sage dove
#

@river karma did that clarify my question?

river karma
#

I think so though I am still unsure what alternatives there might be.

#

Usage does need to be recorded individually for each

sage dove
#

alright that's what I thought

river karma
#

Yeah, unfortunately I don't think there is a part to optimize away here for the Stripe API