3 ms·
Use REST for reading, but RPC-style calls for writing. Benefits: 1. Every write-call is a transaction 2. You can have complex filtering and sorting in the rea
by cel1ne 6y ago
Use REST for reading, but RPC-style calls for writing.
Benefits:
1. Every write-call is a transaction
2. You can have complex filtering and sorting in the read/access side of your API without having to worrying about the update-side of things.
3. You can evolve the read-API, even change semantics and return different objects and again, not worry about transactions.
4. You are not limited to the HTTP-standard.
Here are also some good tips: https://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api https://www.vinaysahni.com/best-practices-for-a-pragmatic-re...