News for hackers. Stuff that matters.
Re:The 14 pains of building your own billing system by actionfromafar on Monday February 26, 2024 @11:00AM (#39512781)
Even such an insane design can be made passable, by making the file in-practice-a-queue if you squint.

Remove old entries, keep a large margin of old entries. Append new records to the file. Use a counter. (Make it 64 bit if you are paranoid.)

On the "receiver" end, keep track of what you last saw. Could be as simple as keeping track of the counter.

Add only records you never saw before.

Process new records.

There are of course nowadays so many better ways, but "real" and stable systems have been built with such duct tape.

There are no comments on this comment yet.