stdsquare²
🎓 Kelas
stdsquare / materi / slides / pertemuan-06
Tema
Japan
Arcade
Dark Retro
Font
‹ Daftar slide Pertemuan 6: Cloud Storage (S3, EBS, EFS, CDN, Lifecycle)
PEBD6027 · RPS minggu 6 · 2x50 menit

Cloud Storage

S3 Object · EBS Block · EFS File · CDN CloudFront

Peta Pembelajaran Hari Ini

Sub-CPMK 6: memilih strategi storage cloud sesuai kebutuhan data. Empat indikator capaian.

Jam ke-1
  • 3 tipe storage: object/block/file
  • S3 anatomi: bucket, key, region
  • Hitung biaya S3 untuk 1TB foto UMKM
Jam ke-2
  • 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.

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.
Bagian 1 · 1/4
3 Tipe Storage Cloud
Diskusi: untuk video 4K documentary 100GB, pilih tipe storage apa?

Object vs Block vs File Storage

Tiga paradigma storage dengan karakteristik & use case berbeda. Pilih sesuai pola akses data.

Object Storage (S3)
  • Data tak terstruktur via API
  • Bucket + key (flat namespace)
  • Unlimited scale, murah per GB
  • Use case: foto, video, backup, data lake
Block Storage (EBS)
  • Disk virtual di-attach ke EC2
  • Block-level, low-latency
  • Per-AZ, per-instance
  • Use case: boot disk, DB, file system
File Storage (EFS)
  • 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.

S3 Anatomi: Bucket, Key, Region

S3 = object storage paling populer. Pahami 3 konsep: bucket, key, region.

Bucket
  • Container untuk object
  • Nama unik global (tidak boleh sama sedunia)
  • Dibuat di region tertentu
  • Limit 100 bucket per akun default
Key (Object Name)
  • Path + filename objek
  • Contoh: foto/2024/batik-001.jpg
  • Flat namespace (slash hanya cosmetic)
  • Versioning opsional per bucket
Region
  • Lokasi fisik bucket
  • Memengaruhi latency & cost
  • ap-southeast-3 Jakarta untuk RI
  • Cross-region replication opsional
Object
  • 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 Use Case: Backup, Static Site, Data Lake

Tiga use case klasik S3 yang harus Anda kuasai untuk karir cloud.

Backup & Archive
  • Cross-region replication otomatis
  • Lifecycle policy auto-tiering Glacier
  • Versioning untuk recover accidental delete
  • Encryption at-rest default (SSE-S3)
Static Website Hosting
  • HTML/CSS/JS langsung dari S3
  • Custom domain via Route 53
  • CloudFront CDN di depan
  • Murah: ~Rp 30rb/bulan untuk traffic kecil
Data Lake
  • 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.

Hitung dari Nol: S3 untuk 1 TB Foto UMKM

UMKM fotografer Pekalongan: 1 TB foto portofolio + 100 GB unduhan/bulan. Berapa biaya S3?

LangkahKomponenPerhitunganNilai
1Storage S3 Standard1024 GB × $0,023$23,55/bulan
2Egress 100 GB ke internet100 × $0,09$9/bulan
3PUT request 1000 upload/bln1000 × $0,0005$0,50/bulan
4Total Standard23,55 + 9 + 0,50$33,05 ≈ Rp 529rb/bln
5Bila pindah Glacier (jarang akses)1024 × $0,004$4,10/bln storage
6Total Glacier + egress4,10 + 9$13,10 ≈ Rp 210rb/bln
7Hemat Glacier vs Standard529 − 210Rp 319rb/bln (60% hemat)
Harga AWS public (dihedge). Untuk foto portofolio yang sering diakses, S3 Standard tetap cocok.
Bagian 2 · 2/4
S3 Detail & Storage Class
Diskusi: kapan harus pilih Glacier Deep Archive vs S3 Standard-IA?

S3 Storage Class: Standard, IA, Glacier

S3 punya 7 storage class dengan trade-off cost vs retrieval time. Pilih sesuai pola akses.

Storage ClassHarga/GBRetrievalUse Case
Standard$0,023MilidetikHot data, sering diakses
Intelligent-Tiering$0,023 (auto)MilidetikPola akses tidak terprediksi
Standard-IA$0,0125MilidetikJarang diakses, butuh cepat
One-Zone-IA$0,01MilidetikMurah, 1 AZ (rendah durability)
Glacier Instant$0,004MilidetikArchive cepat retrieve
Glacier Flexible$0,0036Menit-jamArchive standar
Glacier Deep Archive$0,0009912 jamCompliance, hampir tak diakses
Aturan praktis: hot data Standard, archive Glacier. Lifecycle policy bisa auto-tiering berdasar umur.

Lifecycle Policy Auto-tiering

Lifecycle policy memindahkan object antar storage class otomatis berdasar umur. FinOps P13 ini krusial.

Contoh Policy
  • 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)
Manfaat
  • 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.

Versioning & Encryption S3

Versioning untuk recover delete, encryption untuk security. Keduanya best practice production.

Versioning
  • Simpan semua versi object
  • Recover accidental delete/overwrite
  • Storage cost naik (per versi dikenai biaya)
  • Wajib untuk bucket production
Encryption
  • 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.
Bagian 3 · 3/4
EBS & EFS Block/File
Diskusi: bila web farm 5 EC2 instance butuh share file upload, pilih EBS atau EFS?

EBS untuk EC2 Boot & Data

EBS (Elastic Block Store) = disk virtual di-attach ke EC2. Block-level, per-AZ.

Karakteristik
  • Block-level storage (disk)
  • Di-attach ke 1 EC2 instance
  • Per-AZ (tidak cross-region)
  • Backup via snapshot ke S3
Volume Type
  • 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.

EFS Shared File System

EFS (Elastic File System) = NFS shared untuk multiple EC2 concurrent. Scale otomatis.

Karakteristik
  • NFS shared multi-instance
  • Scale otomatis (no provisioning)
  • Cross-AZ dalam region
  • Lebih mahal dari EBS (~$0,30/GB)
Use Case
  • 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).

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.
Skala
  • Petabyte data di S3
  • Jutaan event per hari
  • Ribuan query Athena/hari
  • Ratusan model ML
FinOps
  • 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.
Bagian 4 · 4/4
CDN CloudFront & Backup
Diskusi: bila pengguna di Surabaya akses web di S3 Jakarta, butuh CDN? Latency berapa?

CDN CloudFront untuk Latency

CloudFront = CDN AWS. Cache content di edge location global, latency turun signifikan.

Cara Kerja
  • User request → CloudFront edge terdekat
  • Cache hit: serve langsung (5-15 ms)
  • Cache miss: fetch dari origin S3/EC2
  • TTL cache per object
Manfaat
  • 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.

Backup 3-2-1 Rule & Cross-Region

Aturan emas backup: 3 copy, 2 media berbeda, 1 offsite. Cloud memudahkan implementasi.

3-2-1 Rule
  • 3 copy data (1 produksi + 2 backup)
  • 2 media berbeda (S3 + EBS snapshot)
  • 1 offsite (cross-region)
  • Test restore berkala (wajib!)
Cloud Implementation
  • 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.

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.