Skip to main content

Google Cloud Storage (GCS)

Overview

The Google Cloud Storage (GCS) destination writes each stream as one or more objects in a GCS bucket. By default, each stream has its own directory under the configured bucket path.

Supported sync modes

Sync modeSupported?
Full Refresh - OverwriteYes
Full Refresh - AppendYes
Full Refresh - Overwrite + DedupedNo
Incremental Sync - AppendYes
Incremental Sync - Append + DedupedNo

Getting started

Requirements

  • A GCS bucket.
  • A Google Cloud service account with an active HMAC key.
  • Network access from the Airbyte deployment to https://storage.googleapis.com.

Setup guide

  1. Create a GCS bucket, or select an existing bucket. The connection check writes, lists, and deletes a probe object. Ensure that retention policies and object holds permit this deletion.

  2. Create a dedicated service account for Airbyte and create an HMAC key for it. If your organization uses the constraints/storage.restrictAuthTypes organization policy, it must allow HMAC authentication. Save the HMAC secret when you create the key because Google Cloud doesn't provide it again.

  3. Grant the service account the Storage Object User role (roles/storage.objectUser) on the bucket. If you use a custom role, include these permissions:

    storage.multipartUploads.abort
    storage.multipartUploads.create
    storage.objects.create
    storage.objects.delete
    storage.objects.list

    Delete access is required because the connection check deletes its probe object and Full Refresh

    • Overwrite syncs delete existing objects under the stream's output prefix.
  4. In Airbyte, enter the bucket name, bucket path, bucket region, HMAC access key, HMAC secret, and output format.

  5. Test the connection. If your deployment restricts outbound network traffic, allow access to the GCS XML API endpoint at https://storage.googleapis.com.

Configuration

ParameterTypeRequiredNotes
GCS Bucket NamestringYesName of the bucket to sync data into.
GCS Bucket PathstringYesPath within the bucket where the connector writes data.
GCS Bucket RegionstringNoBucket region. Defaults to us. See GCS locations.
HMAC Access KeystringYesAccess ID from the service account's HMAC key.
HMAC SecretstringYesSecret associated with the HMAC access key.
Output FormatobjectYesFormat-specific configuration. See Output Schema.
GCS Path FormatstringNoDirectory layout under the bucket path. Defaults to ${NAMESPACE}/${STREAM_NAME}/${YEAR}_${MONTH}_${DAY}_${EPOCH}_. See GCS Path Format.
File Name PatternstringNoOutput file naming pattern. Defaults to {part_number}{format_extension}. See File Name Pattern.

The connector supports only HMAC key authentication, using the GCS S3-compatible XML API.

Both Google-managed and customer-managed encryption keys (CMEK) are supported. You can view the encryption setting under the "Configuration" tab of your GCS bucket, in the Encryption type row.

warning

Full Refresh - Overwrite syncs delete existing objects under each stream's output prefix before writing new objects. Use a dedicated bucket or bucket path and verify your path configuration to avoid deleting unrelated data.

The full path of the output data is:

<bucket-name>/<bucket-path>/<source-namespace-if-exists>/<stream-name>/<upload-date>_<upload-millis>_<partition-id>.<format-extension>

For example:

testing_bucket/data_output_path/public/users/2021_01_01_1609541171643_0.csv.gz
↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
| | | | | | | format extension
| | | | | | partition id
| | | | | upload time in millis
| | | | upload date in YYYY_MM_DD
| | | stream name
| | source namespace (if it exists)
| bucket path
bucket name

Please note that the stream name may contain a prefix, if it is configured on the connection.

The rationales behind this naming pattern are: 1. Each stream has its own directory. 2. The data output files can be sorted by upload time. 3. The upload time composes of a date part and millis part so that it is both readable and unique.

A data sync may create multiple files as the output files can be partitioned by size (targeting a size of 200MB compressed or lower) .

GCS Path Format

The GCS Path Format field controls the directory structure under the bucket path. The default value is:

${NAMESPACE}/${STREAM_NAME}/${YEAR}_${MONTH}_${DAY}_${EPOCH}_

The following variables are available for path format:

