本篇文章整理了後端開發的各種知識點,可以在每次面試前再次確定自己是否瞭解並能解釋出這些概念。
CS 基礎
- 資料結構與演算法(參考 @meyr543 整理的題庫)
- 作業系統(WIP)
- 網路
Linux
WIP
資料庫(MySQL)
大補帖:architecture notes – Things You Should Know About Databases
- CAP 定理 (分布式系統)
- ACID (關聯式資料庫)
- 正規化
- 反正規化
- Clustered index & Secondary index
- Partition
- range
- list
- hash
- key
- N+1 Query
資料庫(DynamoDB)
murmur 一下
曾經我以為 schemaless 的 DynamoDB 用起來一定比 MySQL 爽
但其實規劃 DynamoDB Table 的心力是 MySQL 的好幾倍
所以我的建議是,如果沒有很清楚的目標,優先使用 MySQL(或其他 RDBMS)
底下列出各議題需要看的資料,有餘力的話可以去 Additional resources 頁面 看看
- 簡介
- From SQL To NoSQL
- Relational or NoSQL?(摘:前者 easy to scale up;後者 easy to scale out、schemaless)
- Characteristics of databases(摘:DynamoDB 用 HTTPS)
- NoSQL design(摘:在弄清楚商業需求以及 Access patterns 之前不要動手設計 DynamoDB Table,原因是 DynamoDB 在 Primary key 及 index 涵蓋範圍以外的查詢都非常沒效率。文末有提到一些很重要的設計原則,值得參考)
- 開發
- 操作實務
- Projection expressions
- Expression attribute names
- Expression attribute values
- Condition expressions
- Update expressions(摘:有專門做 increment 的語法)
- Expiring Items with Time to Live(摘:用 unix time,只把過期且小於五年的資料設為 expired)
- Paginating query results(摘:
LastEvaluatedKey
)
- Primary key design
- Partitions and data distribution(摘:用 PK、Hash function 計算真實儲存位置)
- Distributing workloads(摘:透過精心挑選的 Partition key 避免出現 hot partition)
- Uploading data efficiently(摘:上傳時盡量一次上傳多個 partition 以提高輸入量)
- Sort key design(摘:Sort key 的值,可以表示資料的層級關係,這樣有利查詢。也能用來儲存資料的多個版本。)
- Index design
- Working with indexes(摘要如下)
- GSI:隨時可建、最多 20 張、主鍵組成任選、主鍵可重複
- LSI:建表時就得一併建立、最多 5 張、主鍵能指定的只有 Sort key
- General guidelines(摘:Index 跟 Projection 都是剛好就好)
- Sparse indexes(摘:用來抓出符合特定條件的資料,比如得獎者、進行中的訂單)
- GSI sharding(摘:當原始 Partition key 過於分散,可自訂 GSI PK 以在 GSI 中重新分區)
- Aggregation(摘:用 DynamoDB Streams、Lambda 計算)
- Working with indexes(摘要如下)
- 進階議題
- Security best practices(摘:開靜態加密、用 VPC Endpoint 連線、用 IAM Policy 做存取控制)
- Working with streams
- Working with transactions
- 優化 AWS 服務與 DynamoDB 之間的連線
API
Authentication
- HTTP Basic authorization
- Cookie & Session
- Token authorization
- JWT
- OAuth2
- Identity provider (IdP, SSO)
- Grant types
- Authorization code (for server-side apps like Laravel)
- PKCE (preferred, for web SPA and native apps)
- Client credential (machine to machine)
- Device (for authorizing TV though smartphone)
- OpenID Connect
Security
- OWASP Top 10
- Javascript (source: OWASP Cheat Sheet)
- Hashing algorithm
- Cryptography
- 加密 Encryption
- SSH 安全性
- 雲端安全
- 靜態掃描(SAST, Static application security testing)
- 程式安全
- 日誌保存
- 入侵偵測 Intrusion detection
- 隔離 Isolation
- 安全事件應變 Incident response (WIP, reference)
Development principles
- You aren’t gonna need it (YAGNI)
- Don’t repeat yourself
- SOLID
- S:單一功能
- O:對擴充開放,對修改封閉
- L:Liskov,可以用子類別替換掉父類別
- I:應該從多個類似功能的實作,抽出相同的 API 以作為介面
- D:承上,有介面後就應依賴於介面,而不是依賴於實作
- Design patterns
- Primary key design
- 狀態機
Node.js 語言(source)
參考 https://zh.javascript.info/
- Debugger
- Prototype
- Closure = function + lexical environment
- Getter & Setter
- Event loop
- Timers
setTimeout()
setInterval()
- Pending callbacks (I/O callbacks / exceptions)
- Idle, prepare
- Poll (new I/O event)
- Check
setImmediate()
- Close callbacks
socket.destroy()
- nextTickQueue /
process.nextTick()
- Timers
- call() & decorator
- Websocket
- Browser
- Node.js
搶先發佈留言