antonta's space
Following patterns wherever they emerge.
main posts

After years of plain text accounting

It's been almost 10 years of using plain text accounting for tracking personal finances and tiny projects here and there. Here's a quick summary.

The great side of it

The data model. It's perfect. I used Beancount myself regularly. The tree of accounts and the way transactions are specified cannot be done better. The flexibility level is exactly right. Inventory tracking, price conversions just make it better for tracking complex scenarios. You can accomplish a lot with virtual accounts too.

Next up is data control. The privacy aspect is covered well, nobody peeks at your books unless you explicitly share them. You can also put everything into a version control system, and track all your changes there. The format is stable and readable with just a text editor without any other software requirement. You can also swap implementations. Not many approaches can compete with this combination really.

Not to mention the excellent documentation of Beancount. It really helped me understand double-entry accounting principles. That solid foundation is necessary for keeping your books in order, and these typical articles on the Internet are not that helpful.

Extensibility is there too, you can write little plugins for extra processing, such as tracking in-flight transactions and make sure they balance out to zero using links for example. It comes at a cost - you have to maintain that code, but definitely worth it.

Auxiliary features are great. I'm a big fan of balance assertions. They open a door to a workflow, where you can specify balances and then adjust or add missing transactions to match these. Very convenient.

One interesting aspect is that it requires certain rigor to manage the data, which acts as a good learning opportunity. Entering transactions by hand at first requires thinking about the flows between accounts, and therefore the regular use crystallizes that knowledge pretty quickly.

What I got tired of

First off the plain text itself. I'm a vim user myself, and can navigate large text files well. For finance data, that is primarily append-only it becomes a little awkward - you are always editing the bottom of the file and not moving around unless you want to copy the transactions or peek into some data. To navigate efficiently, you have to organize the information somehow - split between files, grouped by month or a quarter within each file and so on.

I might be suffering from OCD, but keeping all these records well structured and formatted is another challenge. It feels sometimes that I'm doing a lot of meta work organizing my entries. What's even harder is modifying the historical transactions - I just delay that or never do. Want to rename an account? Sure, go through thousands of transactions. I don't want to modify the transactions, I just want to rename the account! I have this backlog of account name changes that I will likely never resolve. Data normalization would help here, but it's hard to do that well in plain text.

Another interesting angle is the feeling of lack of control over the data. Interesting paradox - I own every byte of these files, yet at the same time it feels like the data owns me. It's hard to articulate this one, perhaps it's due to a document-like model of data that fits better in a relational model, or lack of control over the underlying representation - it's text after all.

While auto-complete is there, it's far from perfect. Closed accounts are not excluded from the transaction entry that is past the close date, carrying the history of closed accounts wherever you go. Amounts are not auto-balanced within the transaction, you have to open that expression evaluation in vim to do basic arithmetic. Yes, I want the explicit amount shown over there. Inventory positions? Just forget about that.

Market prices in text files? Are you kidding me, what century is this? I had to write some code to fetch prices from providers, store them in a little sqlite database and then generate prices that Beancount will understand. If you rely on a lot of market prices data, this will be quite a lot of pain and processing. You have to run that data pull script weekly. In fact, my market prices are months out of date because I'm tired of running these scripts.

Lack of visuals. Yes, there's fava. Although I don't like spinning up a web server every time I need to take a look at my finances. It's also slow with large datasets based on my experience. It takes seconds to load my book, and it completely failed on the 50-year test data I tried to feed it, which had about double the transaction count of my own books.

Backups. Oh, backups. You have to keep your data safe, losing all these years of transactions would be devastating. I used to do manual weekly backups to offline storage, but then ended up with a mini-server with 6 disk ZFS array and weekly snapshots to worry less about that. Another source of meta work, although to be fair the server has other purposes.

I might be doing something wrong, and don't have full context on plain text accounting, but these problems don't seem to be solvable well at core.

Moving away

Of course when you get annoyed you try to solve the problem yourself. Can there be an app that has a similar data model, is privacy-oriented and has a VCS feel to that, yet addresses the pain points I described above?

I think so, but not without compromises. First, complete VCS is hard to implement. I thought it's not that necessary in my case, I can live with just a draft of changes, review them and then commit. Like having a shallow git repository copy. Transactions are append-only anyway and are rarely modified. Privacy aspect has to be solved, I don't trust third-party services in handling my financial data. Extensibility can wait, and some auxiliary features too.

I decided to write my own app exactly with this in mind. Make it UI-first, so that visuals are always there and not an afterthought. Same for privacy, make it end-to-end encrypted by default with modern crypto. If there was an app like that, I would definitely become a user, but it seems that there is none, so the solution is to build it yourself.

So far the experience is good, and I'm going to transition completely in a few months. Don't get me wrong, it's hard to move away after years of using plain text accounting and I have to make sure my app is solid in keeping the data before I can fully commit to that. Currently, I use both systems simultaneously and my app helped me catch some entry mistakes exactly due to visual components and quick navigation using filters and such. I had a pleasant experience analyzing my state of finances during certain events too. Plus transaction entry requires less keystrokes due to more advanced auto-complete, which is a bonus.

Is it worth writing yet another ledger from scratch you may ask? I think so, I'd better spend time on creative engineering work to reduce time spent on these daily chores and maintenance overhead. Of course building an app means I've traded text file database maintenance for code maintenance, but I find it easier to maintain 70k lines of code than 70k lines of plain text data, at least for personal use, or do I? Whether that holds true when running a service for others remains to be seen. The initial investment is substantial, however the result can be shared if someone else finds this approach more convenient than plain text as I found myself. Yes, this is a web app. Did a vim user actually embrace the web? Looks like so.