Hacker News new | past | comments | ask | show | jobs | submit login

You equate the central API to the database but they are not equivalent.

The issue is not how much apps depend on them, but maintenance options: in a central-database model, refactoring is high-friction. Whereas an API model can be built so that refactoring is low-friction.

When we talk about composition, we distinguish between data structures that are private to their codebase, and data structures that have a contract between codebases.

In the shared database model, everything is shared, so any change can affect all stakeholders.

The API model respects composition. This allows you to make changes behind the perimeter without the permission of stakeholders. If you want to make a major change to internal data structures, you can retain the old API, offer a new API, and then grandfather apps from the old endpoints to the new endpoints.




I didn’t mean they’re exactly equivalent, but they share the fundamental concern that client code relies on the data structures being passed. In the case of an API, it’s the request parameters and response body — though in a GraphQL API it would look even closer to a DB query.

So, many of these rules still apply: You should only grow an existing API, not shrink it. You shouldn’t rename things in an API. You shouldn’t use the same name with different meanings except in different namespaces/endpoints. Etc.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: