POSETTE: An Event for Postgres 2024 (formerly Citus Con) will happen virtually Jun 11-13, 2024. Call for Speakers is open! 💥
If you've used a relational database, you understand basic
INSERT statements. Even if you come from a NoSQL background, you likely grok inserts. Within the Postgres world, there is a utility that is useful for fast bulk ingestion:
\copy is a mechanism for you to bulk load data in or out of Postgres.
First, lets pause. Do you even need to bulk load data and what's it have to do with Citus? We see customers leverage Citus for a number of different uses. When looking at Citus for a transactional workload, say as the system of record for some kind of multi-tenant SaaS app, your app is mostly performing standard insert/updates/deletes.
But when you're leveraging Citus for real-time analytics, you may already have a separate ingest pipeline. In this case you might be looking at event data, which can be higher in volume than a standard web app workload. If you already have an ingest pipeline that reads off Apache Kafka or Kinesis, you could be a great candidate for bulk ingest.
Back to our feature presentation: Postgres
\copy. Copy is interesting because you can achieve much higher throughput than with single row inserts.