VariableDescriptionExample
${NAMESPACE}Namespace of the stream (empty if none is configured)public
${STREAM_NAME}Name of the streamusers
${YEAR}Year of the sync (UTC, 4-digit)2026
${MONTH}Month of the sync (UTC, zero-padded)07
${DAY}Day of the sync (UTC, zero-padded)14
${HOUR}Hour of the sync (UTC, zero-padded)09
${MINUTE}Minute of the sync (UTC, zero-padded)30
${SECOND}Second of the sync (UTC, zero-padded)45
${MILLISECOND}Millisecond of the day (UTC)0123
${EPOCH}Milliseconds since Unix epoch1752489045000
${UUID}Random UUIDa1b2c3d4-e5f6-...
${SYNC_ID}Unique ID of the sync101

File Name Pattern

The File Name Pattern field controls the name of each output file. The default value is:

{part_number}{format_extension}

The following variables are available for file name pattern:

VariableDescriptionExample
{date}Date of the sync in yyyy_MM_dd format2026_07_14
{date:yyyy_MM}Date of the sync in yyyy_MM format2026_07
{timestamp}Current wall-clock timestamp in milliseconds1752489045123
{part_number}File part number (0, 1, 2, ...)0
{sync_id}Unique ID of the sync101
{format_extension}File extension including compression suffix.csv.gz
note

Path format variables use the ${VARIABLE} syntax, while file name pattern variables use the {variable} syntax. Multiple / characters in the resolved path are collapsed into a single /.

Output Schema

Each stream will be outputted to its dedicated directory according to the configuration. The complete datastore of each stream includes all the output files under that directory. You can think of the directory as equivalent of a Table in the database world.

  • Under Full Refresh - Overwrite mode, old output files are deleted before new files are created.
  • Under Incremental - Append Sync mode, new output files will be added that only contain the new data.

Avro

Apache Avro serializes data in a compact binary format. Currently, the Airbyte GCS Avro connector always uses the binary encoding, and assumes that all data records follow the same schema.

Configuration

Here is the available compression codecs:

  • No compression
  • deflate
    • Compression level
      • Range [0, 9]. Default to 0.
      • Level 0: no compression & fastest.
      • Level 9: best compression & slowest.
  • bzip2
  • xz
    • Compression level
      • Range [0, 9]. Default to 6.
      • Level 0-3 are fast with medium compression.
      • Level 4-6 are fairly slow with high compression.
      • Level 7-9 are like level 6 but use bigger dictionaries and have higher memory requirements. Unless the uncompressed size of the file exceeds 8 MiB, 16 MiB, or 32 MiB, it is waste of memory to use the presets 7, 8, or 9, respectively.
  • zstandard
    • Compression level
      • Range [-5, 22]. Default to 3.
      • Negative levels are 'fast' modes akin to lz4 or snappy.
      • Levels above 9 are generally for archival purposes.
      • Levels above 18 use a lot of memory.
    • Include checksum
      • If set to true, a checksum will be included in each data block.
  • snappy

Data schema

Under the hood, an Airbyte data stream in Json schema is first converted to an Avro schema, then the Json object is converted to an Avro record. Because the data stream can come from any data source, the Json to Avro conversion process has arbitrary rules and limitations. Learn more about how source data is converted to Avro and the current limitations here.

CSV

With the CSV output, it is possible to normalize (flatten) the data blob to multiple columns.

ColumnConditionDescription
_airbyte_raw_idAlways exists.UUID assigned by Airbyte to the record.
_airbyte_extracted_atAlways exists.Time the record was extracted, in Unix epoch milliseconds.
_airbyte_metaAlways exists.Record metadata serialized as a JSON object.
_airbyte_generation_idAlways exists.Stream generation identifier associated with the record.
_airbyte_dataExists with no flattening.Source record serialized as a JSON object.
Source fieldsExist with root-level flattening.Top-level source fields are expanded into individual columns.

The schema for _airbyte_meta is:

FieldTypeDescription
sync_idintegerIdentifier of the sync job.
changesarrayChanges Airbyte made to the record while processing it.

The schema for a change object is:

FieldTypeDescription
fieldstringName of the field that changed.
changestringChange applied to the field, such as NULLED or TRUNCATED.
reasonstringReason for the change, including whether it originated in the source, destination, or platform.

For example, given the following json object from a source:

{
"user_id": 123,
"name": {
"first": "John",
"last": "Doe"
}
}

With no normalization, the output CSV is:

