3 ms·
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 det
by vidarh 3y ago
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...)
- 6510 3y ago> #3, maintaining old pricing I copy the entire product into the order. The thing one buys should be the thing on the screen when the decision is made. Poor pictures, description with typos, wrong categories, old/wrong pricing etc
- vidarh 3y agoYeah, that can be a good approach. Including all the data defining the old product in an unchanging way was one of the sticking points that led to the creation of my team at Yahoo. The US team didn't think twice about changing invoice templates for examples, while the European finance teams broke out in hives at the thought of anything changing on already issued orders, much less invoices. I spent three years holding the fort to ensure the US team didn't take over invoice processing on our behalf until they could guarantee at least the invoices were unchanging...
- swader999 3y agoEverything has to be historically available. Think about returns and redoing the entire period and so on. Sometimes even the old code if you want to be perfect.
- wredue 3y agoThis approach is generally okay. It at least keep your mandatory data for audit around. One issue with it is that it often ends up forcing you to build out a lot of backward compatibility into your audit system as things change.
- cvccvroomvroom 3y agoExactly. You really need experts in entity relationship data modeling (typically in Oracle DBMS), data hygiene, and codifying business rules. This isn't something web developers should generally take on. Software involving money should consider approximating the formality of engineering approaches: waterfall development model, formal verification, and extensive unit and integration testing. There are hidden costs that edge up TCO for DIY. It's possible COTS maybe very expensive or incapable of being customized sufficiently to meet the needs of the particular application, but DIY should generally be the last resort when no other viable solution exists.
- PeterStuer 3y agoExactly. With some experience the backend can be built by a single person in about 3 months if you have access to good testing data. I've done it. Customer ran verfication against their legacy mainframe, software was accepted right at delivery, 0 bugs found. Afaik it is still running in operations, with ofc some changes and adaptations over the years.