Hi Ido,

[off topic for folks who are just interested in graphs, here be REST things]

> My question is Should I have a generic Transaction resource to allow atomic
> changes to any resource in my service which represent data?

No, I don't think so (unless you mean a transaction in the commercial sense).

Instead I still think I should be able to interact with a "Transfer" resource 
which under the covers might (or might not) need some kind of coordination 
(similar to 2pc). 

If you want to go with that then I suggest both services simple broadcast the 
activities they considered completed (e.g. using an atom feed of events). This 
is a superior solution to that initially suggested by the (flawed IMHO) REST-* 
people.

However I really think that hypermedia wins out here. Instead of a distributed 
2 phase transaction, why not do this instead:

1. Client knows the source and destination account URIs
2. Client PUTs a transfer representation to a transfer resource related to the 
source account, that representation contains the URI of the destination account 
resource
3. The source account service now does a "single-phase" PUT to the destination 
resource.

Any transactions are now under the covers, bounded by a single, repeatable, 
idempotent PUT.

Sweet.

Jim
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to