Monday, June 12, 2023
Database replication using Confluent (Kafka) and Debezium
Friday, May 5, 2023
Migrating IBM DB2 to Google Bigtable and achieving FIPS compliance encryption using Java custom encryption library
This is about a project I undetook recently, the purpose was to migrate large volume of on-prem db2 data to google bigtable using DataProc, a spark based solution on Google Cloud, a few things that are notable from the project:
1. I have to use SCALA to develop the solution due to the fact that the encryption libary was developed in Java and althoguh it has interoperativity to Python, it does have lot of limitation which stoped me from using Python... on the other hand, SCALA and JAVA just work together seamlessly.
2. for FIPS compliance, I have to use bouncecastle library, which introduces issues in managing dependencies, "dependency hell" as some named it, at then end I have to use mevan to manage dependencies and shade sbt due to the complexity.
3. I used hbase-spark connector for talking to bigtable, Since I am using spark 3, I have to complied the connector libaray manually, see https://github.com/apache/hbase-connectors/tree/master/spark
(this project was done about a year ago)
Handling Large Messages With Apache Kafka
While working on handling large messages with Kafka, I came across a few useful reference articles, bookmarking here for anyone who needs them:
https://dzone.com/articles/processing-large-messages-with-apache-kafka
https://www.morling.dev/blog/single-message-transforms-swiss-army-knife-of-kafka-connect/
https://www.kai-waehner.de/blog/2020/08/07/apache-kafka-handling-large-messages-and-files-for-image-video-audio-processing/
https://docs.confluent.io/cloud/current/connectors/single-message-transforms.html#cc-single-message-transforms-limitations
Tuesday, April 4, 2023
Object Tracking Demo
Thursday, December 1, 2022
The hidden cost of using a metadata driven ingestion framework
I came across a few implementations of metadata driven ELT/ETL frameworks, designed and developed by some big consulting firms, perhaps great minds think alike, they all use hashed values to detect changed records, to be able to avoid duplication and insert changes, this indeed saves a lot of effort and simplify the design.
However one of the major drawbacks of this approach is that often this makes optimization impossible, for example in delta lake, use merge into statement based on the hashed key makes the operation extremely expensive. this will make partioning not useful or possible, often ended up high running cost.
It will probably make more sense to also define a partition key, zorder columns plus key columns used to identity uniqueness in the metadata, so the delta tables will be created using the optional partition key and zorder columns, then update the merge into statement to use join conditions based on the key columns so it will be able to do parition proning at least, usually the partition key should be part of the key columns and in most cases is a date column , optionally defining the zorder columns to be the business key etc will also help.
Sunday, May 8, 2022
Configure Snowflake with External oAuth using Azure AD and device flow with MFA
Following the article at https://docs.snowflake.com/en/user-guide/oauth-azure.html and https://community.snowflake.com/s/article/How-To-Test-Azure-OAuth-Connection-To-Snowflake-End-To-End-Using-Python-User-Credentials-Flow, it is possible to implement a password flow for authenticating to snowflake using user's own credentials and assume roles they have been granted access to. however this hit an issue with MFA, unless you trusted the ip range of sagemaker this will not work.
To work around this issue, one can enable the public client feature ont he Azure AD client App and use msal to implement device flow instead. please refer to https://github.com/Azure-Samples/ms-identity-python-devicecodeflow for the sample code.
Wednesday, January 12, 2022
spark + jupyter notebook on ubuntu
Step 1: download spark from https://spark.apache.org/downloads.html
Step 2: unzip
$ tar zxvf ../spark-3.x.x.tar.gz
Step 3: setup bash by adding the following t~/.bashrc
export SPARK_HOME=/opt/spark
export PATH=$SPARK_HOME/bin:$PATHStep 4: install jupyter notebook:
$ pip install jupyterStep 5: Start Spark: $ start-all.sh
Step 6: install findspark package: $ pip install findspark
Step 7: launch jupyter notebook: $jupyter notebook
Step 8: create a new notebook and add the following code for testing:import findspark
findspark.init()
import pyspark
from pyspark.sql import SparkSession
spark = SparkSession.builder.getOrCreate()
df = spark.sql("select 'spark' as hello ")
df.show()
Disable Microsoft Defender for Cloud for Visual Studio Subscription (MSDN)
I use a visual studio pro subscription which comes with $150 azure cloud credit, for some reason Microsoft Defender for Cloud was turned on ...
-
Error 15401: Windows NT user or group '%s' not found. Check the name again. SELECT name FROM syslogins WHERE sid = SUSER_SID ('Y...
-
/etc/ipsec.config conn ios keyexchange=ikev1 authby=xauthrsasig xauth=server lef...
-
Ever since I installed VMWare ESX server on my HP ML110 G4, I haven't got much chance playing it and it has been lying on the floor for ...