Backend from First Principles: Complete REST API Design
API design is a critical skill for any backend engineer, and it's a topic you'll spend a significant amount of time working on and thinking about. This post will focus primarily on REST API design , one of the most widely used API standards. While there are other technologies for building APIs like RPC and GraphQL, our focus here will be exclusively on REST. Why REST API Design Matters: Addressing Common Confusions Despite REST being a common standard with years of research and developer experience behind it, engineers, especially those new to backend development, often face confusion. Questions frequently arise such as: Should URI path segments be plural or singular? When updating a resource, should you use PATCH or PUT HTTP methods? For non-CRUD (Create, Read, Update, Delete) operations, often called "action calls," which HTTP method is appropriate? What HTTP status code should be used for different scenarios? This confusion often stems from the fact that when the...