Why I Choose Go as My Primary Stack

- Why I Choose Go as My Primary Stack
- 🎯 1. The Decision
- 📊 2. Benchmark: Go vs The Rest
- Compilation Speed
- Memory Efficiency
- HTTP Request Throughput
- Cold Start Time
- Binary Size & Deployment
- ⚡ 3. Beyond Numbers: Why Go Wins for Me
- Simplicity by Design
- Concurrency: Goroutines vs Threads
- Built-in Tooling
- Project Structure yang Clean
- 🔍 4. Where Others Shine: Honest Comparison
- 🧠 5. My Stack Philosophy
- Decision Framework
- My Toolbox
- 🐹 Primary — Go (90% Backend Work)
- ⚛️ Frontend — TypeScript + React/Next.js
- 📱 Mobile — Flutter/Dart
- 🐍 Data & ML — Python
- 🦀 Performance-Critical — Rust
- The 80/20 Rule
- 📈 6. Real-World Impact
- 🏁 7. Conclusion
- Performa Mendekati C/Rust Dengan development speed mendekati Python.
- Simplicity 25 keywords. Kode yang mudah dibaca, di-maintain, dan
- Concurrency First-Class Goroutines + Channels. Jutaan concurrent
- Effortless Deployment Single static binary.
COPYdan selesai. 15 MB - Cost Efficiency Efisiensi resource yang berdampak langsung ke
Why I Choose Go as My Primary Stack
"Simplicity is the ultimate sophistication." — Leonardo da Vinci
Disclaimer
Artikel ini bukan tentang "Go is the best language ever" — melainkan tentang mengapa Go cocok sebagai primary stack untuk konteks dan kebutuhan saya, dan mengapa saya tetap terbuka dengan stack lain. Semua bahasa pemrograman adalah alat — pilih yang tepat untuk masalah yang tepat.
🎯 1. The Decision
Setiap engineer pasti pernah di titik ini: memilih primary stack. Bukan berarti menutup diri dari teknologi lain, tapi menentukan satu bahasa yang jadi "home base" — tempat kita paling produktif, paling paham ekosistemnya, dan paling percaya diri deliver production-grade software.
Pengalaman Lintas Stack
Bertahun-tahun bekerja dengan PHP, Python, Node.js, Java, Dart — hingga bereksperimen dengan Rust dan .NET di berbagai skala project.
Production-Proven
Go bukan pilihan berdasarkan hype, tapi berdasarkan pengalaman nyata membangun dan mengoperasikan sistem di production.
Pragmatism Over Fanaticism
Memilih Go sebagai primary bukan berarti menutup diri. Saya tetap menggunakan TypeScript, Python, Dart, dan bahasa lain sesuai kebutuhan.
Setelah bertahun-tahun bekerja dengan berbagai bahasa, saya memilih Go (Golang) sebagai primary stack. Berikut alasannya, lengkap dengan data benchmark.
📊 2. Benchmark: Go vs The Rest
Compilation Speed
Salah satu hal pertama yang bikin jatuh cinta dengan Go: kompilasi yang sangat cepat.
| Language | Compile Time | Notes |
|---|---|---|
| Go | ~2-5 detik | Incremental, sangat cepat |
| Rust | ~30-120 detik | Borrow checker + optimization heavy |
| Java | ~10-30 detik | JIT warmup terpisah |
| .NET (C#) | ~5-15 detik | Decent, tapi masih kalah |
| TypeScript (Node) | ~5-20 detik (tsc) | Tergantung config & size |
| PHP | N/A (interpreted) | No compile step |
| Python | N/A (interpreted) | No compile step |
Why So Fast?
Go didesain dari awal untuk compile cepat. Rob Pike dan tim Google membangun Go karena frustrasi dengan compile time C++ yang bisa sampai 45 menit di monorepo Google. Dependency resolution Go bersifat linear — bukan exponential seperti C/C++.
Memory Efficiency
Ini critical untuk production — terutama kalau menjalankan banyak microservices di Kubernetes.
| Language/Runtime | Memory Usage (Idle) | Relative to Go |
|---|---|---|
| Go | ~8-12 MB | 1x (baseline) |
| Rust | ~2-5 MB | 0.4x (winner) |
| PHP (Laravel) | ~20-40 MB/worker | 3x |
| Node.js | ~30-50 MB | 4x |
| Python (FastAPI) | ~30-50 MB | 4x |
| .NET (ASP.NET) | ~50-100 MB | 8x |
| Java (Spring Boot) | ~150-300 MB | 25x |
| Language/Runtime | Memory Under Load | Relative to Go |
|---|---|---|
| Go | ~20-50 MB | 1x (baseline) |
| Rust | ~10-30 MB | 0.5x (winner) |
| PHP (Laravel) | ~50-100 MB/worker | 3x |
| Node.js | ~80-200 MB | 4x |
| Python (FastAPI) | ~80-200 MB | 4x |
| .NET (ASP.NET) | ~100-300 MB | 6x |
| Java (Spring Boot) | ~300-800 MB | 12x |
The Sweet Spot
Rust memang menang di memory, tapi Go memberikan keseimbangan terbaik antara efisiensi memory dan kemudahan development. Anda mendapat ~90% efisiensi Rust dengan ~30% effort.
HTTP Request Throughput
Benchmark menggunakan skenario simple JSON response ({"message": "hello"}):
| Language/Framework | Requests/sec | Avg Latency |
|---|---|---|
| Rust (Actix-web) | ~650,000 | ~0.15ms |
| Go (Fiber) | ~550,000 | ~0.18ms |
| Go (net/http) | ~450,000 | ~0.22ms |
| .NET (ASP.NET Minimal) | ~350,000 | ~0.28ms |
| Java (Spring WebFlux) | ~300,000 | ~0.33ms |
| Node.js (Fastify) | ~150,000 | ~0.67ms |
| PHP (Swoole) | ~120,000 | ~0.83ms |
| Python (uvicorn) | ~40,000 | ~2.5ms |
Cold Start Time
Penting untuk serverless dan container-based deployments:
Serverless & Kubernetes
Di era serverless dan Kubernetes, cold start time bukan hal sepele. Go dan Rust unggul jauh di sini karena menghasilkan static binary tanpa runtime dependency. Java dengan 3.5 detik cold start bisa menjadi showstopper untuk serverless workloads.
Binary Size & Deployment
| Language | Binary/Artifact Size |
|---|---|
| Rust | ~5-10 MB |
| Go | ~10-15 MB |
| Java | ~30-80 MB (JAR) |
| .NET | ~30-60 MB |
| Python | ~30-100 MB (venv) |
| PHP | ~50-150 MB (vendor) |
| Node.js | ~50-200 MB (node_modules) |
| Language | Docker Image Size |
|---|---|
| Rust | ~10-15 MB (scratch) |
| Go | ~15-20 MB (scratch) |
| PHP | ~100-200 MB |
| .NET | ~150-250 MB |
| Node.js | ~150-300 MB |
| Java | ~200-400 MB |
| Python | ~150-400 MB |
Go menghasilkan single static binary — tidak butuh runtime, tidak butuh dependency manager di production:
FROM scratch
COPY myapp /app
ENTRYPOINT ["/app"]Itu saja. 15 MB Docker image. Bandingkan dengan Node.js yang butuh node_modules sebesar 200 MB.
⚡ 3. Beyond Numbers: Why Go Wins for Me
Benchmark hanya sebagian cerita. Berikut faktor-faktor yang membuat Go jadi pilihan utama:
Simplicity by Design
25 keywords. Tidak ada generics abuse, tidak ada annotation magic, tidak ada hidden behavior. What you see is what you get.
Concurrency First-Class
Goroutines + Channels = Concurrency yang elegant. ~2-8 KB per goroutine vs ~1 MB per thread di Java.
Standard Library
net/http, encoding/json, database/sql, crypto, testing — semua production-ready tanpa third-party dependency.
Tooling Excellence
go fmt, go vet, go test, go mod, go build — built-in, terintegrasi, no config hell.
Simplicity by Design
package main
import (
"fmt"
"net/http"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, `{"message": "Hello, World!"}`)
})
http.ListenAndServe(":8080", nil)
}10 baris. Tidak ada annotation, tidak ada DI framework, tidak ada XML config.
package com.example.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@SpringBootApplication
@RestController
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
@GetMapping("/")
public String hello() {
return "{\"message\": \"Hello, World!\"}";
}
}Plus pom.xml / build.gradle, application.properties, dan dependency tree yang dalam.
const express = require("express");
const app = express();
app.get("/", (req, res) => {
res.json({ message: "Hello, World!" });
});
app.listen(8080, () => console.log("Server running"));Plus package.json, node_modules/ (~200 MB), dan package-lock.json.
Concurrency: Goroutines vs Threads
// Goroutines + Channels = Elegant concurrency
func processOrders(orders []Order) []Result {
results := make(chan Result, len(orders))
for _, order := range orders {
go func(o Order) {
results <- processOrder(o)
}(order)
}
var processed []Result
for range orders {
processed = append(processed, <-results)
}
return processed
}1 Million Concurrent Connections
Goroutines hanya menggunakan ~2-8 KB stack (vs ~1 MB per thread di Java/.NET). Artinya bisa menjalankan jutaan goroutines secara bersamaan dalam satu proses — dengan memory yang sama yang dibutuhkan Java untuk ~50 threads.
Built-in Tooling
Prop
Type
Cross-compile dari Mac ke Linux?
GOOS=linux GOARCH=amd64 go build -o myappSelesai. Tidak perlu Docker, tidak perlu VM, tidak perlu CI khusus.
Project Structure yang Clean
Tidak ada node_modules/, tidak ada vendor/ sebesar 200 MB, tidak ada config hell. Clean, predictable, dan mudah di-navigate.
🔍 4. Where Others Shine: Honest Comparison
Memilih Go bukan berarti menutup mata dari kelebihan bahasa lain. Setiap bahasa punya sweet spot masing-masing:
🧠 5. My Stack Philosophy
Core Principle
"Use the right tool for the right job." — Semua bahasa pemrograman adalah alat. Seorang tukang kayu tidak hanya punya palu — dia punya gergaji, bor, pahat, dan amplas. Masing-masing untuk kegunaan yang berbeda.
Decision Framework
Bagaimana saya memilih stack untuk sebuah project:
My Toolbox
🐹 Primary — Go (90% Backend Work)
API services, microservices, CLI tools, infrastructure tooling, system programming. Go menangani 90% kebutuhan backend saya dengan efisiensi luar biasa.
⚛️ Frontend — TypeScript + React/Next.js
Ekosistem terbaik untuk modern UI. Type safety, component-based architecture, dan komunitas yang masif.
📱 Mobile — Flutter/Dart
Cross-platform, single codebase. Performa native-like dengan development speed yang tinggi.
🐍 Data & ML — Python
Untuk machine learning, data pipeline, dan scripting. Tidak ada alternatif yang lebih baik di domain ini.
🦀 Performance-Critical — Rust
Ketika Go tidak cukup cepat — embedded, WASM, atau compute-intensive components.
The 80/20 Rule
Go menangani 80% kebutuhan saya dengan 20% complexity. Itu sweet spot yang sempurna. Ketika saya butuh sesuatu di luar kemampuan Go, saya switch ke tool yang tepat — tanpa ego, tanpa fanatisme.
📈 6. Real-World Impact
Beberapa metrics dari production systems yang saya bangun dengan Go:
| Metric | Sebelum (Node.js/PHP) | Sesudah (Go) | Improvement |
|---|---|---|---|
| Response Time (p99) | ~250ms | ~15ms | 16x faster |
| Memory per Instance | ~512 MB | ~50 MB | 10x less |
| Docker Image Size | ~350 MB | ~18 MB | 19x smaller |
| Cold Start | ~3s | ~10ms | 300x faster |
| Monthly Infra Cost | ~$500 | ~$80 | 6x cheaper |
Cost Impact
Angka-angka di atas dari real production experience. Efisiensi resource Go secara langsung berdampak pada penghematan biaya infrastruktur yang signifikan. Ketika Anda menjalankan 20+ microservices, perbedaan ~460 MB memory per instance berarti bisa menjalankan 10x lebih banyak service di hardware yang sama.
🏁 7. Conclusion
TL;DR
Memilih Go bukan tentang mengatakan bahasa lain jelek. Semua bahasa pemrograman adalah alat — dan alat yang baik dipilih berdasarkan kebutuhan, bukan fanatisme.
Go menjadi primary stack saya karena memberikan:
Performa Mendekati C/Rust Dengan development speed mendekati Python.
Best of both worlds.
Simplicity 25 keywords. Kode yang mudah dibaca, di-maintain, dan
di-debug oleh siapapun di tim.
Concurrency First-Class Goroutines + Channels. Jutaan concurrent
connections dengan memory minimal.
Cost Efficiency Efisiensi resource yang berdampak langsung ke
penghematan biaya infrastruktur — 6x lebih murah di production.
Tapi saya tetap menulis TypeScript untuk frontend, Dart untuk mobile, Python untuk data work, dan tidak menutup kemungkinan menggunakan Rust untuk use case yang membutuhkan performa maksimal.
The best language is the one that solves your problem effectively. Go kebetulan menjadi bahasa itu untuk sebagian besar pekerjaan saya. Dan saya tidak akan ragu switch ke bahasa lain ketika konteksnya menuntut demikian.
Karena pada akhirnya, kita bukan "Go developer" atau "Java developer" — kita adalah engineer yang menggunakan tools terbaik untuk menyelesaikan masalah.