Engineers' billing nightmares
Some of this complexity is self-imposed. It&#x27;s flailing around and trying many different things on a slow meandering path to success. Often the trick is to simply copy what a bigger org has done after a decade of experience.<p>As a random example, Azure generally bills for resources on an hourly basis.<p>Suddenly, months, years, calendars, etc... cease to matter. Hours are hours. You can use UTC for everything, ignore time zones and daylight savings, and aggregate however you like, or how the customer likes.<p>Similarly, consumption-based plans are relatively straightforward. Simply multiply unit costs with the per-unit costs. You can even blend this into the hourly model above, where each hour has a &quot;units consumed this hour&quot; and a &quot;unit price per hour&quot;. This way you can handle things like changes to the unit price fairly accurately.<p>With cut-overs between plans, the trick is to just bill for them as separate line items instead of one thing going through transformations. E.g.: 220 hours of Standard SKU and 500 hours of Premium SKU this month. It doesn&#x27;t matter how many times the customer changed their mind this month that way.<p>A nice trick is that data like the above superficially sounds like it&#x27;ll be huge in a database, but column-based compression works wonders on it. Any analytics database engine, columnar format, or reporting engine should reduce  it by at least 30:1 or more. Also, you now have a ready-made reporting system that allows slicing and dicing! In some database engines like SQL Server, this is as simple as making the main billing table use a Clustered ColumnStore index. In more cloud-native land you could use Parquet files in S3 buckets, or whatever.<p>I&#x27;m not saying that complexity doesn&#x27;t remain, it&#x27;s just that complexity shouldn&#x27;t be voluntary. Copy a working model that matches your industry, and then only the essential complexity will remain.<p>An example of a hard-to-solve essential complexity is currency conversions and taxation when dealing with international customers. That&#x27;s an externally imposed set of problems that can&#x27;t be hand-waved away.