MCPcopy Index your code
hub / github.com/databricks/zerobus-sdk

github.com/databricks/zerobus-sdk @jni-v1.0.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release jni-v1.0.1 ↗ · + Follow
1,341 symbols 5,012 edges 124 files 490 documented · 37%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Zerobus SDKs

Monorepo for Databricks Zerobus Ingest SDKs.

Disclaimer

GA: This SDK is generally available and supported for production use cases. Minor and patch version updates will not contain breaking changes. Major version updates may include breaking changes.

We are keen to hear feedback from you. Please file issues, and we will address them.

What is Zerobus?

Zerobus is a high-throughput streaming service for direct data ingestion into Databricks Delta tables, optimized for real-time data pipelines and high-volume workloads.

SDKs

Language Directory Package
Rust rust/ databricks-zerobus-ingest-sdk
Python python/ databricks-zerobus-ingest-sdk
Go go/ github.com/databricks/zerobus-sdk/go
TypeScript typescript/ @databricks/zerobus-ingest-sdk
Java java/ com.databricks:zerobus-ingest-sdk

Platform Support

We try to provide prebuilt native binaries for the following platforms:

Platform Architecture
Linux x86_64
Linux aarch64
Windows x86_64
macOS x86_64
macOS aarch64 (Apple Silicon)

Note: We do not currently have macOS CI runners, so macOS binaries are built locally and may not be available for every SDK or release. If your platform is not supported or you encounter compatibility issues, you can build from source or file an issue.

Prerequisites

Before using any SDK, you need the following:

1. Workspace URL and Workspace ID

After logging into your Databricks workspace, look at the browser URL:

