CSV Writeback Through Intermediate DB

Richard Czechowski · Friday Demos · November 6, 2026 · 2:49

Demonstrates row-level CSV updates using key columns, stable table naming, and buffered writes. Shows concurrent updates from multiple users and explains how the buffer synchronizes changes…

Try it yourselfThe full week on docsperformancewriteback

Transcript

This transcript is auto-generated. Names and product terms may be wrong.

  1. OK. Next, CSVs now have a key column that can be selected here. The key column allows us to essentially set an index so that we know how to write data to the CSV one row at a time. Today, CSVs work as single files. Each entry simply replaces this CSV, and we're trying to improve this so that applications can use CSV as a backend.

  2. There is also consistent naming here, so we always write data to the same table . But the key is the most important thing. Setting the key allows you to write one line at a time, and I won't show it here because I have a small application. This app shows how recording works: I run many recordings simultaneously in a stream.

  3. They are not written directly to Snowflake right away. They end up in the Snowflake buffer, or, excuse me, in the Postgres buffer, which then writes at a certain frequency. So over time they end up in Snowflake , and that allows me to, for example, run a second thread as a different user. Now I record data everywhere. I'll have a bunch of saves from different users coming in at the same time.

  4. They all edit different lines in the same CSV. So " under the hood" there is one CSV file that is constantly being written to, and you see that it is periodically updated after clearing the buffer. To prove this, we'll go to the workbook and source, since we started with a blank CSV, and now we have all these records from our various dummy users.

  5. So, this will allow applications with very high write parallelism and write data much faster . This also helps when you have databases like Snowflake that are not designed for high write concurrency, and the buffer allows us to have a layer between us and whatever database we are writing to so we can write at the same pace. Ahem.

  6. Where is this database, Richard? Is this an application database? What is this? Yes, we create a small Postgres on our side, and the good thing is that since it's a buffer and we flush it, we only store customer data for a few seconds. So yes, we store customer data, but unless your connection to the database is interrupted, we don't retain it.

  7. Um, we'll hold them if your DB goes down and we can't perform a data dump. So we'll just hold them until we reconnect.