Live data from Hacker News

Problems with homemade billing systems

getlago.com

11–20 of 105 posts

Re: Problems with homemade billing systems

#11
post #2

Good article, and I generally agree that people are too quick to say “Ahh, this looks like a two week project” and ignore broader complexity. I’ve definitely seen a fair amount of that. My question is, how do I know that the OTS solution would actually be much better? For example, OP describes some tricky migrations from one type of billing to another, or complex grandfathering schemes - how would you have any guaran…

>how would you have any guarantee that your third party solution would be able to support those...

You could say the same thing about literally any 3rd party software or service you purchase. "Why use cloud services to do anything?" etc.

Sure this thinking will hold for some things, but chances are that for something as standard as billing you're not going to be implementing some revolutionary feature that gets you more customers. On the other hand, if you mess up billing because you rolled your own system that doesn't have many standard options that a mature OTS system would offer it can lose you potential customers, because for months at a time you're stuck building the most mundane and standard things like an annual plan that could be used to better appeal to buyers.

For billing, a one of the most standard things ever for a business, you simply take a small amount of time to survey the OTS options and compare features. Any you know what? There's an excellent chance that buy actually getting a comprehensive look at features offered by such options you will learn about the types of things you will absolutely want to do in the future. Things that, in retrospect, seem like obvious oversights, such as an annual plan. You'll see features like that in your survey and say to yourself "Oh, yeah, that's something we may definitely want in the future, lets put that on our requirement list for a final choice."

Re: Problems with homemade billing systems

#13
I've built several billing systems and managed a team that built a much larger one, and it's not that hard, but it does require an attitude and attention to detail that a lot of people lack.

E.g. one thing that worked well in the systems I've worked on was to break things into small state transitions, very firmly document the allowed states and their transitions, and log every transition to the database. Wherever possible (anywhere that didn't interact with external API's, and sometimes even when they did) we'd aim for state transitions to be idempotent. When they weren't, we'd seek to reduce the non-idempotent call to an external dependency to just that call as a separate state transition.

When something very occasionally went wrong, we could trace things in detail, and pinpoint it, and most of the time we could safely replay transitions around whatever went wrong until we could see what had happened.

It wasn't difficult to build these systems that way, but it was tedious, and something where it's easy for people to be tempted into shortcuts.

As for scaling, you spit out events for rollups, and can shard invoice generation. We handled millions of revenue on a machine far less powerful than my laptop today. Scaling really would not have been up there for me.

To #3, maintaining old pricing isn't generally that hard. Very few people drastically change how they account for usage, which tends to be the most complicated billing scenario. They tend to change amounts and periods and thresholds, which should be data, not code.

With respect to a team, I agree. One of the places I worked on billing was Yahoo. At the time it wasn't just one team, but several - my team (responsible for Europe) existed largely because the European finance and product teams didn't trust the US payment services team to take their requirements seriously enough and so wouldn't let them near the European premium services... Billing isn't something you want to do yourself unless it's either a core competency or you're big enough to have to deal with that kind of bullshit.

(As for size of teams, I've built a billing system with 2 people, but I've also worked on billing systems managed by 50... You really want to have a good idea whether you're likely to end up towards the former or latter before you go ahead...)

Re: Problems with homemade billing systems

#14
post #8

I built my billing system on top of Django and it's used in 2 online services for a few thousand users and hundreds of invoices a month. You have to be mindful of some edge cases, but if the scope is kept narrow, it's doable. The added benefit is the flexibility to fit it to your use case. And with Python, you get many high-level libraries, e.g. for decimal calculations and PDF generation.

I built a billing system for a web hosting company in PHP, almost 20 years ago. This was for a few hundred users. There were a couple of edge cases, but nothing incredibly challenging.

Re: Problems with homemade billing systems

#15
post #8

I built my billing system on top of Django and it's used in 2 online services for a few thousand users and hundreds of invoices a month. You have to be mindful of some edge cases, but if the scope is kept narrow, it's doable. The added benefit is the flexibility to fit it to your use case. And with Python, you get many high-level libraries, e.g. for decimal calculations and PDF generation.

My experience is that the scope is never kept narrow, which is exactly the same that the author is describing.

Well, you can - you can have a policy that forces payments from a select group. Some users will complain when "No, you cant pay with 2 chickens every 3rd full moon", but that is too bad.

Re: Problems with homemade billing systems

#16
post #2

Good article, and I generally agree that people are too quick to say “Ahh, this looks like a two week project” and ignore broader complexity. I’ve definitely seen a fair amount of that. My question is, how do I know that the OTS solution would actually be much better? For example, OP describes some tricky migrations from one type of billing to another, or complex grandfathering schemes - how would you have any guaran…

Well one thing an OTS solution accomplishes is it makes costs and capabilities very clear to product and marketing. When you have an internal team doing something bespoke to your organization it is viewed as much more malleable.

If the third party solution cannot support the billing system devised, or will support it for a large cost, companies are more likely to choose things that are more in the box.

Re: Problems with homemade billing systems

#17
post #5

Having gone through /exactly/ what this article is about, I know the pain. But I will point those that don't read the article to the last paragraph: > We considered implementing an off-the-shelf billing solution but there was nothing flexible enough and the switching costs were too high. Algolia also tried to migrate to Zuora before backing out and rebuilding their billing system for the fourth time. Most (all? I hav…

> there was nothing flexible enough

They would have to solve the same problem in a generic way. (add 10 more years)

> we had to migrate off

Adds to the fun doesn't it? My missing features hacked around previously exploded into an almost impossible puzzle.

Re: Problems with homemade billing systems

#18
I would instead say - commit properly to building your billing systems as a major and ongoing project, don't dismiss it as a 2 week "fun" side thing.

Not convinced any 3rd party product is going to have the flexibility to support ongoing innovation. If anything it's more of a case for in-house expertise and resource. Find some folks who want to be the billing guys!

Disclaimer: I built a large in-house billing system :-)

Re: Problems with homemade billing systems

#19

Like with everything, wrap your billing in a layer and when you grow enough you put your billing under it if you need it or switch to a different provider without changing your codebase. It's not wise to outsource parts that are essential for your business, because: 1. you depend on 3rd party service for a getting paid 2. your operations cost may rise or the service may change terms/functionality

[deleted]

Re: Problems with homemade billing systems

#20
post #2

Good article, and I generally agree that people are too quick to say “Ahh, this looks like a two week project” and ignore broader complexity. I’ve definitely seen a fair amount of that. My question is, how do I know that the OTS solution would actually be much better? For example, OP describes some tricky migrations from one type of billing to another, or complex grandfathering schemes - how would you have any guaran…

>how would you have any guarantee that your third party solution would be able to support those...

You could say the same thing about literally any 3rd party software or service you purchase. "Why use cloud services to do anything?" etc.

Sure this thinking will hold for some things, but chances are that for something as standard as billing you're not going to be implementing some revolutionary feature that gets you more customers. On the other hand, if you mess up billing because you rolled your own system that doesn't have many standard options that a mature OTS system would offer it can lose you potential customers, because for months at a time you're stuck building the most mundane and standard things like an annual plan that could be used to better appeal to buyers.

Survey the main OTS options and see what they can do. It will probably give some ideas like "Oh yeah annual plans, we'll probably want them at some point". At the very least you do this at the outset when you're small. Worry about complex billing requirements that won't be part of vanilla options in most OTS systems once you're big enough & complex enough to require them. Otherwise you're worrying about a Maserati problem.

Post reply on HN