News for hackers. Stuff that matters.
Re:Ask HN: How to design database schema for usage based bil... by kondro on Wednesday August 31, 2022 @08:22PM (#32670120)
I know it feels like overkill, but I’d recommend either outsourcing (even Stripe has usage-based billing if you can keep your updates under 100/s) or using something off-the-shelf like https://killbill.io.

I know it seems like a simple problem, but billing systems quickly turn into Eldridge horrors, even if you have the best intentions, and it’s always nicer to have someone else to maintain that for you.

Re:Ask HN: How to design database schema for usage based bil... by NateEag on Wednesday August 31, 2022 @09:59PM (#32670937)
> Eldridge horrors

Just FYI, I think you probably meant "eldritch horrors":

https://www.merriam-webster.com/dictionary/eldritch

Re:Ask HN: How to design database schema for usage based bil... by kondro on Wednesday August 31, 2022 @10:03PM (#32670968)
Stupid auto-correct.
Re:Ask HN: How to design database schema for usage based bil... by NateEag on Thursday September 01, 2022 @12:54AM (#32672159)
Yeah, I almost didn't say anything - it looked autocorrect-y.

Just figured it would be useful to mention in case it was a genuine mondegreen.

Re:Ask HN: How to design database schema for usage based bil... by punkpeye on Wednesday August 31, 2022 @08:31PM (#32670202)
Using Stripe here makes sense, if they have product for this. Wouldn't I need to store all of the same information in my database anyway as a source of truth?
Re:Ask HN: How to design database schema for usage based bil... by asommer12 on Thursday September 01, 2022 @05:06PM (#32683202)
Stripe is great for payments, but they don’t make usage data super useful for data purposes — their primary use case is payments.

If you want access to your data for other business purposes - stakeholder data, embedded dashboards, alerts and notifications about usage, etc - then you’ll want a system more purpose-built for usage data than Stripe.

Check out https://kable.io. Kable is purpose built as a data and billing solution, where your data is available for purposes ancillary to payments.

[Disclaimer: I am a Kable founder, but what you’re describing is precisely what we’re built for. If you’d like to chat, either about Kable or about your design in general to build this in-house, I’d be happy to.]

Re:Ask HN: How to design database schema for usage based bil... by thedangler on Friday September 02, 2022 @10:44AM (#32691426)
Hi asommer, How can I contact you about Kable.io?
Re:Ask HN: How to design database schema for usage based bil... by asommer12 on Friday September 02, 2022 @11:26AM (#32691920)
[email protected] -- looking forward to chatting!
Re:Ask HN: How to design database schema for usage based bil... by kondro on Wednesday August 31, 2022 @09:00PM (#32670448)
You could (I would) but you could care a lot less about it and treat it mostly as a log to use for reconciliation later if there's an issue or if you want to migrate to a different billing system.

The data is going to still be available in Stripe to download later if you need the raw events (or just the summaries from the invoices).