_airbyte_raw_id_airbyte_extracted_at_airbyte_meta_airbyte_generation_id_airbyte_data
26d73cde-7eb1-4e1e-b7db-a4c03b4cf2061622135805000{"sync_id":10111,"changes":[]}11{"user_id":123,"name":{"first":"John","last":"Doe"}}

With root level normalization, the output CSV is:

_airbyte_raw_id_airbyte_extracted_at_airbyte_meta_airbyte_generation_iduser_idname
26d73cde-7eb1-4e1e-b7db-a4c03b4cf2061622135805000{"sync_id":10111,"changes":[]}11123{"first":"John","last":"Doe"}

Output files can be compressed. In v1.0.0 and later, CSV output is GZIP-compressed by default (.csv.gz). Set format.compression.compression_type = "No Compression" for uncompressed .csv output.

JSON Lines (JSONL)

JSON Lines is a text format with one JSON object per line. Like CSV, JSONL supports "No flattening" and "Root level flattening". With no flattening, source fields are nested under _airbyte_data. With root-level flattening, source fields appear alongside the Airbyte metadata fields.

For example, given the following two JSON objects from a source:

[
{
"user_id": 123,
"name": {
"first": "John",
"last": "Doe"
}
},
{
"user_id": 456,
"name": {
"first": "Jane",
"last": "Roe"
}
}
]

With no flattening, the output file contains:

{"_airbyte_raw_id":"26d73cde-7eb1-4e1e-b7db-a4c03b4cf206","_airbyte_extracted_at":1622135805000,"_airbyte_meta":{"sync_id":10111,"changes":[]},"_airbyte_generation_id":11,"_airbyte_data":{"user_id":123,"name":{"first":"John","last":"Doe"}}}
{"_airbyte_raw_id":"0a61de1b-9cdd-4455-a739-93572c9a5f20","_airbyte_extracted_at":1631948170000,"_airbyte_meta":{"sync_id":10112,"changes":[]},"_airbyte_generation_id":12,"_airbyte_data":{"user_id":456,"name":{"first":"Jane","last":"Roe"}}}

Output files can be compressed. In v1.0.0 and later, JSONL output is GZIP-compressed by default (.jsonl.gz). Set format.compression.compression_type = "No Compression" for uncompressed .jsonl output.

Parquet

Configuration

The following configuration is available to configure the Parquet output:

ParameterTypeDefaultDescription
compression_codecenumUNCOMPRESSEDCompression algorithm. Available candidates are: UNCOMPRESSED, SNAPPY, GZIP, LZO, BROTLI, LZ4, and ZSTD.
block_size_mbinteger128 (MB)Block size (row group size) in MB. This is the size of a row group being buffered in memory. It limits the memory usage when writing. Larger values will improve the IO when reading, but consume more memory when writing.
max_padding_size_mbinteger8 (MB)Max padding size in MB. This is the maximum size allowed as padding to align row groups. This is also the minimum size of a row group.
page_size_kbinteger1024 (KB)Page size in KB. The page size is for compression. A block is composed of pages. A page is the smallest unit that must be read fully to access a single record. If this value is too small, the compression will deteriorate.
dictionary_page_size_kbinteger1024 (KB)Dictionary Page Size in KB. There is one dictionary page per column per row group when dictionary encoding is used. The dictionary page size works like the page size but for dictionary.
dictionary_encodingbooleantrueDictionary encoding. This parameter controls whether dictionary encoding is turned on.

These parameters are related to the ParquetOutputFormat. See the Java doc for more details. Also see Parquet documentation for their recommended configurations (512 - 1024 MB block size, 8 KB page size).

Data schema

Under the hood, an Airbyte data stream in Json schema is first converted to an Avro schema, then the Json object is converted to an Avro record, and finally the Avro record is outputted to the Parquet format. Because the data stream can come from any data source, the Json to Avro conversion process has arbitrary rules and limitations. Learn more about how source data is converted to Avro and the current limitations here.

Namespace support

This destination uses namespaces as part of the output directory structure. The stream namespace is included as a path component via the ${NAMESPACE} variable in the GCS Path Format. If a stream has no namespace configured, the namespace segment is omitted from the path.

Upgrading to 1.0.0

See the GCS Migration Guide for detailed upgrade instructions.

