TailCache · Part 1 of 6

Why did every program need its own copy?

At a hackathon at ION Trading, my team built a way for several programs to share one copy of a record. TailCache grew out of the question that stayed with me.

In March, I entered IONathon, a hackathon at ION Trading, the financial software company where I work. Teams get a short stretch of time to build a working version of an idea. My team picked a problem that had been bothering me. Several programs running on the same computer needed the same records. Why were we keeping a copy for each one?

Each program had a good reason. If it kept a record in memory, it could look it up again without asking another program to send it over. That local collection is a cache. The trouble came when the second program did the same thing. Then the third. We were using more memory to store data we already had.

We built one store they could share. The program responsible for a record wrote it once. The others could read it directly. We spent part of the night tuning how the records were turned into bytes. Our prototype won the hackathon.

The question I took home was a little awkward for someone who had just built a shared cache. Suppose there’s only one program. All those duplicate copies go away. Would I still choose to store the data the same way? That’s where TailCache started.