Skip to content

Backend Languages Comparison

Mở đầu

"Tôi nên học Python, Java, hay Go?" Câu hỏi phỏng vấn + của mọi newbie. Không có ngôn ngữ tốt nhất, chỉ có ngôn ngữ phù hợp scenario. Chương này so sánh ngôn ngữ BE mainstream, framework + cách chọn.


1. Sao quan tâm BE language?

  • Năng suất: rapid build prototype hay enterprise robust
  • Performance: web app I/O-bound hay high-frequency trading
  • Ecosystem: lib hỗ trợ rộng không
  • Team: học cost, tuyển dụng

2. Core concepts

2.1 Compiled vs Interpreted

TypeVdSpeedDev speed
CompiledC, Rust, GoCực nhanhBuild step trước run
InterpretedPython, RubyChậm hơnRun trực tiếp source
JIT (Just-In-Time)Java, C#, JS V8Trung-nhanhBalance

2.2 Static vs Dynamic typing

TypeVdProsCons
StaticJava, Go, TypeScriptCatch error compile, refactor an toànVerbose hơn
DynamicPython, Ruby, JSConcise, flexibleBug ở runtime

2.3 Concurrency model

  • Multi-thread: Java, C++
  • Async I/O: Node.js, FastAPI
  • Coroutine: Go (goroutine), Kotlin
  • Actor: Erlang, Elixir

3. Mainstream BE languages

3.1 Python

  • Strengths: AI/ML dominant, syntax đẹp, dev speed nhanh
  • Frameworks: FastAPI (modern, async), Django (batteries-included), Flask (minimal)
  • Use: AI app, data pipeline, prototype, internal tool
  • Companies: Instagram, Spotify, Dropbox, OpenAI

3.2 JavaScript / TypeScript

  • Strengths: same lang FE + BE, ecosystem cực lớn (npm), async native
  • Runtime: Node.js, Bun, Deno
  • Frameworks: Express, NestJS (enterprise), Hono (edge), Fastify
  • Use: real-time app, BFF (Backend for Frontend), serverless
  • Companies: Netflix, LinkedIn, PayPal, Uber

3.3 Go

  • Strengths: simple syntax, goroutine concurrency, fast compile, single binary deploy
  • Frameworks: Gin, Echo, Fiber, gRPC native
  • Use: microservice, API gateway, DevOps tool (Docker, K8s viết bằng Go), high-concurrency
  • Companies: Google, Uber, Twitch, Cloudflare

3.4 Java

  • Strengths: enterprise mature, JVM ecosystem (Scala, Kotlin), perf cao với JIT
  • Frameworks: Spring Boot (dominant), Quarkus (cloud-native), Micronaut
  • Use: enterprise app, banking, Android backend
  • Companies: Netflix, Google, Amazon (1 phần), most banks

3.5 C# / .NET

  • Strengths: Microsoft ecosystem, cross-platform với .NET Core, productive
  • Frameworks: ASP.NET Core, Blazor
  • Use: enterprise (đặc biệt Microsoft shop), Unity game backend
  • Companies: Microsoft, Stack Overflow

3.6 Ruby

  • Strengths: developer happiness, convention over configuration
  • Frameworks: Rails (legendary), Sinatra (minimal)
  • Use: Rails app startup, prototype
  • Companies: GitHub, Shopify, Airbnb (1 phần)

3.7 Rust

  • Strengths: memory safe + perf cao, zero-cost abstraction, growing ecosystem
  • Frameworks: Actix Web, Axum, Rocket
  • Use: system programming, high-perf API, edge compute, AI inference engine
  • Companies: Cloudflare, Discord, Dropbox

3.8 PHP

  • Strengths: web pioneer, easy deploy, huge legacy
  • Frameworks: Laravel (popular), Symfony (enterprise)
  • Use: WordPress site, legacy enterprise web
  • Companies: Facebook (1 phần legacy), Wikipedia, WordPress

3.9 Kotlin

  • Strengths: Java interop 100%, modern syntax, null safety
  • Frameworks: Spring Boot (Kotlin support), Ktor (Kotlin native)
  • Use: Android backend, modern JVM service
  • Companies: Google, Pinterest

3.10 Elixir

  • Strengths: actor model (BEAM VM), fault-tolerant, realtime
  • Frameworks: Phoenix (LiveView mainstream)
  • Use: chat, IoT, realtime
  • Companies: Discord, Pinterest, WhatsApp (Erlang)

4. Decision framework

Question 1: Project type?

TypeRecommended
AI/ML appPython (FastAPI)
Realtime chatElixir / Node.js / Go
Microservice high concurrencyGo / Rust
Enterprise CRM/ERPJava (Spring) / C# (.NET)
Quick MVPPython (FastAPI/Django) / Ruby (Rails) / Node.js (Express)
BFF for frontendNode.js / TypeScript
System toolGo / Rust
Mobile backendKotlin / Swift (server-side)

Question 2: Team skill?

  • Team FE đã có TS → Node.js + NestJS
  • Team Python → FastAPI
  • Team Java legacy → Spring Boot
  • Team mới, no preference → Go (đơn giản, perf tốt)

