I use demos to make a product’s story concrete, and I value workflows that keep a demo useful without requiring an app server to stay running. These notes cover a small automation experiment, launch-blog writing, and a self-contained PostgreSQL demo built around simulated web-analytics data.
On 2024-12-05, I was spending a little time improving my demo flow and finding Mac Automator and some basic AppleScript really handy.
I enjoy helping tell the story for a product in its early days by writing the launch blog post, and I think blog-driven development can be quite focusing.
For a Crunchy Bridge demo, I took code my colleague @marcoslot came up with when at Citus and developed a self-contained way to generate simulated Google Analytics-style data in PostgreSQL.
After a few iterations, I found a process I was happy with and considered a good foundation to build on.
The demo’s http_request table has a BIGSERIAL primary-key id, plus site_id, ingest_time, url, request_country, ip_address, status_code, and response_time_msec fields.
I converted the generator to a PL/pgSQL function that inserts a fixed batch of 10,000 randomized request rows per invocation and pauses for random() * 0.01 seconds between inserts.
The generated values include site IDs from trunc(random()*32), country choices of China, India, USA, and Indonesia, status codes 200 and 404, and response times from 5+trunc(random()*150).
The function can be invoked with SELECT insert_random_http_requests();.
I use the sleep to space out the simulated requests, and it can be adjusted to speed up or slow down generation.
Crunchy Bridge Scheduler lets me schedule the SELECT to run every 1 minute or multiple times, so the database can keep receiving data at night and on weekends without a separate app server running.
To keep the table from growing forever, I suggested partitioning or deleting records older than 30 days; the post’s example uses ingest_time() in the deletion condition.
I described this demo as a starting point for possible additions: PostgreSQL partitioning, rollups with pg_incremental, mixed transactional and analytical workloads with Crunchy Data Warehouse, and logical replication from Postgres to Iceberg.
I said that not needing to run an app server is a small nuance that really improves this flow.
This scheduled generator is a specific example of keeping recurring work inside the database, alongside the approaches I describe in scheduled postgres jobs and data loading and workflows.
Related: warehouse demos and demand, data loading and workflows, generating data series