Understanding Data Outside Of Service : SOA
Asked Answered
A

1

1

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

Andi answered 28/2, 2012 at 14:0 Comment(2)
I guess you could fix this by giving a time in addition to the id of the book (get me the last buyer before this time) and never giving a time in the future - so your server call resembles a real function and you can cache (but the caching will be rather pointless) - I think caching is only usefull if you query data that won't change anymore ...Crosshead
@Carsten Thanks. So what the statment means is we need to make message immutable by receiving such inputs (mentioned in your comment). Is my understanding correct? Also, can you please explain other parts of the question?Andi
P
2
  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.

Pokelogan answered 2/3, 2012 at 16:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.