3 ms·
As the author alludes to at the end, streaming is a skill, and I think that really is a big issue. A lot of us, myself included, don't immediately reach for str
by allenu 7y ago
As the author alludes to at the end, streaming is a skill, and I think that really is a big issue. A lot of us, myself included, don't immediately reach for streaming as a solution to our problems, even if it can be.
For instance, I'm working on a file-based CRDT-style distributed, journaling database (for single-user but multi-device) and the "diffs" for a single device are stored in a journal. Now in retrospect, it's obvious that I don't need to store the entire journal of diffs in memory (this is a "streaming" architecture), but on my first couple of passes, because it was easier, I stored everything in memory.
After playing around with some toy projects using my database, I realized this wouldn't scale (why load all of history into memory if you don't need it?) and not only that my system lends itself better to a "file stream", i.e. don't store everything in mem, just append to existing files or read from them as needed. Seems obvious now, but when building it out, my first inclination wasn't to do it that way.