4 ms·
Rest is more like a database: a data/resource model, with a fixed set of operations you can use on this model. RPC is like stored procedures in a database. Som
by ako 4y ago
Rest is more like a database: a data/resource model, with a fixed set of operations you can use on this model.
RPC is like stored procedures in a database. Some databases implementations only provide access to data through stored procedures, hiding the underlying tables.
The first is usually more flexible to the client, he can decide what data it needs. RPC in a database is gives the server more control over the client: what data it can get, how it can be retrieved/manipulated. This introduces tighter coupling between client and server, which can be a problem is you have many unknown 3rd party clients.
- itake 4y agoThe "data/resource" model also "hides the underlying tables". For example, `POST users/1/emails` might "create" an email, but really its triggering a API call to an external service. I am not seeing the difference between REST and RPC.