This is my tech workbook. Please visit https://ojitha.blogspot.com.au for my official Tech blog.

Kafka PySpark streaming example

July 18, 2023

The diagram shows that the Kafka producer reads from Wikimedia and writes to the Kafka topic. Then Kafka Spark consumer pulls the data from the Kafka topic and writes the steam batches to disk.

arcitecture of the streaming application

More…

Terraform For each iteration

July 8, 2023

This is to explain Terraform for each looping technique. In this example, 3 buckets are created to demonstrate the looping idea.

create 3 S3 buckets

In the first step, we will create the above 3 buckets starting from 0.

More…

Spark to create a table in AWS Redshift

June 13, 2023

In this post, Spark reads the data from a CSV file to a DateFrame and saves that DataFrame as a Redshift table.

Spark to Redshift

In addition to that, I’ve explained how to create a table in Postgres, use Jupyter magics and plot a diagram.

More…

Spark Kafka Docker Configuration

June 9, 2023

This is the continuation of the Spark Streaming Basics. I explained the basic stream example, which runs only on one AWS Glue container. The stream producer was Netcat, and the sink was a text file. In this post, the stream producer is still Netcat, but the sink is Kafka. Both Kafka and Spark running on Docker containers.

Simple Streaming with Spark and Kafka

More…

Spark Streaming Basics

June 9, 2023

This is a very basic example created to explain Spark streaming. Spark run on the AWS Glue container locally.

More…