A.S.K. Quick Start
Streambased Analytics Service for Kafka (A.S.K.) provides a database-like view over Kafka data. Using A.S.K., Kafka data can be accessed from industry standard tools such as Tableau, PowerBI, Superset and Dbt. This demo creates an ultra simple Streambased/Kafka environment and solves a simulated problem with it.
Step 1: Clone the streambased-demos repository
Streambased publishes a number of public demos. We will use one of these for our quickstart. Begin by cloning the repository:
git clone [email protected]:streambased-io/streambased-demos.git
Step 2: Start the environment
Start the environment by running the below:
./bin/start.sh 3_black_box
You will see the following services started:
kafka1, zookeeper and schema-registry - A Kafka based operational environment
shadowtraffic - A data generator
streambased-server - A Streambased instance providing the analytical view of the Kafka data
superset - An analytical client and visualisation tool that can work with Streambased
akhq - An operational tool for Kafka observability
Step 3: Open Superset
From a browser navigate to http://localhost:8088
Log in with credentials:
username: admin
password: admin
Navigate to SQL -> SQL Lab
Select Streambased
from the database dropdown and select default
from the schema dropdown
Step 4: Use Streambased to investigate
This demo simulates a typical operational use case in Kafka, we are simulating a Shopify style retail company where users host shops for their goods on our platform. Our investigation begins with a support ticket raised from store id: ZZ-123, they are claiming not to have received payments for items sold.
Let's look at transactions for this store:
SELECT *
FROM transactions
WHERE storeid='ZZ-123';
Step 5: Investigate further
Something's clearly not right here. All the transactions for our store have a zero amount. That's not valid and probably why the payment processing is failing.
Let's take a look at the payment terms associated with our shop's transactions. To do this we will join the transactions and payment_terms topics:
SELECT *
FROM transactions t
JOIN payment_terms p
ON t.paymenttermcode = p.termcode
WHERE t.storeid='ZZ-123'
Step 6: Confirm the issue
Here we can clearly see the problem! The exchangerate column shows a huge value meaning it's likely that any currency conversion will result in a zero amount. However, we have not yet determined the scope of the problem, does it only affect ZWD
or are other payment codes affected? We can check the total amount of sales for each code to confirm:
SELECT paymentTermCode, sum(amount)
FROM transactions
GROUP BY paymentTermCode
That confirms it, this is clearly an anomaly as only ZWD
shows a zero total. We can now take immediate action, most likely suspending sales in ZWD.
Step 7: Shutting down
To stop the environment run:
./bin/stop.sh
What's next?
This short demo is only one example of Streambased technology, check out the other demos for more.
Last updated