Search & Catalog 15k SKU Q-Commerce: Relevan + In-Stock Real-time
Search & Catalog 15k SKU Q-Commerce: Relevan + In-Stock Real-time

Benchmark head-to-head 7 bahasa pemrograman populer: performa, memory, concurrency, developer experience, dan hiring market. Kenapa Go menang di production yang handle jutaan request — dan kenapa saya hampir pindah ke Rust (tapi batal).
"Simplicity is the ultimate sophistication." — Leonardo da Vinci
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.
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.
Bertahun-tahun bekerja dengan PHP, Python, Node.js, Java, Dart — hingga bereksperimen dengan Rust dan .NET di berbagai skala project.
Go bukan pilihan berdasarkan hype, tapi berdasarkan pengalaman nyata membangun dan mengoperasikan sistem di production.
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.
Salah satu hal pertama yang bikin jatuh cinta dengan Go: kompilasi yang sangat cepat.
xychart-beta
title "Compilation Speed (Medium Project)"
x-axis ["Go", "C#/.NET", "TypeScript", "Java", "Rust"]
y-axis "Seconds" 0 --> 120
bar [3, 10, 12, 20, 75]| 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 |
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++.
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 |
Rust memang menang di memory, tapi Go memberikan keseimbangan terbaik antara efisiensi memory dan kemudahan development. Anda mendapat ~90% efisiensi Rust dengan ~30% effort.
Benchmark menggunakan skenario simple JSON response ({"message": "hello"}):
xychart-beta
title "HTTP Throughput (requests/sec)"
x-axis ["Rust Actix", "Go Fiber", "Go net/http", ".NET Minimal", "Java WebFlux", "Node Fastify", "PHP Swoole", "Python uvicorn"]
y-axis "Requests/sec (thousands)" 0 --> 700
bar [650, 550, 450, 350, 300, 150, 120, 40]| 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 |
Penting untuk serverless dan container-based deployments:
xychart-beta
title "Cold Start Time (ms) - Lower is Better"
x-axis ["Go", "Rust", "PHP", "Node.js", "Python", ".NET", "Java"]
y-axis "Milliseconds" 0 --> 5000
bar [8, 8, 75, 200, 350, 1000, 3500]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.
| 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.
Benchmark hanya sebagian cerita. Berikut faktor-faktor yang membuat Go jadi pilihan utama:
25 keywords. Tidak ada generics abuse, tidak ada annotation magic, tidak ada hidden behavior. What you see is what you get.
Goroutines + Channels = Concurrency yang elegant. ~2-8 KB per goroutine vs ~1 MB per thread di Java.
net/http, encoding/json, database/sql, crypto, testing — semua production-ready tanpa third-party dependency.
go fmt, go vet, go test, go mod, go build — built-in, terintegrasi, no config hell.
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.
graph LR
subgraph "Go - Goroutines"
G1["Goroutine 1<br/>~2-8 KB"] --- G2["Goroutine 2<br/>~2-8 KB"]
G2 --- G3["Goroutine 3<br/>~2-8 KB"]
G3 --- G4["..."]
G4 --- G5["Goroutine 1,000,000<br/>~2-8 KB"]
end
subgraph "Java/.NET - OS Threads"
T1["Thread 1<br/>~1 MB"] --- T2["Thread 2<br/>~1 MB"]
T2 --- T3["Thread 3<br/>~1 MB"]
T3 --- T4["..."]
T4 --- T5["Thread ~5,000<br/>(OS limit)"]
end
style G1 fill:#d1fae5,stroke:#10b981,color:#000
style G2 fill:#d1fae5,stroke:#10b981,color:#000
style G3 fill:#d1fae5,stroke:#10b981,color:#000
style G4 fill:#d1fae5,stroke:#10b981,color:#000
style G5 fill:#d1fae5,stroke:#10b981,color:#000
style T1 fill:#fee2e2,stroke:#ef4444,color:#000
style T2 fill:#fee2e2,stroke:#ef4444,color:#000
style T3 fill:#fee2e2,stroke:#ef4444,color:#000
style T4 fill:#fee2e2,stroke:#ef4444,color:#000
style T5 fill:#fee2e2,stroke:#ef4444,color:#000// 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
}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.
| Property | Type | Description |
|---|---|---|
| go fmt | formatter default: built-in |
Auto-format code — no debate about style. Satu format untuk semua Go code di dunia. |
| go vet | linter default: built-in |
Static analysis — mendeteksi bugs sebelum runtime. |
| go test | testing default: built-in |
Testing + benchmarking + coverage — tanpa framework tambahan. |
| go mod | package manager default: built-in |
Dependency management — reproducible builds, no lock file drama. |
| go build | compiler default: built-in |
Cross-compilation built-in — compile untuk OS/arch manapun dari manapun. |
| go generate | codegen default: built-in |
Code generation — automate boilerplate tanpa magic. |
Cross-compile dari Mac ke Linux?
GOOS=linux GOARCH=amd64 go build -o myappSelesai. Tidak perlu Docker, tidak perlu VM, tidak perlu CI khusus.
Tidak ada node_modules/, tidak ada vendor/ sebesar 200 MB, tidak ada config hell. Clean, predictable, dan mudah di-navigate.
Memilih Go bukan berarti menutup mata dari kelebihan bahasa lain. Setiap bahasa punya sweet spot masing-masing:
Kelebihan:
Trade-off:
Kapan pilih Rust:
| Use Case | Alasan |
|---|---|
| Embedded systems | Zero-cost abstractions, no runtime |
| OS-level programming | Memory safety tanpa GC |
| Game engines | Performa setara C++ |
| Performance-critical components | Ketika nanoseconds matter |
| WebAssembly | First-class WASM support |
Rust bukan competitor Go — mereka menyelesaikan masalah yang berbeda. Go untuk application-level, Rust untuk system-level.
Kelebihan:
Trade-off:
node_modules black holeKapan pilih Node.js:
| Use Case | Alasan |
|---|---|
| Full-stack web apps | Satu bahasa, satu ekosistem |
| Real-time features | WebSocket native, SSE |
| BFF (Backend for Frontend) | Dekat dengan frontend team |
| Rapid prototyping | npm ecosystem yang masif |
Kelebihan:
Trade-off:
Kapan pilih Python:
| Use Case | Alasan |
|---|---|
| Machine Learning | PyTorch, TensorFlow, Hugging Face |
| Data pipeline | pandas, Spark, Airflow |
| Scripting & automation | Readable, cepat ditulis |
| Prototyping | Iterasi cepat |
Kelebihan:
Trade-off:
Kapan pilih Java/.NET:
| Use Case | Alasan |
|---|---|
| Enterprise systems | Mature, battle-tested |
| Legacy integration | Ecosystem yang established |
| Large team projects | Patterns yang well-known |
| Android native | Java/Kotlin native |
Kelebihan:
Trade-off:
Kapan pilih PHP:
| Use Case | Alasan |
|---|---|
| Content-heavy websites | WordPress, CMS ecosystem |
| Rapid web development | Laravel yang produktif |
| Small-medium projects | Cepat, murah, mudah di-deploy |
| E-commerce | Magento, WooCommerce |
"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.
Bagaimana saya memilih stack untuk sebuah project:
graph TD
A["🆕 New Project"] --> B{"Apa domain-nya?"}
B -->|"Backend / API / CLI / Infra"| C["🐹 Go"]
B -->|"Frontend / UI"| D["⚛️ TypeScript + React"]
B -->|"Mobile"| E["📱 Flutter / Dart"]
B -->|"ML / Data Science"| F["🐍 Python"]
B -->|"System / Embedded"| G["🦀 Rust"]
B -->|"Quick Script"| H["🐍 Python / 🐚 Bash"]
B -->|"Legacy Maintenance"| I["🐘 PHP / ☕ Java"]
C --> J{"Perlu ultra-low latency?"}
J -->|"Yes"| G
J -->|"No"| C
style A fill:#dbeafe,stroke:#3b82f6,color:#000
style C fill:#d1fae5,stroke:#10b981,color:#000
style D fill:#e0e7ff,stroke:#6366f1,color:#000
style E fill:#fce7f3,stroke:#ec4899,color:#000
style F fill:#fef3c7,stroke:#f59e0b,color:#000
style G fill:#fee2e2,stroke:#ef4444,color:#000
style H fill:#f3e8ff,stroke:#a855f7,color:#000
style I fill:#f1f5f9,stroke:#64748b,color:#000
style J fill:#fef3c7,stroke:#f59e0b,color:#000API services, microservices, CLI tools, infrastructure tooling, system programming. Go menangani 90% kebutuhan backend saya dengan efisiensi luar biasa.
Ekosistem terbaik untuk modern UI. Type safety, component-based architecture, dan komunitas yang masif.
Cross-platform, single codebase. Performa native-like dengan development speed yang tinggi.
Untuk machine learning, data pipeline, dan scripting. Tidak ada alternatif yang lebih baik di domain ini.
Ketika Go tidak cukup cepat — embedded, WASM, atau compute-intensive components.
pie title "My Stack Usage Distribution"
"Go (Backend)" : 50
"TypeScript (Frontend)" : 20
"Dart (Mobile)" : 15
"Python (Data/Script)" : 10
"Others (Rust/PHP/Java)" : 5Go 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.
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 |
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.
graph LR
subgraph "Before: Node.js/PHP Stack"
A1["Service 1<br/>512 MB"] --- A2["Service 2<br/>512 MB"]
A2 --- A3["Service 3<br/>512 MB"]
A3 --- A4["= 1.5 GB<br/>for 3 services"]
end
subgraph "After: Go Stack"
B1["Service 1<br/>50 MB"] --- B2["Service 2<br/>50 MB"]
B3["Service 3<br/>50 MB"] --- B4["Service 4<br/>50 MB"]
B5["Service 5<br/>50 MB"] --- B6["..."]
B6 --- B7["Service 30<br/>50 MB"]
B7 --- B8["= 1.5 GB<br/>for 30 services"]
end
style A1 fill:#fee2e2,stroke:#ef4444,color:#000
style A2 fill:#fee2e2,stroke:#ef4444,color:#000
style A3 fill:#fee2e2,stroke:#ef4444,color:#000
style A4 fill:#fee2e2,stroke:#ef4444,color:#000
style B1 fill:#d1fae5,stroke:#10b981,color:#000
style B2 fill:#d1fae5,stroke:#10b981,color:#000
style B3 fill:#d1fae5,stroke:#10b981,color:#000
style B4 fill:#d1fae5,stroke:#10b981,color:#000
style B5 fill:#d1fae5,stroke:#10b981,color:#000
style B6 fill:#d1fae5,stroke:#10b981,color:#000
style B7 fill:#d1fae5,stroke:#10b981,color:#000
style B8 fill:#d1fae5,stroke:#10b981,color:#000Memilih 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:
Best of both worlds.
di-debug oleh siapapun di tim.
connections dengan memory minimal.
COPY dan selesai. 15 MBDocker image.
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.
Search & Catalog 15k SKU Q-Commerce: Relevan + In-Stock Real-time

Real-time Order Tracking Q-Commerce: Driver Bergerak di Peta Live


Promo & Voucher Engine Q-Commerce: Rule Engine Anti-Abuse
