Raghu Profile picture
23 Oct, 8 tweets, 3 min read
1/ Everyone understands the power of APIs. But what happens when a Database gets an API? #AWS #Redshift got one recently and it opens up plenty of new use cases. A thread 👇
2/ Until September 2020, Redshift required clients to use JDBC/ODBC based connections through the drivers it provided. But that changed when the Data API was introduced. With Data API, you can now fire SQL queries through a simple HTTPS endpoint docs.aws.amazon.com/redshift/lates…
3/ You can use the familiar IAM based auth and this API is integrated in AWS SDKs. Which means you can now programmatically run SQL queries just like invoking any AWS API. You simply invoke the “execute-statement” API by providing the SQL query and get an execution id in response
4/ The Data API also works in async mode where query results are automatically stored for a period of 24 hours. You can poll if your query finished execution and then invoke the “get-statement-result” API to get the query results
5/ Now you can start imagining various use cases that can be easily solved. A file arrives in S3 -> a Lambda function gets called -> load data into Redshift by invoking copy command through Data API. How about running a scheduled sales report every day?
6/ With the “Scheduled Queries” feature,Redshift now integrates with AWS #EventBridge where you can configure a query to be run periodically through a cron expression. This can be configured right within the Redshift mgmt console. docs.aws.amazon.com/redshift/lates…
7/ Here’s a pipeline to send a daily sales report: EventBridge triggers query execution->query runs in Redshift->get notification in a SNS topic on query completion->run Lambda to generate a report from results->send report in an email
8/ A lot of use cases can be automated using the Data API and Scheduled Queries. Executing long running queries, periodically unloading data from Redshift to Data Lake, Refreshing external schema for Spectrum

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Raghu

Raghu Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!