Flash is consumable. The cells can only withstand so many write/erase cycles before failing.
Writes to the drive are done at some page size. Say 4kb, though I think it may be larger in hardware now. If you write less than that size and then flush to disk you will cause write amplification and waste cycles.
Flash drives have an erase block size which is larger than the page size (for complicated reasons). If you partially erase these blocks you may eventually force the drive to rewrite the remaining contents before erasing the block, which again causes write amp and wastes cycles.
The most efficient way to write to such a device is therefore in a log-structured format. You buffer data in memory and append it in pages which are at least as large as the (hardware) page size. You also want your erases to have strong temporal locality so that pages written to the same erase block (i.e. those which were written around the same time) are erased together.
Finally you also want to avoid filling the drive too much as wear leveling is harder when there is little remaining space and this could result in uneven wear which harms the drive (and/or harms write performance).
Fortunately your workload (storing literal log lines) is, as it turns out, log-structured!
Btrees and LSM trees are data structures which are designed to allow for random writes, that is writes which are out of sorted order. Your workload, logging, should have perfect order, meaning you don’t actually need a Btree/LSM.
However, both Btrees and LSMs have optimizations which cause them to fall back to near perfect log-structured behavior in the face of an append-only workload. For a Btree you can simply fill the pages in order and then flush them. There is still write-amp for the nodes up the tree but the more you buffer them the cheaper it gets.
Unfortunately CubDB as I understand it uses a compaction strategy similar to a copying GC where it copies all of the good pages out of the DB. This is… an unfortunate deficiency, here. Maintaining a freelist would be better.
But if you simply avoid flushing to disk for as long as possible you will build up most of the mutations in-memory (or in the OS page cache) and avoid most of the write-amp, which will protect the drive. There is little you can do about the compactions other than to avoid them as long as possible.
By writing the entire database out to the drive each time you are creating an enormous amount of write-amp. Remember that your workload is append-only, so it’s counterproductive to rewrite the existing pages since they never change.