📱 Học IELTS miễn phí: App IELTS 6.0
Giới Thiệu
Bạn join dự án mới, mở repository và thấy:
- README.md: “TODO: add docs”
- Wiki: trống trơn
- Architecture diagram: không tồn tại
😱 Kết quả? Mất 2 tuần onboarding thay vì 2 ngày.
Technical documentation (tài liệu kỹ thuật) là kỹ năng mà hầu hết developer đều biết là quan trọng… nhưng ít ai viết tốt, đặc biệt bằng tiếng Anh.
Bài viết này sẽ giúp bạn:
- Hiểu các loại technical documentation
- Nắm cấu trúc chuẩn cho từng loại
- Có template copy-paste ngay được
- Học từ vựng và mẫu câu chuyên dụng
1. Các Loại Technical Documentation
Bảng Tổng Quan
| Loại tài liệu | Mục đích | Đối tượng |
|---|---|---|
| README | Giới thiệu dự án, hướng dẫn cài đặt | Mọi người |
| API Documentation | Mô tả endpoints, request/response | Frontend dev, đối tác |
| Architecture Document | Thiết kế hệ thống tổng quan | Dev team, architect |
| Runbook | Hướng dẫn vận hành, xử lý sự cố | DevOps, SRE |
| ADR (Architecture Decision Record) | Ghi lại quyết định kiến trúc | Dev team hiện tại & tương lai |
| Changelog | Lịch sử thay đổi | Users, dev team |
| Onboarding Guide | Hướng dẫn cho người mới | New team members |
2. README — Bộ Mặt Của Dự Án
README là thứ đầu tiên mọi người đọc. Một README tốt = onboarding nhanh hơn 10 lần.
Cấu Trúc Chuẩn
| |
Usage
| |
Configuration
| Variable | Description | Default |
|---|---|---|
PORT | Server port | 3000 |
DB_URL | Database connection string | - |
Contributing
Please read CONTRIBUTING.md for details.
License
This project is licensed under the MIT License.
Từ Vựng Architecture Document
| English | IPA | Tiếng Việt |
|---|---|---|
| scalability | /ˌskeɪ.ləˈbɪl.ə.ti/ | khả năng mở rộng |
| availability | /əˌveɪ.ləˈbɪl.ə.ti/ | tính sẵn sàng |
| throughput | /ˈθruː.pʊt/ | thông lượng |
| latency | /ˈleɪ.tən.si/ | độ trễ |
| trade-off | /ˈtreɪd.ɒf/ | sự đánh đổi |
| bottleneck | /ˈbɒt.əl.nek/ | nút thắt cổ chai |
| fault tolerance | /fɔːlt ˈtɒl.ər.əns/ | chịu lỗi |
| idempotent | /ˌaɪ.dɛmˈpoʊ.tənt/ | lũy đẳng |
| eventual consistency | /ɪˌven.tʃu.əl kənˈsɪs.tən.si/ | nhất quán cuối cùng |
| single point of failure | /ˌsɪŋ.ɡəl pɔɪnt əv ˈfeɪ.ljər/ | điểm lỗi đơn |
4. Runbook — Sổ Tay Vận Hành
Runbook giúp team xử lý sự cố nhanh chóng mà không cần “người biết” online.
Cấu Trúc Chuẩn
| |
- Identify the problematic pod:
1kubectl logs <pod-name> --tail=100 - Check for recent deployments:
1kubectl rollout history deployment/api-server
Resolution
Option A — Scale horizontally:
| |
Option B — Rollback if caused by recent deploy:
| |
Escalation
If unresolved after 15 minutes, escalate to:
- On-call SRE: #sre-oncall Slack channel
- Engineering Manager: @jane.doe
6. Best Practices — Viết Documentation Tốt
✅ Nên Làm
| Practice | Ví dụ |
|---|---|
| Use active voice | “The system sends a notification” ✅ (không phải “A notification is sent”) |
| Be specific | “Responds within 200ms” ✅ (không phải “Responds quickly”) |
| Include examples | Luôn có code snippet hoặc sample request |
| Keep it updated | Thêm vào Definition of Done: “Update docs” |
| Use consistent terminology | Chọn 1 từ và dùng xuyên suốt (user vs. customer — chọn 1) |
| Add diagrams | “A picture is worth a thousand words” — dùng Mermaid, PlantUML |
❌ Không Nên
| Lỗi thường gặp | Vấn đề |
|---|---|
| “This is self-explanatory” | Không bao giờ self-explanatory cho người mới |
| Quá dài, quá chi tiết | Không ai đọc. Viết ngắn gọn, link đến chi tiết |
| Copy-paste code cũ | Code thay đổi, docs không update = misleading |
| Viết 1 lần rồi quên | Docs outdated = docs dangerous |
7. Từ Vựng Technical Writing
| English | IPA | Tiếng Việt |
|---|---|---|
| prerequisite | /priːˈrek.wɪ.zɪt/ | điều kiện tiên quyết |
| boilerplate | /ˈbɔɪ.lə.pleɪt/ | mẫu có sẵn, code/text lặp lại |
| deprecated | /ˈdep.rə.keɪ.tɪd/ | không còn được khuyên dùng |
| out of scope | /aʊt əv skoʊp/ | ngoài phạm vi |
| edge case | /edʒ keɪs/ | trường hợp biên |
| caveat | /ˈkæv.i.æt/ | lưu ý, cảnh báo |
| verbose | /vɜːrˈboʊs/ | chi tiết, dài dòng |
| concise | /kənˈsaɪs/ | ngắn gọn, súc tích |
| stakeholder | /ˈsteɪk.hoʊl.dər/ | bên liên quan |
| maintainability | /meɪnˌteɪ.nəˈbɪl.ə.ti/ | khả năng bảo trì |
8. Mẫu Câu Thường Dùng Khi Viết Docs
Giới thiệu
- “This document describes the architecture of…”
- “The purpose of this guide is to help developers…”
- “This section covers the setup and configuration of…”
Hướng dẫn
- “To get started, you need to…”
- “Make sure the following dependencies are installed:…”
- “Run the following command to…”
- “See [section] for more details.”
Cảnh báo
- "⚠️ Note: This operation is irreversible."
- "⚠️ Important: Do not run this in production without…"
- “This feature is deprecated and will be removed in v3.0.”
Tham khảo
- “For further reading, see…”
- “Refer to the [API docs] for the full list of endpoints.”
- “This decision is documented in ADR-001.”
9. Practice — Bài Tập Thực Hành
Bài tập 1: Viết README
Chọn một side project của bạn và viết README theo cấu trúc ở mục 2. Đảm bảo có đủ:
- Project description
- Prerequisites
- Installation steps
- Usage examples
- Configuration table
Bài tập 2: Viết ADR
Nghĩ về một quyết định kỹ thuật gần đây (chọn framework, database, hosting…) và viết ADR theo template ở mục 5. Bao gồm:
- Context (tại sao cần quyết định)
- Alternatives considered (so sánh ít nhất 2 lựa chọn)
- Consequences (positive + negative)
Bài tập 3: Sửa lỗi
Các câu sau có vấn đề gì? Viết lại cho tốt hơn:
- “The data is processed by the system.” → Chuyển sang active voice
- “This is fast.” → Thêm con số cụ thể
- “Just run the script.” → Thêm hướng dẫn chi tiết
📝 Đáp án gợi ý
- “The system processes the data.” hoặc “The system processes incoming data within 50ms.”
- “The API responds within 200ms at the 95th percentile.”
- “Run the migration script:
npm run db:migrate. This applies all pending database migrations.”
Kết Luận
“The palest ink is better than the best memory.” — Proverb
Documentation không glamorous, nhưng nó là thứ phân biệt team chuyên nghiệp và team nghiệp dư.
Bắt đầu nhỏ:
- Viết README cho project hiện tại
- Ghi ADR cho quyết định kỹ thuật tiếp theo
- Tạo runbook cho service quan trọng nhất
Mỗi ngày viết thêm một chút — 6 tháng sau, team bạn sẽ cảm ơn bạn (và bạn của 6 tháng trước cũng sẽ cảm ơn chính mình) 📝✨