Understanding Data Outside Of Service : SOA

限于喜欢 提交于 2019-12-28 04:28:30

问题


Note: Data outside of service means the message returned by a service and consumed by the client.

I have a service named LastBuyer Service. This will return the last buyer name of a book when I input the bookID to the service. When I call the service for the same book id, it will return different result (if a book is purchased by a new buyer). So I cannot cache the result of the service in the client (for a particular BookID).

While reading the article “Data on the Inside vs. Data on the Outside” it says “Ok to Cache” – “ Since the ID of the message returns the same data, it is OK to cache a message”.

Reference: http://msdn.microsoft.com/en-us/library/ms954587.aspx

  1. What is the missing point in my understanding?

  2. Is the message immutable in above example?

  3. What are the version-dependent and version-independent identifiers in above example?

  4. How is versioning of message done here?

  5. Which is the WCF book that explains SOA concepts and patterns clearly with examples?

READING

  1. Principles of Service Design: Service Patterns and Anti-Patterns

http://msdn.microsoft.com/en-us/library/ms954638.aspx


回答1:


  1. You are missing the fact that (as @Carsten-Konig implies) the data for any given snapshot time is immutable. Unless you go back and fill in old orders, then the last person to buy the book as of 5:00 PM yesterday is always going to be the same. The fact that since then someone has bought the book (resulting in a new version of that data) is irrelevant to yesterday's result. This may or may not be useful data to cache, but as of any given point in time it is immutable.

  2. The message is immutable if part of the message's key is it's timestamp.

  3. The version-independent identifier is the ID of the book. The version-dependent identifier is the snapshot timestamp.

  4. By snapshot timestamp (which again, may or not be useful for caching purposes)

As for a good book on the subject, I'm afraid I can't give recommendations. But I suspect that the reviews on amazon or bn.com are a good place to start.



来源:https://stackoverflow.com/questions/9483286/understanding-data-outside-of-service-soa

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!