Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

content: pull from kafka #1180

Merged
merged 3 commits into from
Nov 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/components/AllPageNotice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { CloseIcon } from '@chakra-ui/icons';
import {
Box,
Heading,
Link,
LinkProps,
Slide,
Text,
TextProps,
Expand All @@ -22,6 +24,7 @@ interface AllPageMessage {
const components = {
p: (props: TextProps): JSX.Element => <Text m={1} color="white" {...props} />,
h1: Heading,
a: (props: LinkProps): JSX.Element => <Link textDecoration="underline" {...props} />,
Heading,
code: CodeBlock,
};
Expand Down
4 changes: 2 additions & 2 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default {
},
// Controls global message shown on homepage.
allPageMessage: {
message: `❄️ Latest: Snowflake customers &mdash; stream your data to Postgres! **[Learn more](/blog/snowflake-push-postgres)**! 🐘`,
except: ['/blog/snowflake-push-postgres', '/get-started'],
message: `❄️ Latest: Snowflake customers &mdash; Learn how to [connect Snowflake **everything**](/for/snowflake)! ❄️`,
except: ['/for/snowflake', '/get-started'],
},
};
57 changes: 43 additions & 14 deletions src/content/blog/snowflake-pull-kafka.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Real-Time Data Ingestion from Kafka to Snowflake
codetour: true
category: Learning
date: '2024-10-10'
date: '2024-11-10'
description: Setup a private point-to-point data stream from Kafka to Snowflake.
image: /blog/snowflake-pull-kafka/cover.png
author: Glenn Gillen
Expand All @@ -17,19 +17,26 @@ featuredOrder: 7
{/* <!-- vale Microsoft.Contractions = NO --> */}


In today's data-driven world, organizations are constantly seeking ways to harness
the power of real-time data for analytics and decision-making. Apache Kafka has
emerged as a powerhouse for handling high-volume, real-time data streams, while
Snowflake offers unparalleled capabilities for data warehousing and analytics.

What if you could seamlessly combine the strengths of both platforms in less
than 15 minutes, without the headaches of managing IP allow
lists, opening firewall ports, or navigating the complexities of services like
PrivateLink?
If your business is using Kafka there is already _a lot_ of
messages travelling through your brokers. If you're also a Snowflake customer it would be
great if those messages could make their way into your Snowflake data cloud.
Kafka is in your private network, Snowflake in their cloud, and getting data
between them isn't entirely straight-foward. It'd be much easier if those
two systems could look and feel like they were next to each other.

Today, we're excited to introduce a solution that makes this vision a reality:
the Pull from Kafka Connector!

<AspectRatio maxW="50%" ratio={16 / 9}>
<iframe
src="https://www.youtube.com/embed/9rjU2JNyXYw?si=_gxtof2XN_7P6rgK"
title="Consume messages from kafka topics direct to your Snowflake tables"
frameBorder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowFullScreen
></iframe>
</AspectRatio>

## Snowflake 💙 Apache Kafka

Apache Kafka (and Kafka-compatible alternatives) is the system of choice for building
Expand Down Expand Up @@ -513,22 +520,44 @@ pull data through to our private Kafka broker.

![Snowflake push to Kafka setup complete](/blog/snowflake-push-kafka/aws-complete.png)

## Next steps
## Seeing it in action

Any updates to your data in your Kafka topic will now create a new row in your Snowflake table.
Any updates to your data in your Kafka topic will now create a new row in your
Snowflake table.

Post the below message to the Kafka topic to verify the setup.

Replace `$BROKER_ADDRESS` with your actual Kafka broker address, and ensure the topic name (customers in this example) matches the one you've configured in your Snowflake Pull from Kafka Connector setup
Replace `$BROKER_ADDRESS` with your actual Kafka broker address, and ensure the
topic name (`customers` in this example) matches the one you've configured in
your Snowflake Pull from Kafka Connector setup

```bash
echo '{"key": "customer123", "id": 1001, "name": "John Doe", "email": "john.doe@example.com"}' | \
kafka-console-producer --broker-list $BROKER_ADDRESS:9092 --topic customers
```
The Snowflake connector will then pull these messages from Kafka and insert them into your CUSTOMERS table, mapping the JSON fields to the corresponding columns.
The Snowflake connector will then pull these messages from Kafka and insert them
into your `CUSTOMERS` table, mapping the JSON fields to the corresponding
columns.

## Wrap up

It's all done! In the course of a few minutes we've been able to:

* Setup an Ockam node next to our Kafka broker.
* Start an Ockam node within Snowflake.
* Establish an Ockam Portal between our nodes &mdash; a secure point-to-point
connection that is mutually authenticated with end-to-end encryption. With
regular and automatic rotation of the encryption keys.
* Then use the secure portal to consume messages from our private Kafka broker
and load them directly into a Snowflake table.

We've been able to achieve all of this without the need to expose our Kafka
broker to the public internet, update firewall ingress rules, setup a VPN,
or manage IP allow lists.

If you'd like to explore some other capabilities of Ockam I'd recommend:

* [Encrypting data _through_ Kafka](https://docs.ockam.io/portals/kafka)
* [Pushing data from Snowflake to Kafka](/blog/snowflake-push-kafka)
* [Zero-trust data streaming with Redpanda Connect](/blog/redpanda_connect_with_ockam#connect-secure-and-streamall-in-one-simple-platform)
* [Adding security as a feature in your SaaS product](/blog/building-secure-saas-platforms)
Loading