What's new in CloudQuery Go SDK v4
Summary of CloudQuery Go SDK v4 changes and features
Yevgeny Pats • Jul 10, 2023
We are thrilled to announce the release of the new Go SDK v4, which brings exciting enhancements to writing CloudQuery plugins in Go!
The new Go SDK v4 version utilizes the gRPC plugin protocol version v3, so be sure to check What's new in CloudQuery Plugin Protocol v3.
Let's begin with a high-level summary before diving deeper into each of the updates:
- Apache Arrow - Given that the underlying protocol is all about Arrow, the Go SDK also speaks Arrow and utilizes the Apache Arrow Go for data and data types.
- Unified API for Sources and Destinations - Similar to the underlying gRPC protocol, the Go SDK now contains only one Plugin API, which enables CloudQuery plugins to function as both a source and a destination simultaneously.
- Transition Sync/Write to Streaming API - Similar to the underlying protocol, the SDK has also transitioned the
Writemethods to a streaming-based API, enabling new use cases like Change Data Capture (CDC).
We extensively discussed this update in our previous blog post. Now, with all our destinations migrated to SDK V4, they support over 30 different Apache Arrow data types!
Plugins can now serve as both sources and destinations, and they have a single entry point:
plugins.NewPlugin. Plugin authors can choose to implement only
Syncfunctionality or only
Another big advantage, as mentioned in What's new in CloudQuery Plugin Protocol v3, is the ability to use any destination as a backend for incremental syncs.
Similar to the underlying protocol's supported messages for
Write, the Go SDK messages are defined in plugin-sdk/message.
With this change to streaming that contains messages, we can easily extend the protocol in a backward-compatible way to support more messages like
DeleteRecord, to support use cases such as CDC or other use cases that require those kinds of data updates.
There are a few things to consider when migrating, but for the most part, it will be just a syntactic change.
Go is not a great language for frameworks, so we made the Plugin SDK lightweight and moved other heavy functionality to its own sub-packages, which makes it easier to extend and test.
schedulers- Schedulers now live under plugin-sdk/scheduler.
writers- Writers now live under plugin-sdk/writers.
message- All messages for
Writeare under plugin-sdk/message.
If you are migrating sources, take a look at our