https://<databricks-instance>.cloud.databricks.com/o=<workspace-id>
  • Workspace URL: The part before /o= (e.g., https://dbc-a1b2c3d4-e5f6.cloud.databricks.com)
  • Workspace ID: The part after /o= (e.g., 1234567890123456)

Note: The examples above show AWS endpoints (.cloud.databricks.com). For Azure deployments, the workspace URL will be https://<databricks-instance>.azuredatabricks.net.

2. Create a Delta Table

Create a table using Databricks SQL:

CREATE TABLE <catalog_name>.default.<table_name> (
    device_name STRING,
    temp INT,
    humidity BIGINT
)
USING DELTA;

Replace <catalog_name> with your catalog name (e.g., main).

3. Create a Service Principal

  1. Navigate to Settings > Identity and Access in your Databricks workspace
  2. Click Service principals and create a new service principal
  3. Generate a new secret for the service principal and save it securely
  4. Grant the following permissions:
  5. USE_CATALOG on the catalog (e.g., main)
  6. USE_SCHEMA on the schema (e.g., default)
  7. MODIFY and SELECT on the table

Grant permissions using SQL:

-- Grant catalog permission
GRANT USE CATALOG ON CATALOG <catalog_name> TO `<service-principal-application-id>`;

-- Grant schema permission
GRANT USE SCHEMA ON SCHEMA <catalog_name>.default TO `<service-principal-application-id>`;

-- Grant table permissions
GRANT SELECT, MODIFY ON TABLE <catalog_name>.default.<table_name> TO `<service-principal-application-id>`;

The service principal's Application ID is your OAuth Client ID, and the generated secret is your Client Secret.

Serialization Formats

All SDKs support two serialization formats:

  • JSON - Simple, schema-free ingestion. Pass a JSON string or native object (dict, map, etc.) and the SDK serializes it. No compilation step required. Good for getting started or dynamic schemas.
  • Protocol Buffers - Strongly-typed, schema-validated ingestion. More efficient over the wire. Recommended for production workloads.

Protocol Buffers

Use proto2 syntax with optional fields to correctly represent nullable Delta table columns.

Delta → Protobuf Type Mappings

Delta Type Proto2 Type
TINYINT, BYTE, INT, SMALLINT, SHORT int32
BIGINT, LONG int64
FLOAT float
DOUBLE double
STRING, VARCHAR string
BOOLEAN bool
BINARY bytes
DATE int32
TIMESTAMP, TIMESTAMP_NTZ int64
ARRAY\<type> repeated type
MAP\<key, value> map\<key, value>
STRUCT\<fields> nested message
VARIANT string (JSON string)

Schema Generation

Instead of writing .proto files by hand, each SDK ships a tool to generate protobuf schemas directly from an existing Unity Catalog table. See the individual SDK READMEs for language-specific usage.

HTTP Proxy Support

All SDKs support HTTP CONNECT proxies via environment variables, following gRPC core conventions. The first variable found (in order) is used:

Proxy No-proxy
grpc_proxy / GRPC_PROXY no_grpc_proxy / NO_GRPC_PROXY
https_proxy / HTTPS_PROXY no_proxy / NO_PROXY
http_proxy / HTTP_PROXY

The no_proxy value is a comma-separated list of hostnames (suffix-matched) or * to bypass the proxy entirely.

export https_proxy=http://my-proxy:8080
export no_proxy=localhost,127.0.0.1

The SDK establishes a plaintext HTTP CONNECT tunnel through the proxy, then performs a TLS handshake end-to-end with the Databricks server. The proxy never sees decrypted traffic.

Contributing

See CONTRIBUTING.md. Each SDK also has its own contributing guide with language-specific setup instructions.

License

This project is licensed under the Databricks License. See LICENSE for the full text.

Extension points exported contracts — how you extend this code

AckCallback (Interface)
Callback trait for receiving acknowledgment notifications. Implement this trait to receive callbacks when records/batch [5 …
rust/sdk/src/callbacks.rs
AckCallback (Interface)
Callback interface for receiving acknowledgment notifications from the Zerobus stream. This interface provides metho [2 …
java/src/main/java/com/databricks/zerobus/AckCallback.java
HeadersProvider (Interface)
(no doc) [3 implementers]
typescript/src/headers_provider.ts
AirQuality (Interface)
* AirQuality record structure matching the table schema: * - device_name: STRING * - temp: INT * - humidity: BIGINT
typescript/examples/json/batch.ts
HeadersProvider (Interface)
HeadersProvider is an interface for providing custom authentication headers. Implement this interface to provide custom
go/zerobus.go
LoadDescriptorOptions (Interface)
(no doc)
typescript/utils/descriptor.ts
HeadersProvider (Interface)
(no doc) [3 implementers]
rust/sdk/src/headers_provider.rs
JsonSerializer (Interface)
A functional interface for JSON serialization. This interface allows using any JSON serialization library (Gson, Jac
java/src/main/java/com/databricks/zerobus/ZerobusJsonStream.java

Core symbols most depended-on inside this repo

build
called by 111
rust/sdk/src/builder/sdk_builder.rs
endpoint
called by 105
rust/sdk/src/builder/sdk_builder.rs
unity_catalog_url
called by 104
rust/sdk/src/builder/sdk_builder.rs
tls_config
called by 96
rust/sdk/src/builder/sdk_builder.rs
create_stream_with_headers_provider
called by 80
rust/sdk/src/lib.rs
waitForOffset
called by 71
java/src/main/java/com/databricks/zerobus/BaseZerobusStream.java
ingest_record
called by 59
rust/sdk/src/lib.rs
throw_zerobus_exception
called by 55
rust/jni/src/errors.rs

Shape

Method 686
Function 441
Class 142
Struct 37
Interface 18
Enum 14
TypeAlias 3

Languages

Rust48%
Go18%
Java15%
Python15%
TypeScript2%
C++1%

Modules by API surface

go/tests/pb/zerobus_service.pb.go124 symbols
python/tests/test_generate_proto.py92 symbols
rust/tests/src/rust_tests.rs91 symbols
rust/sdk/src/record_types.rs59 symbols
typescript/src/lib.rs44 symbols
rust/ffi/src/lib.rs41 symbols
rust/sdk/src/lib.rs37 symbols
python/tests/test_smoke.py27 symbols
python/rust/src/async_wrapper.rs27 symbols
rust/sdk/src/arrow_stream.rs26 symbols
python/rust/src/sync_wrapper.rs26 symbols
java/src/main/java/com/databricks/zerobus/tools/GenerateProto.java26 symbols

For agents

$ claude mcp add zerobus-sdk \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page