Active-Active PostgreSQL with AWS DMS: Full Load + CDC

What Active-Active means two or more PostgreSQL databases can accept writes and stay in sync in near real-time. Unlike standard streaming replication (primary → replicas), this setup allows bi-directional writes. We’ll use AWS DMS to achieve this: Full Load: copy existing schema + data Change Data Capture (CDC): replicate ongoing changes from WAL logs Databases can be RDS, EC2 PostgreSQL, or on-premises. Latency is usually seconds. Why Multi-region, hybrid infrastructure, disaster recovery True bi-directional sync is complex; DMS simplifies it Avoid downtime and manual syncing Most failures happen during setup, not concept How 1. Decide DMS Deployment Provisioned: recommended for CDC. Runs 24/7, predictable performance. Serverless: flexible scaling, but dynamic cost and unsuitable for constant CDC. Rule: Always use Provisioned for bi-directional replication. ...

February 27, 2025 · 3 min · 576 words · Me

Add a Record to Apex Domain on Route 53

What What is Apex domain ? When you buy a domain, the naked domain name is called the apex domain. where you may add other sub domain to. EX - you buy domainname.com, the domainname.com is the apex domain. and the sub domains can be blog.domainname.com . But you dont get the domain to create sub doomains. Sooner or later you will want to connect this apex domain to a site as well. And thats where you will face an issues. This blog shows you how to fix that. ...

January 12, 2025 · 3 min · 556 words · Me

Deploy Angular to S3

What You can directly push your angular build to aws s3 from github using github action. How For this you need aws iam with s3 access and cloudfront access ( if you are using cloudfornt to serve the s3 resources ). the action script is name: Deploy to S3 on: push: branches: - master jobs: deploy: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - name: Set up Node JS uses: actions/setup-node@v4 with: node-version: 'lts/*' - name: Install dependencies run: npm install --legacy-peer-deps - name: Build Angular project run: npm run build --configuration=production - name: Sync S3 bucket uses: jakejarvis/s3-sync-action@master with: args: --delete env: AWS_S3_BUCKET: your-bucket AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} AWS_REGION: 'eu-west-2' SOURCE_DIR: 'dist/proj' - name: Invalidate CloudFront uses: chetan/invalidate-cloudfront-action@v2 env: DISTRIBUTION: your-cf-id PATHS: "/*" AWS_REGION: "us-east-1" AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} In above script you need to replace your bucket name with your-bucket, your cloudfornt id with your-cf-id and the aws iam creds can be set at the secrets tab in github.

December 18, 2024 · 1 min · 171 words · Me

Deploy Html to S3

What You can push you static html files with its related assets to AWS s3 directly from github action whenever you push files to github. How You will need an IAM user from aws with access to s3 and cloudfront ( if you are goign to use cloudfront ). and a s3 bucket to put things into. name: Deploy to S3 on: push: branches: - master jobs: deploy: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 with: submodules: false - name: Sync S3 bucket uses: jakejarvis/s3-sync-action@master with: args: --delete env: AWS_S3_BUCKET: your-bucket-name AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} AWS_REGION: 'us-west-1' SOURCE_DIR: '.' - name: Invalidate CloudFront uses: chetan/invalidate-cloudfront-action@v2 env: DISTRIBUTION: your-cf-id PATHS: "/*" AWS_REGION: "us-east-1" AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} in the above code if you are not using a cloudfront distribution to serve the s3 do not use the Invalidate CloudFront step.

November 5, 2024 · 1 min · 149 words · Me

Deploy Hugo to S3

What You can deploy the hugo project to s3 directly when you make a push to github repository. this is a guide for that. you are going to use AWS s3, IAM role with s3 access and cloudfront access if you want to use cloudfront in front of s3 bucket. How the github action for your repo will be name: Deploy to S3 on: push: branches: - master jobs: deploy: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 with: submodules: true - name: Set up Hugo uses: peaceiris/actions-hugo@v3 with: hugo-version: 'latest' - name: Build the Hugo site run: hugo --verbose --debug - name: Sync S3 bucket uses: jakejarvis/s3-sync-action@master with: args: --delete env: AWS_S3_BUCKET: your-bucket AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} AWS_REGION: 'us-west-1' SOURCE_DIR: 'public' - name: Invalidate CloudFront uses: chetan/invalidate-cloudfront-action@v2 env: DISTRIBUTION: YOUR-CF-DIST-ID PATHS: "/*" AWS_REGION: "us-east-1" AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} If you are not using and CF, ignore the cloudfront invalidation part. and you are good to go.

October 22, 2024 · 1 min · 166 words · Me