scylla_fdw
scylla_fdw · Foreign data wrapper for querying and modifying ScyllaDB tables from PostgreSQL over CQL.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 101159 | scylla_fdw | scylla_fdw | 1.0 | FDW | PostgreSQL | C |
PostgreSQL · 14, 15, 16, 17, 18
Usage
Sources:
- Upstream README at the reviewed commit
- Version 1.0 SQL objects
- Extension control file
- FDW implementation
- Connection implementation
- ScyllaDB driver dependency
scylla_fdw maps ScyllaDB tables into PostgreSQL through the foreign-data-wrapper API. The reviewed code implements scans, inserts, updates, deletes, and IMPORT FOREIGN SCHEMA, with limited predicate pushdown. It requires PostgreSQL 14 or later, a C++17 toolchain, and the separately built ScyllaDB C/C++ driver.
Core Workflow
Create a server and a role-scoped user mapping, then define the remote table shape explicitly:
keyspace and table identify the remote relation. Set primary_key when updates or deletes must build a remote key predicate. Confirm the actual ScyllaDB partition and clustering-key requirements rather than assuming that this option makes arbitrary predicates efficient.
Object and Option Index
scylla_fdw_handler()andscylla_fdw_validator(text[], oid)back thescylla_fdwforeign-data wrapper.- Server options include
host,port,consistency, connection-pool sizing, and TLS-related values. - User-mapping options are
usernameandpassword. - Foreign-table options include
keyspace,table, andprimary_key. IMPORT FOREIGN SCHEMAderives PostgreSQL foreign-table definitions from ScyllaDB metadata.
Query and Transaction Boundaries
- The deparser only pushes a subset of simple conditions. Joins and aggregates are not pushed down; expressions involving
OR,NOT, orNULLcan remain local. UseEXPLAIN (VERBOSE)to verify each important query. - Collection-type handling is limited. Test every mapped type and its null behavior against representative data.
- Remote writes are executed through the driver and are not enlisted in PostgreSQL’s transaction or rollback machinery. A later local error can therefore leave ScyllaDB effects committed.
- The source accepts a
request_timeoutoption, but the reviewed connection implementation does not apply it to the driver. Do not rely on this setting as an enforced query deadline. - The README describes
ssl_cert,ssl_key, andssl_caas file paths, while the reviewed connection code passes their option strings directly to the driver’s certificate/key setters rather than reading files. Validate TLS with the exact build and option representation before use. - The reviewed
IMPORT FOREIGN SCHEMApath establishes a separate default connection and does not carry the configured TLS, timeout, or consistency values into that metadata request. Test it separately, especially against TLS-only clusters.
Operational Caveats
- Credentials live in PostgreSQL user-mapping catalogs. Limit catalog visibility and grant server usage only to a dedicated role.
- The repository’s only release tag is
0.1.0-alpha, while the extension control file reports version1.0. Treat both the API and on-disk metadata as alpha-quality until tested. - Driver calls run inside a PostgreSQL backend. Exercise DNS failures, authentication errors, timeouts, remote-node loss, cancellation, and backend restart behavior before any non-test deployment.