TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Guys, REST APIs Are Not Databases

4 点作者 dbattaglia将近 7 年前

2 条评论

mpweiher将近 7 年前
I think TFA mixes up the API style with tightly coupling interface to implementation.<p>The problems described are those of directly exposing an implementation as the API.<p>The interesting part of REST in this context is, IMHO, that you can have a database-y or filesystem-y <i>interface</i> that you can implement any way you like.<p>So yes: if you provide an API, think of the API in terms of the interface it should provide to the user. If that interface is CRUD-y&#x2F;REST-y (and a lot are), by all means expose a REST API. Please still decouple it from the implementation, or at least make sure that you <i>can</i> decouple it when things start to drift.
devj将近 7 年前
Agreed. But if lot of developers are using REST for CRUD, then it definitely means that most of the developers desire a CRUD way of server interaction.<p>Any solution?