Some good replies for the first quiz. So continuing on from the last quiz, would the solutions already proposed change if the trades were received on the message bus within a transaction?
is an old blog entry by Werner, but is still relevant today. I'd be curious to know if anyone has any information on how these sites have evolved since 2003.
There are n readers reading trades (XML format) off a message bus. Each trade has an ID and a version number. Differing trade ID's can be processed in parallel; Trade ID 1234 and Trade 1237 can be processed in parallel. Trades with the same ID, but different version numbers must be processed in version number order; Trade ID 1234 Version 2 must be processed after Trade ID 1234 Version 1. Trades can arrive on the message bus in any order. There is no limit to the number of Trade ID's.
Design an architecture which will allow trades to be processed in the most efficient manner (scalability and performance are key). One key issue that the architecture needs to solve is how to ensure that versions of a trade are processed in the correct order. If the assumption is that each reader in a separate thread, then each version of a trade might be read be a different reader in the worst case scenario....