Dealing with errors in asynchronous write schemes
The idea of asynchronous write, or write-behind, is that clients submit a request for a write operation, a开发者_开发百科nd then go their merry way without waiting for the write operation to conclude.
What isn't clear to me from my reading on the subject is how errors might be handled in case they happen. One strategy might be to log and ignore them. OK, so I suppose the client then has to cope when subsequent read operations fail. What strategies are employed to deal with inevitable write failures? Are they exposed to the user in any way? I can imagine some very odd application behaviour. Imagine if the database went down, and several write operations were performed (from the client's point of view) without any persistence in fact occurring.
Take a look at CQRS.
See Greg Young's explanation:
http://codebetter.com/gregyoung/2010/02/16/cqrs-task-based-uis-event-sourcing-agh/
hope this helps.
精彩评论