PEBD6027 · RPS minggu 6 · 2x50 menit
Cloud Storage S3 Object · EBS Block · EFS File · CDN CloudFront Hari ini kita masuk dunia storage cloud. Setelah compute EC2 P5, sekarang di mana data disimpan. Kita bedakan tiga tipe utama: object storage S3, block storage EBS, file storage EFS. Plus CDN CloudFront untuk delivery cepat. Pemilihan storage menentukan cost, performance, dan durability. Data foto UMKM, video Tokopedia, hingga backup bank semuanya butuh strategi storage berbeda. Peta Pembelajaran Hari Ini Sub-CPMK 6: memilih strategi storage cloud sesuai kebutuhan data. Empat indikator capaian.
3 tipe storage: object/block/file S3 anatomi: bucket, key, region Hitung biaya S3 untuk 1TB foto UMKM EBS untuk EC2 boot & data EFS shared file system CDN CloudFront + backup 3-2-1 rule Posisi 14P: setelah compute EC2, hari ini storage. P7 networking VPC.
Empat indikator: beda object block file, S3 anatomi, pilih storage class S3, hitung biaya. Storage adalah komponen cloud paling tahan lama — S3 menjanjikan 99,999999999 persen durability 11 sembilan. Tapi biaya bisa bengkak bila tidak strategi lifecycle. Kita akan hitung konkret untuk UMKM foto dan data lake Tokopedia. Data sebagai Aset Bisnis Digital Data adalah aset paling berharga bisnis digital. Strategi storage = strategi perlindungan aset.
S3 Durability
11×9
99,999999999 persen — 1 file hilang per 10 juta tahun (per 10 juta file)
EBS Durability
99,9%
0,1 persen chance failure per tahun — backup wajib
Pertanyaan: bila foto UMKM 1TB hilang, berapa kerugian bisnis? Strategi backup bukan opsi.
Data adalah aset paling berharga bisnis digital. S3 menjanjikan durability 11 sembilan — 99,999999999 persen — setara 1 file hilang per 10 juta tahun untuk 10 juta file. EBS hanya 99,9 persen — 0,1 persen chance failure per tahun, backup wajib. Pertanyaan pemantik: bila foto UMKM 1 TB hilang, berapa kerugian bisnis? Strategi backup bukan opsional tapi krusial. Bank dan fintech bahkan wajib multi-region backup untuk compliance POJK. Bagian 1 · 1/4
3 Tipe Storage Cloud
Diskusi: untuk video 4K documentary 100GB, pilih tipe storage apa?
Jawaban tergantung use case. Untuk archive jarang akses: S3 Glacier murah. Untuk editing aktif: EBS block storage cepat. Untuk sharing tim: EFS file system. Tidak ada jawaban tunggal — pemahaman karakteristik tiap tipe krusial. Object vs Block vs File Storage Tiga paradigma storage dengan karakteristik & use case berbeda. Pilih sesuai pola akses data.
Data tak terstruktur via API Bucket + key (flat namespace) Unlimited scale, murah per GB Use case: foto, video, backup, data lake Disk virtual di-attach ke EC2 Block-level, low-latency Per-AZ, per-instance Use case: boot disk, DB, file system File system shared NFS Multi-instance concurrent Elastis, auto-grow Use case: shared content, web farm, CMS Analogi: Object = gudang dengan label; Block = hard disk lokal; File = drive jaringan shared.
Tiga paradigma storage. Object storage S3 untuk data tak terstruktur via API, bucket plus key flat namespace, unlimited scale murah per GB, cocok untuk foto video backup data lake. Block storage EBS adalah disk virtual di-attach ke EC2, block-level low-latency, per-AZ per-instance, cocok untuk boot disk DB file system. File storage EFS adalah file system shared NFS, multi-instance concurrent, elastis auto-grow, cocok untuk shared content web farm CMS. Analogi: object adalah gudang dengan label, block adalah hard disk lokal, file adalah drive jaringan shared. S3 Anatomi: Bucket, Key, Region S3 = object storage paling populer. Pahami 3 konsep: bucket, key, region.
Container untuk object Nama unik global (tidak boleh sama sedunia) Dibuat di region tertentu Limit 100 bucket per akun default Path + filename objek Contoh: foto/2024/batik-001.jpg Flat namespace (slash hanya cosmetic) Versioning opsional per bucket Lokasi fisik bucket Memengaruhi latency & cost ap-southeast-3 Jakarta untuk RI Cross-region replication opsional File + metadata Max 5 TB per object Tagging untuk cost allocation URL: https://BUCKET.s3.REGION.amazonaws.com/KEY Bucket name unik global — hindari nama generik. Gunakan prefix organisasi: prod-jualan-com-2024.
S3 adalah object storage paling populer. Tiga konsep inti: bucket adalah container untuk object dengan nama unik global — tidak boleh sama sedunia. Key adalah path plus filename object contoh foto slash 2024 slash batik 001 JPG. Region adalah lokasi fisik bucket yang memengaruhi latency dan cost — ap-southeast-3 Jakarta untuk pengguna RI. Object adalah file plus metadata max 5 TB per object dengan tagging untuk cost allocation. URL format HTTPS bucket dot s3 dot region dot amazonaws dot com slash key. Bucket name unik global — hindari nama generik pakai prefix organisasi. S3 Use Case: Backup, Static Site, Data Lake Tiga use case klasik S3 yang harus Anda kuasai untuk karir cloud.
Cross-region replication otomatis Lifecycle policy auto-tiering Glacier Versioning untuk recover accidental delete Encryption at-rest default (SSE-S3) HTML/CSS/JS langsung dari S3 Custom domain via Route 53 CloudFront CDN di depan Murah: ~Rp 30rb/bulan untuk traffic kecil Centralized raw data store AWS Athena query SQL langsung AWS Glue ETL processing Foundation ML/analytics Tokopedia-skala Tokopedia data lake pakai S3 sebagai foundation untuk ML recommendation & analytics jutaan transaksi/hari.
Tiga use case klasik S3 yang wajib Anda kuasai. Backup dan archive dengan cross-region replication otomatis, lifecycle policy auto-tiering ke Glacier, versioning untuk recover accidental delete, encryption at-rest default. Static website hosting HTML CSS JS langsung dari S3 dengan custom domain via Route 53 dan CloudFront CDN di depan, murah sekitar 30 ribu per bulan untuk traffic kecil. Data lake centralized raw data store dengan AWS Athena query SQL langsung dan AWS Glue ETL processing — foundation ML dan analytics Tokopedia-skala untuk recommendation engine jutaan transaksi per hari. Hitung dari Nol: S3 untuk 1 TB Foto UMKM UMKM fotografer Pekalongan: 1 TB foto portofolio + 100 GB unduhan/bulan. Berapa biaya S3?
Langkah Komponen Perhitungan Nilai 1 Storage S3 Standard 1024 GB × $0,023 $23,55/bulan 2 Egress 100 GB ke internet 100 × $0,09 $9/bulan 3 PUT request 1000 upload/bln 1000 × $0,0005 $0,50/bulan 4 Total Standard 23,55 + 9 + 0,50 $33,05 ≈ Rp 529rb/bln 5 Bila pindah Glacier (jarang akses) 1024 × $0,004 $4,10/bln storage 6 Total Glacier + egress 4,10 + 9 $13,10 ≈ Rp 210rb/bln 7 Hemat Glacier vs Standard 529 − 210 Rp 319rb/bln (60% hemat)
Harga AWS public (dihedge). Untuk foto portofolio yang sering diakses, S3 Standard tetap cocok.
Mari hitung konkret biaya S3 untuk UMKM fotografer Pekalongan dengan 1 TB foto portofolio plus 100 GB unduhan per bulan. Storage S3 Standard 1024 GB kali 0,023 dolar setara 23,55 dolar per bulan. Egress 100 GB ke internet 100 kali 0,09 dolar setara 9 dolar per bulan. PUT request 1000 upload per bulan setara 0,50 dolar. Total Standard 33,05 dolar sekitar Rp 529 ribu per bulan. Bila pindah Glacier untuk jarang akses storage turun ke 4,10 dolar per bulan. Total Glacier plus egress 13,10 dolar sekitar Rp 210 ribu per bulan. Hemat 60 persen. Harga AWS public yang berfluktuasi selalu verify. Bagian 2 · 2/4
S3 Detail & Storage Class
Diskusi: kapan harus pilih Glacier Deep Archive vs S3 Standard-IA?
Pemilihan storage class tergantung pola akses. Glacier Deep Archive untuk data compliance yang hampir tidak pernah diakses, retrieval butuh 12 jam, harga termurah. S3 Standard-IA untuk data yang jarang diakses tapi butuh retrieval cepat milidetik. Bila ragu, gunakan lifecycle policy auto-tiering untuk optimasi otomatis. S3 Storage Class: Standard, IA, Glacier S3 punya 7 storage class dengan trade-off cost vs retrieval time. Pilih sesuai pola akses.
Storage Class Harga/GB Retrieval Use Case Standard $0,023 Milidetik Hot data, sering diakses Intelligent-Tiering $0,023 (auto) Milidetik Pola akses tidak terprediksi Standard-IA $0,0125 Milidetik Jarang diakses, butuh cepat One-Zone-IA $0,01 Milidetik Murah, 1 AZ (rendah durability) Glacier Instant $0,004 Milidetik Archive cepat retrieve Glacier Flexible $0,0036 Menit-jam Archive standar Glacier Deep Archive $0,00099 12 jam Compliance, hampir tak diakses
Aturan praktis: hot data Standard, archive Glacier. Lifecycle policy bisa auto-tiering berdasar umur.
S3 punya 7 storage class dengan trade-off cost vs retrieval time. Standard 0,023 dolar per GB retrieval milidetik untuk hot data sering diakses. Intelligent-Tiering auto-tiering berdasarkan pola akses untuk yang tidak terprediksi. Standard-IA 0,0125 dolar per GB untuk jarang diakses tapi butuh cepat. One-Zone-IA 0,01 dolar per GB murah tapi 1 AZ rendah durability. Glacier Instant 0,004 dolar per GB retrieval milidetik untuk archive cepat retrieve. Glacier Flexible 0,0036 dolar per GB retrieval menit-jam untuk archive standar. Glacier Deep Archive 0,00099 dolar per GB retrieval 12 jam untuk compliance hampir tak diakses. Aturan praktis: hot data Standard, archive Glacier, lifecycle policy auto-tiering. Lifecycle Policy Auto-tiering Lifecycle policy memindahkan object antar storage class otomatis berdasar umur. FinOps P13 ini krusial.
0-30 hari: S3 Standard (hot) 31-90 hari: S3 Standard-IA (warm) 91-365 hari: Glacier Flexible (cold) 365+ hari: Glacier Deep Archive (frozen) Hemat 60-80% vs all-Standard Otomatis, no manual intervention Audit trail per object Ideal untuk log, foto lama, backup Bank compliance POJK: lifecycle policy wajib untuk data nasabah lama yang harus disimpan 5-10 tahun tapi jarang diakses.
Lifecycle policy memindahkan object antar storage class otomatis berdasar umur. Contoh policy: 0 sampai 30 hari S3 Standard hot, 31 sampai 90 hari S3 Standard-IA warm, 91 sampai 365 hari Glacier Flexible cold, 365 hari ke atas Glacier Deep Archive frozen. Manfaat: hemat 60 sampai 80 persen dibanding all-Standard, otomatis tanpa manual intervention, audit trail per object, ideal untuk log foto lama backup. Bank compliance POJK wajib lifecycle policy untuk data nasabah lama yang harus disimpan 5 sampai 10 tahun tapi jarang diakses — storage cost bisa 90 persen lebih murah. Versioning & Encryption S3 Versioning untuk recover delete, encryption untuk security. Keduanya best practice production.
Simpan semua versi object Recover accidental delete/overwrite Storage cost naik (per versi dikenai biaya) Wajib untuk bucket production SSE-S3: AWS managed key (default) SSE-KMS: customer managed key (audit) SSE-C: customer provided key HTTPS/TLS in-transit wajib Bank compliance: SSE-KMS wajib untuk audit trail siapa akses key. POJK mensyaratkan encryption at-rest.
Versioning dan encryption adalah best practice production S3. Versioning menyimpan semua versi object untuk recover accidental delete atau overwrite. Storage cost naik karena per versi dikenai biaya. Wajib untuk bucket production. Encryption punya tiga opsi: SSE-S3 AWS managed key default gratis, SSE-KMS customer managed key untuk audit trail siapa akses key, SSE-C customer provided key paling kontrol. HTTPS TLS in-transit wajib. Bank compliance: SSE-KMS wajib untuk audit trail, POJK mensyaratkan encryption at-rest untuk data nasabah. Bagian 3 · 3/4
EBS & EFS Block/File
Diskusi: bila web farm 5 EC2 instance butuh share file upload, pilih EBS atau EFS?
Jawaban: EFS. EBS hanya bisa di-attach ke 1 instance multi-attach terbatas. EFS adalah NFS shared file system yang bisa di-mount ke banyak instance sekaligus concurrently. Untuk web farm yang butuh share file upload user, EFS adalah pilihan. EBS cocok untuk DB dan boot disk yang butuh low-latency dedicated. EBS untuk EC2 Boot & Data EBS (Elastic Block Store) = disk virtual di-attach ke EC2. Block-level, per-AZ.
Block-level storage (disk) Di-attach ke 1 EC2 instance Per-AZ (tidak cross-region) Backup via snapshot ke S3 gp3: general purpose SSD (default) io2: provisioned IOPS (DB berat) st1: throughput-optimized HDD sc1: cold HDD murah EBS snapshot ke S3 cross-region untuk disaster recovery. Bank wajib multi-AZ EBS untuk DB.
EBS Elastic Block Store adalah disk virtual di-attach ke EC2. Block-level storage per-AZ tidak cross-region. Backup via snapshot ke S3. Volume type: gp3 general purpose SSD default untuk boot disk dan app standar. io2 provisioned IOPS untuk DB berat seperti PostgreSQL Oracle. st1 throughput-optimized HDD untuk big data. sc1 cold HDD murah untuk archive. EBS snapshot ke S3 cross-region untuk disaster recovery. Bank wajib multi-AZ EBS untuk DB dengan synchronous replication. EFS Shared File System EFS (Elastic File System) = NFS shared untuk multiple EC2 concurrent. Scale otomatis.
NFS shared multi-instance Scale otomatis (no provisioning) Cross-AZ dalam region Lebih mahal dari EBS (~$0,30/GB) Web farm shared content CMS WordPress multi-server Container shared volume (ECS/EKS) DevOps build artifacts EFS cocok untuk WordPress multi-server atau shared upload user. Tapi untuk DB tetap EBS (low-latency dedicated).
EFS Elastic File System adalah NFS shared untuk multiple EC2 concurrent. Scale otomatis tanpa provisioning. Cross-AZ dalam region. Lebih mahal dari EBS sekitar 0,30 dolar per GB. Use case: web farm shared content, CMS WordPress multi-server, container shared volume untuk ECS EKS, DevOps build artifacts. EFS cocok untuk WordPress multi-server atau shared upload user. Tapi untuk DB tetap EBS karena low-latency dedicated. Pilihan antara EBS EFS S3 tergantung pola akses data dan requirement latency. Studi Kasus: Data Lake Tokopedia di S3 Tokopedia membangun data lake di S3 sebagai foundation ML recommendation & analytics.
Arsitektur Tokopedia data lake (public case study AWS): event jutaan transaksi/hari → Kinesis Data Stream → S3 raw zone (S3 Standard) → AWS Glue ETL → S3 curated zone (S3 IA) → Athena/Redshift query → ML SageMaker training. Lifecycle policy auto-tiering log lama ke Glacier.
Petabyte data di S3 Jutaan event per hari Ribuan query Athena/hari Ratusan model ML Lifecycle 60-80% hemat storage S3 Intelligent-Tiering unpredictable Glacier log > 1 tahun Athena pay-per-query (no server) Pelajaran Bisdig: data lake bukan teknis semata, tapi strategi bisnis untuk personalisasi & monetisasi data.
Tokopedia membangun data lake di S3 sebagai foundation ML recommendation dan analytics. Arsitektur public case study AWS: event jutaan transaksi per hari masuk ke Kinesis Data Stream, lalu ke S3 raw zone Standard, AWS Glue ETL transformasi, ke S3 curated zone IA, Athena Redshift query, ML SageMaker training. Lifecycle policy auto-tiering log lama ke Glacier. Skala petabyte data di S3, jutaan event per hari, ribuan query Athena per hari, ratusan model ML. FinOps: lifecycle 60 sampai 80 persen hemat storage, S3 Intelligent-Tiering untuk unpredictable, Glacier log lebih dari 1 tahun, Athena pay-per-query tanpa server. Pelajaran Bisdig: data lake bukan teknis semata tapi strategi bisnis. Bagian 4 · 4/4
CDN CloudFront & Backup
Diskusi: bila pengguna di Surabaya akses web di S3 Jakarta, butuh CDN? Latency berapa?
Bila hanya S3 Jakarta tanpa CDN, latency dari Surabaya sekitar 20-40 ms tergantung ISP. Dengan CloudFront CDN edge di Jakarta dan Singapore, latency bisa turun ke 5-15 ms karena cache di edge. Untuk static asset seperti gambar video CSS JS, CDN sangat efektif. Untuk dynamic API, manfaat lebih kecil tapi edge compute (Lambda@Edge) bisa membantu. CDN CloudFront untuk Latency CloudFront = CDN AWS. Cache content di edge location global, latency turun signifikan.
User request → CloudFront edge terdekat Cache hit: serve langsung (5-15 ms) Cache miss: fetch dari origin S3/EC2 TTL cache per object Latency turun 80-95% Egress cost turun (cache hit) DDoS protection built-in HTTPS free via AWS Certificate Manager CloudFront cocok untuk web global, video streaming, e-commerce image. Tokopedia pakai CloudFront untuk asset Harbolnas.
CloudFront adalah CDN AWS. Cara kerja: user request masuk ke CloudFront edge location terdekat global. Cache hit serve langsung dengan latency 5 sampai 15 milidetik. Cache miss fetch dari origin S3 atau EC2. TTL cache per object. Manfaat: latency turun 80 sampai 95 persen, egress cost turun karena cache hit tidak perlu fetch dari origin, DDoS protection built-in, HTTPS free via AWS Certificate Manager. CloudFront cocok untuk web global, video streaming, e-commerce image. Tokopedia pakai CloudFront untuk asset Harbolnas saat traffic spike 11.11 dan 12.12. Backup 3-2-1 Rule & Cross-Region Aturan emas backup: 3 copy, 2 media berbeda, 1 offsite. Cloud memudahkan implementasi.
3 copy data (1 produksi + 2 backup) 2 media berbeda (S3 + EBS snapshot) 1 offsite (cross-region) Test restore berkala (wajib!) S3 cross-region replication EBS snapshot otomatis ke S3 AWS Backup central policy Cross-account untuk anti-ransomware Ransomware 2020+ encrypts backup juga. Cross-account backup = defense terbaik. Bank wajib DR test tahunan POJK.
Aturan emas backup 3-2-1: 3 copy data 1 produksi plus 2 backup, 2 media berbeda S3 plus EBS snapshot, 1 offsite cross-region, test restore berkala wajib. Cloud memudahkan implementasi: S3 cross-region replication otomatis, EBS snapshot otomatis ke S3, AWS Backup central policy, cross-account untuk anti-ransomware. Ransomware modern 2020 plus meng-encrypt backup juga — cross-account backup adalah defense terbaik karena credential berbeda. Bank wajib DR test tahunan sesuai POJK untuk memastikan restore bekerja saat disaster nyata. Ringkasan Kunci Pertemuan 6 Hari ini Anda menguasai tiga tipe storage cloud + CDN + backup strategy.
3 Tipe Storage
S3 object · EBS block · EFS file — pilih sesuai pola akses data.
S3 Storage Class
7 class dari Standard hingga Glacier Deep Archive. Lifecycle auto-tiering.
CDN & Backup
CloudFront latency turun. 3-2-1 rule + cross-region untuk DR.
Tiga lensa P6: 3 tipe storage · S3 lifecycle · CDN+backup strategy.
Persiapan P7: Networking VPC. Baca Wittig bab 5,8. Refresh subnetting dasar. Kuis 5 menit soal S3 storage class.
Tiga pesan kunci: tiga tipe storage S3 object EBS block EFS file dengan use case berbeda, S3 storage class 7 tier dari Standard hingga Glacier Deep Archive dengan lifecycle auto-tiering untuk optimasi cost, dan CDN CloudFront plus backup 3-2-1 rule cross-region untuk disaster recovery. P7 kita masuk networking VPC — refresh subnetting dasar sebelum kelas. Kuis 5 menit soal S3 storage class di awal P7. Sampai jumpa minggu depan.