Backend API design principles: Don’t mirror your data
February 27, 2023It’s very common to model your backend API as a set of endpoints that mirror your internal data model. For example, consider a blog engine, which may have:
GET /users/{id}: retrieves information about a specific user, where {id} is the ID of the user
GET /users/{id}/posts: retrieves a list of all posts made by a specific user, where {id} is the…