Skip to content

Instantly share code, notes, and snippets.

@gwenshap
gwenshap / Getting Started with Nile - Java.md
Created October 22, 2023 03:45
Script for Getting Started in Java Tutorial

Getting Started with Nile - Java

Hey everyone, I'm Gwen from Nile. Nile is a Serverless Postgres for building modern SaaS. SaaS applications are multi-tenant, and Nile provides tenant virtualization - the ability to create and access tenant databases anywhere in the world, but with the simplicity of a single DB.

In this tutorial, I'll show how I build a simple SaaS using Nile together with Spring Boot. You'll see how tenant virtualization makes it simpler. I'm going to start by showing you how to setup and run the example application. Then I'll go over the example and explain the code behind it, so you'll learn how to use Nile in your applications too. Lets do it!

First things first, lets sign in to Nile and create a database. We'll use the default name. And because Nile is serverless Postgres, it takes just one click to create a database.

Now note that the database already has a [00:01:00] tenants table. This is what we call built in tables. And because tenants are such an important concept to every S

Keybase proof

I hereby claim:

  • I am gwenshap on github.
  • I am gwenshap (https://keybase.io/gwenshap) on keybase.
  • I have a public key ASA6QIPAA26JR4LZ8YgwJlvFITKg7MIv8QOEp4BAoKyH0go

To claim this, I am signing this object:

@gwenshap
gwenshap / community_content.md
Created February 21, 2022 18:01
Community Content Ideas

Collecting ideas for youtube, podcasts, perhaps even meetups (Zoom conversations and/or twitter spaces). Feel free to add a PR with your idea or to ping me and volunteer to talk about an existing idea. I'll add links here once the podcast is out there.

  • What makes a great engineering culture, and why this is critical for early-stage companies. Maybe how culture evolves over time and how to intentionally modify culture.
  • Platforms and how the concept evolved over time. What is a modern platform? Why are they important? What makes a great platform?
@gwenshap
gwenshap / #inspiration_links
Last active February 21, 2022 18:47
#inspiration links
@gwenshap
gwenshap / #invite
Last active February 2, 2022 01:16
Invite Flow
State diagram and snippets for invite flow
@gwenshap
gwenshap / gist:0bf0154c453b82a94a997def7588e44f
Created May 28, 2021 22:38
Complication errors after bumping Clickstream Enrichment example from 0.10.2 to 2.8.0
[WARNING] COMPILATION WARNING :
[INFO] -------------------------------------------------------------
[WARNING] /Users/gwenshap/workspaces/kafka-clickstream-enrich/src/main/java/com/shapira/examples/streams/clickstreamenrich/ClickstreamEnrichment.java: /Users/gwenshap/workspaces/kafka-clickstream-enrich/src/main/java/com/shapira/examples/streams/clickstreamenrich/ClickstreamEnrichment.java uses or overrides a deprecated API.
[WARNING] /Users/gwenshap/workspaces/kafka-clickstream-enrich/src/main/java/com/shapira/examples/streams/clickstreamenrich/ClickstreamEnrichment.java: Recompile with -Xlint:deprecation for details.
[WARNING] /Users/gwenshap/workspaces/kafka-clickstream-enrich/src/main/java/com/shapira/examples/streams/clickstreamenrich/GenerateData.java: /Users/gwenshap/workspaces/kafka-clickstream-enrich/src/main/java/com/shapira/examples/streams/clickstreamenrich/GenerateData.java uses unchecked or unsafe operations.
[WARNING] /Users/gwenshap/workspaces/kafka-clickstream-enrich/src/main/java/com/shapira/
@gwenshap
gwenshap / gist:1d4477d3e54b732ab04c06474d2fb4c0
Last active July 11, 2019 03:22
Kinda old demo of the use of Confluent Cloud to bridge AWS and GCP. With C3 and KSQL and stuff!
# Apache Kafka ecosystem “as a service” on GCP with Confluent Cloud
Gwen Shapira <[email protected]>
v0.01, 9 Jun 2018
## Setup: 24h prior to demo
* Make sure you have a user on https://confluent.cloud with 2 clusters, one on AWS and one on GCP
* Make sure you have ccloud cli on your laptop
Create JSON consumer:
curl -X POST -H "Content-Type: application/vnd.kafka.v2+json" --data '{"name": "my_consumer_instance", "format": "JSON", "auto.offset.reset": "earliest"}' http://localhost:8082/consumers/my_json_consumer
{"instance_id":"my_consumer_instance", "base_uri":"http://localhost:8082/consumers/my_json_consumer/instances/my_consumer_instance"}
Subscribe consumer to a topic:
curl -X POST -H "Content-Type: application/vnd.kafka.v2+json" --data '{"topics":["jsontest"]}' http://localhost:8082/consumers/my_json_consumer/instances/my_consumer_instance/subscription
Consume:
curl -X GET -H "Accept: application/vnd.kafka.json.v2+json" http://localhost:8082/consumers/my_json_consumer/instances/my_consumer_instance/records
echo '{"name":"s3-sink-json-1", "config":{"connector.class":"io.confluent.connect.s3.S3SinkConnector", "topics":"mysql.login", "flush.size":1, "format.class":"io.confluent.connect.s3.format.json.JsonFormat","s3.bucket.name":"gwen-s3-test","storage.class":"io.confluent.connect.s3.storage.S3Storage","schema.generator.class":"io.confluent.connect.storage.hive.schema.DefaultSchemaGenerator","partitioner.class":"io.confluent.connect.storage.partitioner.DefaultPartitioner"}}' | curl -X POST -d @- http://localhost:8083/connectors --header "content-Type:application/json"
@gwenshap
gwenshap / gist:32be0fc68b8a422a3f4917e512d31386
Created March 24, 2017 20:17
validate connector with json tool
curl -X PUT -d "{\"connector.class\":\"JdbcSourceConnector\",\"connection.url\":\"jdbc:mysql://127.0.0.1:3306/test?user=root\",\"mode\":\"timestamp\", \"table.whitelist\":\"login\", \"validate.non.null\":false, \"timestamp.column.name\":\"login_time\", \"topic.prefix\":\"mysql.\", \"transforms\":\"InsertSource\", \"transforms.InsertSource.type\":\"org.apache.kafka.connect.transforms.InsertField\$Value\", \"transforms.InsertSource.static.field\":\"data_source\", \"transforms.InsertSource.static.value\":\"MyLocalMySQL\"}" localhost:8083/connector-plugins/JdbcSourceConnector/config/validate --header "content-Type:application/json" | python -m json.tool