Question 3: Scale predicted?

  • <100k user → bất kỳ ngôn ngữ nào OK
  • 100k-1M → Go, Java, .NET
  • 1M (Discord-scale) → Elixir, Rust, custom


5. Real case: tech stack evolution

Twitter

  1. Rails (Ruby) → quick to market
  2. Scala/JVM → scale issue, migrate gradually
  3. Java services + Scala ongoing

Shopify

  • Rails (Ruby) consistent → world-class scale by optimization

Discord

  • Python first → Go (presence service) → Elixir (gateway) → Rust (core, low-latency)

Lý do:

  • Không phải "ngôn ngữ tệ", mà scale + use case đặc thù
  • Migrate là quá trình, không 1 lần

6. Common misconceptions

MisconceptionTruth
"Go > Python vì faster"Python đủ nhanh cho 95% web app, Python dev speed nhanh hơn Go
"Rails đã chết"Shopify, GitHub vẫn dùng Rails, perf ổn
"Java verbose, không dùng nữa"Java vẫn dominant enterprise + có Kotlin, Java 21 modern
"Node.js single-thread chậm"Async I/O cực nhanh cho I/O-bound, dùng cluster cho CPU-bound
"Rust quá khó"Cost cao, nhưng worth cho high-perf core service

6.1 Niche + emerging BE languages

  • Crystal: Ruby-like syntax + compiled speed
  • Nim: Python-like syntax + C performance
  • Zig: alternative C, manual memory mgmt + simplicity
  • Gleam: typed functional language trên BEAM (Erlang VM)
  • OCaml (Jane Street, Facebook Infer): functional, strong type

6.2 Language scope overview

System programming (OS, driver, embedded):  C, C++, Rust, Zig
Cloud-native microservice:                  Go, Rust, Java (Quarkus)
AI/ML/data:                                  Python (dominant), R, Julia
Enterprise web:                              Java, C#, PHP (Laravel)
Modern web API:                              Node.js, Go, Python (FastAPI)
Realtime / messaging:                        Elixir, Go, Rust
Mobile backend:                              Kotlin, Swift (server)
Quick prototype:                             Python, Ruby, Node.js

7. Tổng kết

Không có silver bullet, chỉ có trade-off:

OptimizePick
Dev speedPython, Ruby, Node.js
ConcurrencyGo, Elixir, Rust
Enterprise complianceJava, C#
AI/MLPython
Performance ceilingRust, C++
Realtime + fault-tolerantElixir
Same lang FE + BETypeScript
Single binary deployGo, Rust

8. Learning resources


9. Glossary

TermNote
GCGarbage Collector
JITJust-In-Time compilation
AOTAhead-Of-Time compilation
Static typingType check compile time
Dynamic typingType check runtime
CoroutineLightweight thread, user-space
Actor modelConcurrency model với isolated actor + message passing
REPLRead-Eval-Print Loop
GILGlobal Interpreter Lock (Python)
JVMJava Virtual Machine
BEAMErlang/Elixir VM

Selection = art, không phải science

Choose based on:

  1. Team skill (most important)
  2. Project requirements
  3. Ecosystem maturity
  4. Long-term maintenance cost

Đừng theo hype. Java boring nhưng work, Rust hype nhưng cost cao.

2026 cho VN dev

  • VN startup trend: Python (AI), Node.js (web), Go (system)
  • VN enterprise: Java + Spring Boot dominant (banking, telecom, fintech)
  • VN agency: Node.js + Laravel phổ biến
  • High-growth area: Go (microservice), Rust (performance-critical), Elixir (Phoenix dev là niche nhưng valuable)
  • AI era: Python skill = essential cho mọi BE dev (LLM, vector DB, AI integration)
  • Career tip: master 1 ngôn ngữ deep + biết 2-3 ngôn ngữ khác → competitive

Phụ lục: BE language application full map

C / C++: vua system language

OS kernel, driver, game engine (Unreal), embedded, HFT.

Rust: ngôi sao memory safety

Cloudflare, Discord, Dropbox migration. Tokio async runtime. WebAssembly support tốt.

Python: lang #1 AI/data

TensorFlow, PyTorch, NumPy, Pandas. FastAPI cho web modern. Django cho admin-heavy.

JS/TS: Web fullstack king

Node.js mature, Bun fast, Deno secure. NestJS enterprise.

Go: cloud-native first

Docker, K8s, Terraform viết bằng Go. Goroutine concurrency thiên tài.

Java: evergreen enterprise

Spring Boot, JVM perf tốt với JIT, Kotlin cho modern syntax.

Node.js: revolution fullstack JS

Async event loop, npm ecosystem khổng lồ.

PHP: web pioneer

WordPress (40% web), Laravel modern.

Quick decision guide

  • AI/data: Python
  • High concurrency microservice: Go
  • Enterprise robust: Java
  • Same as FE: TypeScript
  • Performance critical: Rust
  • Realtime fault-tolerant: Elixir
  • WordPress / legacy web: PHP