Performance

The connector uses tuned object-storage pipeline defaults and exposes no performance-tuning settings, matching the other Bulk-CDK object-storage destinations. Throughput scales with the destination pod's CPU/memory and — for SOCKET-mode syncs — with the source's read concurrency and the number of streams synced in parallel. In SOCKET mode the CDK sizes the socket count, part size, and upload parallelism from the negotiated CPU limits automatically.

Reference

Config fields reference

Field
Type
Property name
object
credential
object
format
string
gcs_bucket_name
string
gcs_bucket_path
string
file_name_pattern
string
gcs_bucket_region
string
gcs_path_format

Changelog

Expand to review
VersionDatePull RequestSubject
1.0.02026-07-1581376Migrate to the Bulk Load CDK for significantly higher throughput on large syncs through parallel, back-pressured multipart uploads and SOCKET/PROTOBUF data transfer with compatible sources. Streams larger than approximately 200 MB may produce multiple objects, CSV and JSONL output is GZIP-compressed by default, and Airbyte metadata field names change. See Upgrading to 1.0.0.
0.4.92025-03-2155906Use M4 Compatible base image.
0.4.82025-01-1051479Use a non root base image
0.4.72024-12-1849884Use a base image: airbyte/java-connector-base:1.0.0
0.4.62024-02-1535285Adopt CDK 0.20.8
0.4.52024-02-0834745Adopt CDK 0.19.0
0.4.42023-07-1428345Increment patch to trigger a rebuild
0.4.32023-07-0527936Internal code update
0.4.22023-06-3027891Internal code update
0.4.12023-06-2827268Internal code update
0.4.02023-06-2627725License Update: Elv2
0.3.02023-04-2825570Fix: all integer schemas should be converted to Avro longs
0.2.172023-04-2725346Internal code cleanup
0.2.162023-03-1723788S3-Parquet: added handler to process null values in arrays
0.2.152023-03-1023466Changed S3 Avro type from Int to Long
0.2.142022-11-2321682Add support for buckets with Customer-Managed Encryption Key
0.2.132023-01-1821087Wrap Authentication Errors as Config Exceptions
0.2.122022-10-1817901Fix logging to GCS
0.2.112022-09-0116243Fix Json to Avro conversion when there is field name clash from combined restrictions (anyOf, oneOf, allOf fields)
0.2.102022-08-0514801Fix multiple log bindings
0.2.92022-06-2414114Remove "additionalProperties": false from specs for connectors with staging
0.2.82022-06-1713753Deprecate and remove PART_SIZE_MB fields from connectors based on StreamTransferManager
0.2.72022-06-1413483Added support for int, long, float data types to Avro/Parquet formats.
0.2.62022-05-1712820Improved 'check' operation performance
0.2.52022-05-0412578In JSON to Avro conversion, log JSON field values that do not follow Avro schema for debugging.
0.2.42022-04-2212167Add gzip compression option for CSV and JSONL formats.
0.2.32022-04-2211795Fix the connection check to verify the provided bucket path.
0.2.22022-04-0511728Properly clean-up bucket when running OVERWRITE sync mode
0.2.12022-04-0511499Updated spec and documentation.
0.2.02022-04-0411686Use serialized buffering strategy to reduce memory consumption; compress CSV and JSONL formats.
0.1.222022-02-1210256Add JVM flag to exist on OOME.
0.1.212022-02-1210299Fix connection check to require only the necessary permissions.
0.1.202022-01-119367Avro & Parquet: support array field with unknown item type; default any improperly typed field to string.
0.1.192022-01-109121Fixed check method for GCS mode to verify if all roles assigned to user
0.1.182021-12-308809Update connector fields title/description
0.1.172021-12-218574Added namespace to Avro and Parquet record types
0.1.162021-12-208974Release a new version to ensure there is no excessive logging.
0.1.152021-12-038386Add new GCP regions
0.1.142021-12-017732Support timestamp in Avro and Parquet
0.1.132021-11-037288Support Json additionalProperties.
0.1.22021-09-125720Added configurable block size for stream. Each stream is limited to 10,000 by GCS
0.1.12021-08-265296Added storing gcsCsvFileLocation property for CSV format. This is used by destination-bigquery (GCS Staging upload type)
0.1.02021-07-164329Initial release.