Setiap tahun, ribuan tim development di Indonesia menghadapi pertanyaan yang sama: apakah kami harus tetap dengan monolith yang sudah berjalan, atau migrasi ke microservices yang semua orang bicarakan?
Jawabannya bukan hitam-putih. Keputusan ini berdampak pada development speed, infrastructure cost, team structure, dan operational complexity untuk tahun-tahun mendatang.
Artikel ini akan memberikan framework lengkap untuk memutuskan arsitektur yang tepat untuk bisnis Anda, dengan data real, perhitungan cost, dan decision matrix yang bisa langsung diterapkan.
Apa Itu Monolith Architecture?
Monolith adalah aplikasi yang dibangun sebagai satu kesatuan utuh. Semua komponen—UI, business logic, database access, background jobs—berjalan dalam satu codebase dan di-deploy sebagai satu unit.
Karakteristik Monolith:
- Single codebase untuk seluruh aplikasi
- Shared database untuk semua modul
- Deploy all-or-nothing (satu deployment untuk semua fitur)
- Tight coupling antar komponen
Contoh Teknologi:
- Ruby on Rails application
- Django/Flask monolith
- Laravel PHP application
- Express.js monolith
Kapan Monolith Cocok:
Monolith bukan legacy architecture yang harus dihindari. Banyak unicorn Indonesia seperti Tokopedia dan Gojek memulai dengan monolith dan tetap menggunakannya untuk bagian-bagian tertentu hingga sekarang.
Monolith excellent untuk:
- Early-stage startups: MVP perlu cepat, iterasi cepat
- Small teams: <10 developers yang butuh simplicity
- Bounded domain: Aplikasi dengan scope jelas dan tidak akan scale extreme
- Tight integration: Fitur yang butuh consistent transactions
Apa Itu Microservices Architecture?
Microservices memecah aplikasi menjadi service-service kecil yang independent. Setiap service fokus pada satu business capability, punya database sendiri, dan bisa di-deploy independent.
Karakteristik Microservices:
- Multiple codebases (satu per service)
- Database per service (data decentralization)
- Independent deployment
- Loose coupling via APIs/message queues
Contoh Breakdown:
E-commerce dengan microservices:
- User Service: Authentication, profile management
- Product Service: Catalog, inventory
- Order Service: Cart, checkout, order tracking
- Payment Service: Payment processing, refunds
- Notification Service: Email, SMS, push notifications
Masing-masing service punya team, codebase, database, dan deployment schedule sendiri.
Kapan Microservices Cocok:
Microservices bukan silver bullet. Ada cost signifikan dalam complexity, infrastructure, dan team coordination.
Microservices make sense untuk:
- Large teams: >20 developers yang perlu work in parallel
- High scale requirements: Bagian tertentu butuh scale independent
- Multiple domains: Business logic yang distinct dan complex
- Polyglot needs: Perlu different tech stack untuk different services
Perbandingan Head-to-Head
1. Development Speed
Monolith - Winner untuk Early Stage:
- • Setup project: 1-2 hari
- • Add feature baru: 1-3 hari (langsung edit, test, deploy)
- • Refactoring: Mudah, IDE support lengkap
- × Bottleneck saat team >10 developers
Microservices - Winner untuk Scale:
- × Setup project: 2-4 minggu (infrastructure, service mesh, monitoring)
- • Add feature baru: 2-5 hari per service (tapi parallel)
- × Refactoring: Complex (breaking changes affect multiple services)
- • No bottleneck, teams work independently
Verdict: Monolith menang untuk 0-2 tahun pertama. Microservices menang setelah scale dan team size meningkat.
2. Infrastructure Cost
Monolith Cost (1 tahun):
- Server: Rp 20 juta/tahun (single instance + backup)
- Database: Rp 15 juta/tahun (PostgreSQL managed)
- Load balancer: Rp 5 juta/tahun
- Monitoring: Rp 3 juta/tahun
- Total: Rp 43 juta/tahun
Microservices Cost (1 tahun, 5 services):
- Servers: Rp 60 juta/tahun (12 instances, HA per service)
- Databases: Rp 50 juta/tahun (5 databases)
- API Gateway: Rp 12 juta/tahun
- Service mesh: Rp 15 juta/tahun (Istio/Linkerd)
- Message queue: Rp 10 juta/tahun (RabbitMQ/Kafka)
- Monitoring: Rp 18 juta/tahun (distributed tracing, log aggregation)
- Total: Rp 165 juta/tahun
Cost multiplier: 3.8x
Verdict: Monolith jauh lebih murah. Microservices cost justified hanya jika scale benefits outweigh the cost.
3. Deployment & Rollback
Monolith:
- • Deploy process simple (single pipeline)
- • Rollback mudah (revert to previous version)
- × Downtime required (atau blue-green deployment)
- × One bug affects entire app
Microservices:
- • Zero-downtime deployment per service
- • Bug isolated to one service
- × Complex orchestration (Kubernetes, service dependencies)
- × Rollback risky (version compatibility across services)
Verdict: Depends on use case. Microservices better untuk high-availability requirements.
4. Testing & Quality Assurance
Monolith:
- • Unit testing straightforward
- • Integration testing dalam satu codebase
- • E2E testing simple (single application)
- × Test suite slow saat codebase besar
Microservices:
- • Unit testing per service (fast, isolated)
- × Integration testing complex (mock external services)
- × E2E testing nightmare (coordination 5+ services)
- × Contract testing required antar services
Real Example:
Bayangkan testing checkout flow:
- Monolith: 1 test suite, 50 test cases, run dalam 5 menit
- Microservices: 5 test suites, 150 test cases (overlap), mock 4 external services, run dalam 15 menit
Verdict: Monolith lebih mudah test untuk small-medium apps. Microservices butuh investment besar dalam testing infrastructure.
5. Team Structure & Conway's Law
Monolith Team:
- Struktur: Feature teams (horizontal)
- Communication: Daily standup, shared codebase
- Onboarding: 2-4 minggu (learn entire codebase)
- Best size: 5-15 developers
Microservices Team:
- Struktur: Service teams (vertical, full-stack per service)
- Communication: API contracts, async
- Onboarding: 1-2 minggu (learn one service)
- Scales to: 50+ developers
Conway's Law:
"Organizations design systems that mirror their communication structure."
Jika team structure tidak match architecture, akan ada friction.
Example Mismatch:
× Bad: Microservices dengan centralized ops team
- Deployment bottleneck
- Slow iteration
- Defeats the purpose
• Good: Microservices dengan autonomous teams
- Each team owns service end-to-end
- Fast deployment
- True independence
6. Scalability
Monolith Scaling:
- Vertical: Add CPU/RAM (limited by single machine)
- Horizontal: Clone entire app (wasteful)
- Cost per 100K users: Rp 15 juta/bulan
Example:
E-commerce monolith:
- Product catalog: 10% CPU
- Search: 60% CPU (bottleneck)
- Checkout: 20% CPU
- Admin: 10% CPU
Scale entire app untuk handle search load → 70% wasted capacity.
Microservices Scaling:
- Selective: Scale only bottleneck services
- Independent: Different services, different resources
- Cost per 100K users: Rp 18 juta/bulan (tapi optimal allocation)
Example:
E-commerce microservices:
- Product service: 2 instances
- Search service: 10 instances (bottleneck)
- Checkout service: 3 instances
- Admin service: 1 instance
Scale hanya yang perlu → optimal resource usage.
Verdict: Microservices win untuk selective scaling needs. Monolith OK jika load distribution merata.
7. Technology Flexibility
Monolith:
- × Stuck dengan satu tech stack
- × Upgrade risky (all-or-nothing)
- • Consistency easy (same language, framework, libs)
Microservices:
- • Polyglot: Python ML service + Go API service + Node.js real-time service
- • Incremental upgrade (migrate one service at a time)
- × Consistency nightmare (10 different logging libraries)
Real Scenario:
Startup dengan monolith Ruby on Rails:
- Butuh ML recommendation engine
- Monolith: Build Ruby wrapper around Python (awkward)
- Microservices: Standalone Python ML service (clean)
Verdict: Microservices better untuk heterogeneous requirements. Monolith better untuk consistency.
8. Operational Complexity
Monolith Operations:
- Monitoring: 1 application, simple APM
- Debugging: Stack trace complete
- Logs: Single log stream
- Ops team size: 1-2 engineers
Microservices Operations:
- Monitoring: Distributed tracing (Jaeger, Zipkin)
- Debugging: Correlation IDs across 5+ services
- Logs: Log aggregation (ELK stack)
- Ops team size: 3-5 engineers (SRE)
Failure Scenarios:
Monolith:
- Service down → entire app down
- Recovery: Restart, fast
Microservices:
- One service down → partial degradation
- Cascade failure risk (service A → B → C)
- Recovery: Complex (which service? dependency health?)
Verdict: Monolith drastically simpler operationally. Microservices memerlukan DevOps maturity tinggi.
Decision Matrix
| Kriteria | Monolith | Microservices | Weight |
|---|---|---|---|
| Team size | <15 dev | >20 dev | High |
| Development speed | Early stage | Mature product | High |
| Budget (infrastruktur) | |||
| Scale requirements | Moderate | Extreme (>1M users) | Medium |
| Domain complexity | Single domain | Multiple domains | Medium |
| DevOps maturity | Basic | Advanced (CI/CD, K8s) | High |
| Tech diversity need | Single stack | Polyglot | Low |
Scoring:
Hitung score untuk setiap architecture:
- Monolith: +1 jika kriteria match
- Microservices: +1 jika kriteria match
- Multiply by weight (High=3, Medium=2, Low=1)
Example:
Startup fintech, 8 developers, budget Rp 80 juta/tahun:
- Team size: Monolith (+3)
- Dev speed: Monolith (+3)
- Budget: Monolith (+3)
- Scale: Monolith (+2)
- Domain: Monolith (+2)
- DevOps: Monolith (+3)
- Tech: Tie (0)
Total: Monolith 16, Microservices 0 → Clear monolith
Skenario Hipotesis: 3 Bisnis, 3 Keputusan
Skenario 1: E-learning Startup (6 Bulan, 3 Developers)
Context:
- MVP platform e-learning untuk SME
- Budget development: Rp 200 juta
- Target: Launch dalam 3 bulan, 10K users tahun pertama
- Team: 3 full-stack developers
Decision: Monolith
Why:
- Speed to market critical
- Small team, coordination overhead kills productivity
- 10K users tidak butuh microservices complexity
- Infrastructure budget limited
Tech Stack:
- Next.js monolith (API routes + frontend)
- PostgreSQL database
- Vercel hosting (Rp 2 juta/bulan)
Result: Launch on time, scale to 50K users masih OK dengan monolith.
Skenario 2: Logistics Platform (2 Tahun, 25 Developers)
Context:
- Real-time tracking 5,000 vehicles
- Multiple modules: dispatch, route optimization, payment, driver app
- 3 teams: Backend (10), Mobile (10), Data (5)
- Current: Rails monolith, slow deployment, blocking
Decision: Gradual Migration ke Microservices
Why:
- Team size causing merge conflicts
- Route optimization CPU-intensive, needs separate scaling
- Mobile apps butuh stable API contracts
- DevOps team mature (Kubernetes ready)
Migration Strategy:
- Year 1: Extract route optimization service (Python, CPU-bound)
- Year 2: Extract payment service (compliance isolation)
- Year 3: Extract notification service (high throughput)
- Core: Keep monolith untuk business logic
Result: Best of both worlds—complexity only where needed.
Skenario 3: SaaS B2B (500 Tenants, Compliance Requirements)
Context:
- Multi-tenant SaaS untuk enterprise
- Compliance: ISO 27001, data residency requirements
- Some tenants di Indonesia, some Singapore
- Team: 40 developers across 5 feature teams
Decision: Microservices with Tenant Isolation
Why:
- Data residency → per-tenant deployment
- Compliance audit easier dengan service boundaries
- Feature teams want autonomy
- Scale per tenant varies wildly (10 users vs 10K users)
Architecture:
- Shared services: Auth, billing, notification
- Tenant services: Application logic (per region)
- Infrastructure: Kubernetes multi-cluster (Jakarta + Singapore)
Result: Compliance met, scale flexible, teams autonomous.
Indonesia Market Context
Budget Reality
Menurut survey 100+ Indonesian tech companies (2025):
- Startup (<50 employees): Rp 50-200 juta/tahun infrastructure
- Scale-up (50-200): Rp 200-500 juta/tahun
- Enterprise (>200): Rp 500 juta - 2 miliar/tahun
Microservices investment realistic hanya untuk scale-up dan enterprise.
Talent Availability
Monolith expertise (abundant):
- Laravel, Rails, Django, Express.js: Banyak
- Hiring mid-level: Rp 12-20 juta/bulan
Microservices expertise (limited):
- Kubernetes, service mesh, distributed systems: Rare
- Hiring senior (required): Rp 25-40 juta/bulan
- Training cost: Rp 50-100 juta/team
Implication: Microservices butuh budget lebih tinggi untuk talent.
Regulatory Considerations
PP 71/2019 - Data Localization:
Sektor tertentu harus store data di Indonesia:
- Financial services
- E-commerce >Rp 100 miliar/tahun
- Healthcare
Architecture Impact:
Monolith:
- Deploy satu instance di Indonesia data center
- Simple compliance
Microservices:
- Service mesh across regions
- Data residency per service
- Complex compliance audit
Recommendation: Jika ada data residency requirements, design for multi-region dari awal.
Cloud Provider Landscape
Indonesian Market (2026):
- AWS Jakarta (ap-southeast-3): Full services
- Google Cloud Jakarta: Growing
- Local providers: Biznet Gio, CBN
Cost comparison (per bulan):
- AWS Jakarta: 15-20% lebih mahal dari Singapore
- GCP Jakarta: 10-15% lebih mahal
- Local: 20-30% lebih murah (tapi limited services)
Microservices implication:
5 services × Rp 10 juta = Rp 50 juta/bulan vs Rp 15 juta monolith.
Decision: Factor in Indonesia premium saat calculate ROI.
Kapan Migrasi dari Monolith ke Microservices?
Red Flags (Time to Consider Migration):
1. Deployment bottleneck: Deploy 1x per minggu jadi 1x per bulan karena risk
2. Team blocking: Merge conflicts daily, velocity turun 50%
3. Scaling pain: Harus scale entire app untuk 1 bottleneck feature
4. Onboarding >2 bulan: New developer butuh >8 minggu productive
5. Service outages: 1 bug brings down entire app
Not Red Flags (Stay with Monolith):
- Revenue belum Rp 1 miliar/bulan
- Team <20 developers
- Infrastructure budget <Rp 100 juta/tahun
- Deployment masih smooth (1-2x per minggu)
- Codebase masih manageable
Migration Cost (Real Numbers):
Startup SaaS dengan Rails monolith (50K lines):
- Timeline: 12-18 bulan (gradual)
- Cost: Rp 800 juta - 1.2 miliar (development + infrastructure + training)
- Productivity drop: 30-40% during migration
- Break-even: 18-24 bulan setelah migration
ROI Calculation:
Before (Monolith Pain):
- Deployment: 1x per 2 minggu (slow releases)
- Downtime: 4 jam/bulan (revenue loss: Rp 50 juta/bulan)
- Developer velocity: -40% (blocking, merge conflicts)
After (Microservices):
- Deployment: 2-3x per minggu per service
- Downtime: 30 menit/bulan (partial degradation)
- Developer velocity: +60% (autonomous teams)
Net benefit: Rp 150 juta/bulan improvement dalam velocity + uptime.
Payback period: 8 bulan (Rp 1.2 miliar cost / Rp 150 juta benefit).
Common Mistakes to Avoid
Mistake 1: Premature Microservices
Scenario: Startup dengan 4 developers build microservices dari hari 1.
Result:
- 6 bulan untuk MVP (seharusnya 2 bulan)
- Infrastructure cost 4x budget
- Burnout karena operational complexity
Fix: Start monolith. Extract services hanya saat pain jelas.
Mistake 2: Wrong Service Boundaries
Scenario: Split berdasarkan technical layer, bukan business domain.
Bad Split:
- API Gateway Service
- Business Logic Service
- Database Service
Good Split:
- User Service (manage users end-to-end)
- Product Service (manage products end-to-end)
- Order Service (manage orders end-to-end)
Fix: Service boundaries = business domains. Setiap service bisa berdiri sendiri.
Mistake 3: Shared Database
Scenario: Microservices share satu database.
Result: Tight coupling tetap exist. Defeats microservices purpose.
Fix: Database per service. Communicate via APIs, bukan direct DB access.
Mistake 4: No API Versioning
Scenario: Service A update API, Service B break.
Result: Cascade failures, deployment coordination nightmare.
Fix: API versioning dari hari 1. Backward compatibility mandatory.
Mistake 5: Distributed Monolith
Scenario: Microservices yang tightly coupled. Every request touch 5+ services.
Result: Monolith complexity + microservices cost = worst of both.
Fix: Loose coupling. Services independent 80%+ of the time.
Kesimpulan
Monolith vs Microservices bukan pilihan antara "old" vs "new", tapi antara simplicity vs flexibility.
Choose Monolith jika:
- Team <20 developers
- Early-stage product (MVP - product-market fit)
- Budget infrastructure <Rp 100 juta/tahun
- Domain complexity moderate
Choose Microservices jika:
- Team >30 developers dalam multiple teams
- Proven product dengan clear scale needs
- Budget infrastructure >Rp 150 juta/tahun
- DevOps maturity tinggi (CI/CD, Kubernetes, monitoring)
Best Practice:
1. Start monolith: 95% startup harus start dengan monolith
2. Monitor pain points: Track deployment frequency, merge conflicts, scaling bottlenecks
3. Gradual migration: Extract 1 service at a time saat pain jelas
4. Keep core monolith: Banyak bagian tidak perlu jadi microservice
Remember: Architecture bukan keputusan permanent. Evolve sesuai growth dan team maturity.
Di Zeppelin Works, kami membantu bisnis Indonesia memilih dan implement arsitektur yang tepat—bukan yang trendy, tapi yang solve actual problems. Ingin diskusi arsitektur untuk product Anda? Hubungi kami untuk konsultasi gratis, no sales pitch.
