3 ms·
REST resources don't have to map 1-to-1 with your db tables The transaction itself can be a resource This seems almost maybe an argument against taking micros
by anentropic 8y ago
REST resources don't have to map 1-to-1 with your db tables
The transaction itself can be a resource
This seems almost maybe an argument against taking microservices too far until a single service can't own the whole transaction
- vidarh 8y agoThis is a great point, and I think this is a major point of confusion with REST. People think of resources as a table or row with CRUD operations rather than in the wider sense as an object with a generic set of operations to trigger transitions to a new state. It's worth reiterating that REST operations are conceptually much more generic than CRUD. Nothing says that what you GET or PUT/POST need correspond directly to attributes of an object or columns in a database - in the widest sense they simply represent the current state of a resource and a state transition you wish to invoke respectively. The point is not to (only) encode persistent state, but any state. In a sense representing state that is not persisted on the server is more essential - resources that are persistent on the server can be operated on without always sending the full state. But information that is not persisted on the server needs to be encoded and transmitted with the request/response in some way.
- Dowwie 8y agoSo, all of this new tech exists because people have issues with using a resource as an abstraction?