Kenapa Koneksi PostgreSQL Itu Mahal?

Berawal dari satu bug yang bikin pusing: di halaman create, INSERT sukses, data ke-return lengkap sama id-nya, tapi pas dibuka halaman detail datanya nggak ada. Dicek ke database memang nggak ada. Dan intermittent — kadang masuk, kadang nggak. Nggak ada error, nggak ada exception, kodenya udah bener. Kira-kira datanya ke mana?

Di sharing session ini kita bedah dari akarnya: kenapa satu koneksi PostgreSQL itu "mahal", apakah ini cuma masalah Postgres atau database lain juga, jebakan yang muncul pas aplikasi di-scale-out (autoscaling), cara kerja PgBouncer sebagai connection pooler, sampai akhirnya bug intermittent di awal tadi terjawab tuntas.

Yang dibahas:
• Process-per-connection: kenapa 1 koneksi = 1 proses OS + beberapa MB RAM
• Perbandingan model koneksi: PostgreSQL vs MySQL vs MongoDB vs Cassandra vs Redis vs DynamoDB
• Kenapa autoscaling bisa bikin "too many connections" pas trafik tinggi
• Cara PgBouncer memisahkan penskalaan aplikasi dari jumlah koneksi database
• Tiga mode pooling: session, transaction, statement
• Harga dari transaction mode: prepared statement, temp table, SET, advisory lock
• Fix satu baris untuk bug prepared statement: prepare: false
• PgBouncer vs Supavisor (pooler-nya Supabase)
• Checklist praktis milih jenis koneksi

Demo project (Bun + postgres.js + PgBouncer, lengkap 6 kasus yang bisa dijalankan sendiri):

https://github.com/ProgrammerZamanNow/postgresql-connection-demo

==========================
TIMELINE
==========================
00:00 Pendahuluan
00:25 Berawal dari satu bug
02:32 Agenda
03:37 Kenapa satu koneksi PostgreSQL itu mahal
05:37 Ini cuma masalah PostgreSQL?
10:32 Jebakan pas aplikasi scale-out
14:28 Solusinya: PgBouncer
22:28 Ada harganya
39:32 Ringkasan praktis

==========================
#PostgreSQL #PgBouncer #Database #ConnectionPooling #Backend #Supabase #Supavisor
#SistemTerdistribusi #Scalability #Autoscaling #Kubernetes #DevOps #Serverless
#SoftwareEngineering #ProgrammerZamanNow #BelajarPemrograman #Coding #SQL #WebDevelopment #SystemDesign

JOIN PREMIUM : https://www.youtube.com/ProgrammerZamanNow/join

DISCORD PREMIUM : https://www.youtube.com/post/UgxBHnvjdwwAioDHe0x4AaABCQ

Donasi :
Saweria : https://saweria.co/ProgrammerZamanNow

Social Media :
Instagram : https://www.instagram.com/ProgrammerZamanNow
Facebook : https://www.facebook.com/ProgrammerZamanNow
Telegram : https://t.me/ProgrammerZamanNow
Youtube : https://www.youtube.com/c/ProgrammerZamanNow Receive SMS online on sms24.me

TubeReader video aggregator is a website that collects and organizes online videos from the YouTube source. Video aggregation is done for different purposes, and TubeReader take different approaches to achieve their purpose.

Our try to collect videos of high quality or interest for visitors to view; the collection may be made by editors or may be based on community votes.

Another method is to base the collection on those videos most viewed, either at the aggregator site or at various popular video hosting sites.

TubeReader site exists to allow users to collect their own sets of videos, for personal use as well as for browsing and viewing by others; TubeReader can develop online communities around video sharing.

Our site allow users to create a personalized video playlist, for personal use as well as for browsing and viewing by others.

@YouTubeReaderBot allows you to subscribe to Youtube channels.

By using @YouTubeReaderBot Bot you agree with YouTube Terms of Service.

Use the @YouTubeReaderBot telegram bot to be the first to be notified when new videos are released on your favorite channels.

Look for new videos or channels and share them with your friends.

You can start using our bot from this video, subscribe now to Kenapa Koneksi PostgreSQL Itu Mahal?

What is YouTube?

YouTube is a free video sharing website that makes it easy to watch online videos. You can even create and upload your own videos to share with others. Originally created in 2005, YouTube is now one of the most popular sites on the Web, with visitors watching around 6 billion hours of video every month.