This repository contains a demo of Ambar, a data streaming service for mission-critical applications that takes only 15 minutes to set up. Fork the repository, deploy it, and within 15 minutes you will see what you can build using Ambar.
Requirements
- A GitHub Account
- A Web Browser
- A Secret String (from the Ambar team)
- A Code Editor (optional)
Not required
- Infrastructure (Ambar provides it)
Table of Contents
- Introduction
- What Will You Do In This Demo?
- Deploy Two Data Streaming Applications
- Visit the Front-End
- Create New Features
- Conclusion
Data streaming is critical for businesses operating in real time. However, data streaming has always been challenging and costly to implement and maintain. Ambar changes that, as a fully managed data streaming service designed for correctness, performance, and convenience. With just a few lines of code and configuration, Ambar allows anyone to have world-class data streaming capabilities in minutes.
How does Ambar work?
With Ambar, your code doesn't interact with messaging infrastructure (e.g., produce to / consume from Kafka, RabbitMQ, SQS, etc). Instead, Ambar pulls records from databases and pushes records to HTTP endpoints.
To use Ambar, you provide three things:
- Data Sources: durable storage containing record streams, i.e., a database table.
- Filters: logical specifications that select subsets of records from data sources.
- Data Destinations: HTTP endpoints in your application that will process your record streams.
In this demo, you will see how little effort it takes to deploy data streaming applications that are both correct and performant. Your first goal will be to deploy the demo's two data streaming applications. We've preloaded your first deployment with a database (a data source) and an HTTP server (a data destination) connected with Ambar. Your second and final goal will be to update the code to release two new features.
To accomplish your goals, you will:
- Deploy two data streaming applications by forking this repository (Section 3).
- Visit your front-end to see data streams being echoed in real time (Section 4).
- Create new features in your applications (Section 5).
To deploy your first two data streaming applications (a credit card application, and a shipping application):
- Fork this repository in GitHub, by clicking
Fork
in the top right corner. Navigate to your new repository, and continue reading these instructions there. - Add the secret
GH_ACTION_SECRET
to your repository's secrets with the contents provided by Ambar's team. You can add the secret by clickingSettings
in your repository's homepage (top of page). Next, underSecrets and Variables
clickActions
. Add the secret as aRepository Secret
calledGH_ACTION_SECRET
. - Click
Actions
in your repository's menu (top of the page). If GitHub Actions are enabled for your account, you should be able to see an empty list ofworkflows
). If GitHub Actions are not enabled, please follow the prompts in thisActions
page to enable GitHub Actions. - Add a new empty line to the bottom of this
README.md
, and commit the change into your repository'smain
branch. - Return to
Actions
in your repository's menu (top of page). A GitHub Actionworkflow
will have just triggered which deploys your first two data streaming applications! Click the latestworkflow
. You should see a page with twojobs
,Backend and Frontend
andAmbar
. - Wait for the
workflow
Status to change toSuccess
. IMPORTANT: If the Status remainsQueued
instead ofIn Progress
for longer than 3 minutes, you've run into a GitHub bug for new repositories. Cancel theworkflow
in the top-right corner menu, and once canceled clickRe-run all jobs
(also in the top-right corner menu).
To see your applications:
- While in the
workflow
page (the same one as in Section 3, Step 6), open theBackend and Frontend
job. - Open the step
Print Front-End Domain
. - Visit the site under
Print Front-End Domain
in your browser to see real time updates happening in both the credit card and shipping applications. IMPORTANT: Events are processed in order per partition key and with exactly once semantics.
Congratulations! You deployed two data streaming applications with Ambar.
Next, you'll deploy two new features, one for each application.
The first feature will process the credit card event stream and flag transactions which are potentially fraudulent. To deploy this feature, perform the following steps:
- Uncomment the Ambar resource definitions (delete all
/*
and*/
) in the fileterraform/ambar_credit_card.tf
. - Uncomment the http endpoint definitions (delete all triple single quotes,
'''
) in the filebackend/server/credit_card.py
. - Commit your changes into the
main
branch of your repository. - Click
Actions
in your repository's menu (top of the page), and wait for the latestworkflow
to complete. If the status remainsQueued
instead ofIn Progress
, for longer than 3 minutes, repeat the steps in Section 3, Step 6 to restart theworkflow
. - Refresh the front-end domain in your browser, and revisit the credit card application to see the
new
Credit Card - Fraud Case Manager
you just built!
The second feature will process the shipping event stream and select returned shipments and the reason for return.To deploy this feature, perform the following steps:
- Uncomment the Ambar resource definitions (delete all
/*
and*/
) in the fileterraform/ambar_shipping.tf
. - Uncomment the http endpoint definitions (delete all triple single quotes,
'''
) in the filebackend/server/shipping.py
. - Commit your changes into the
main
branch of your repository. - Click
Actions
in your repository's menu (top of the page), and wait for the latestworkflow
to complete. If the status remainsQueued
instead ofIn Progress
, for longer than 3 minutes, repeat the steps in Section 3, Step 6 to restart theworkflow
. - Refresh the front-end domain in your browser, and revisit the shipping application to see the
new
Shipping - Returns Resolution Center
you just built!
You've seen first hand how Ambar is able to radically simplify the development and deployment of data
streaming applications. First, you deployed two data streaming applications by using Ambar to connect data sources
(preloaded PostgreSQL database) to data destinations
(http endpoints written in Python).
Second, you added features to your applications, by using Ambar to connect existing data sources
to two new
data destinations
.
In just minutes, you deployed applications that processed streams of events in real time, with zero errors. All of this without a single line of code that wasn't business logic. This just scratches the surface of what Ambar is capable of. If you're interested in learning more about how Ambar can help your business benefit from real time, error free data streaming, let the Ambar team know.