InfoQ

Interview

Eric Evans Interviews Greg Young on the Architecture of a Large Transaction System

Interview with Gregory Young by Eric Evans on Jun 24, 2008 08:10 PM

Community
Architecture
Topics
Tags
Repository ,
Transactions ,
Domain Driven Design
Summary
Eric Evans, the author of Domain Driven Design, interviews Greg Young about the architecture implemented for a system processing tens of thousands of transactions per second. It's not just the sheer number of transactions that is challenging, but the time constraints imposed are those specific to real-time systems. Greg reveals some of the architecture elements of the system's design.

Bio
Greg Young is co-founder and CTO of IMIS, a stock market analytics firm in Vancouver BC. With over 10 years of varied experience in computer science from embedded operating systems to business systems and everything in between, he brings a pragmatic and often times unusual viewpoint to discussions.
Hi, I am Eric Evans and I am here with Greg Young who has been doing some very interesting work involving applying Domain Driven Design on an application that has very large transaction binds. So I wanted to know more about what they did and what it led to. Greg can give us a quick summary of what you did and the problems you encountered with the solutions?
Most people think of a repository as this set of abstraction of a collection and objects live there. We go there and ask for an object, we have object state change and the repository puts the new state in. But you found that you had to do it a different way.
So the repository is still responsible for knowing what to do with the state changes.
You've mentioned that these objects can give you their state changes, since they were initialized. Can you tell us the scenario sort of what are some of these state changes?
So every time the best bid goes up you have a best bid increase?
Tell us then the sort of life cycle of an order.
Now at some point all the volume has been removed from an order and then what happens?
Basically your messages, coming from a bounded context, and being kind of transformed by an anticorruption layer and then picked up by some process in another context, which either subscribes to that message or perhaps is the receiving end of a pipeline.
In your case the requirements and the nature of the domain actually makes these delta based objects. Those are actually central concepts. It isn't just like "Ok I had an order and it was for 1000 shares and now it's just for 500 shares." The fact that I executed a trade and that caused a 500 share reduction is an important concept in its own right that you are making explicit.
So I can see how this is clarifying in the model itself and it might have potentially evolved as a domain model without the constraint of the high volume. But tell me something about the implications for this on your ability to scale.
It's is clear that you want a different representation of this data, a different model, than you would in the actual transaction processing.
Basically the message goes out transformed by the anti corruption or by some translator and then goes on through the pipeline.
In the bounded context within where your core is or within the receiving?
That's kind of an example of the analysis and reporting where you use the pipeline. What's an example where you use the publish-subscribe?
Since you mentioned partitioning, what governs the partitioning; you don't replicate all your data on every server.
So there a several symbols related to the Nortel company and you keep all the Nortel symbols together.
Now, this is a pretty interesting example of where the ability to partition across different servers, the understanding of the domain is critical, and the fact that you have modeled these things in ways that allow you to take a company, to know that you can safely take everything of one company and separate from another company's is basically domain knowledge.
Yeah I have seen this. Aggregate boundaries seem to cover several different issues. The one that is talked about in the book most is the transaction boundaries and determining what has to be synchronously kept in sync according to the rules. They make good boundaries for partitioning and distribution.
Since you are actually tracking state change rather than the state primarily, do you look at the state change of the whole aggregate, all these little messages?
Because you say "I want all these state changes from this aggregate", and therefore you are going to deal in that transaction with all the state changes from that record.
If you were going to give people a couple of takeaways of what you have learned from this, what would the critical insights that allowed this scaling to tens of thousands of transactions per second, distribution over many servers, etc. But what are some of its takeaways?
You mean that the subsystem that handles the actual trading is a few seconds ahead of the reporting system.
The things that allowed you to do this were first of all that you represented state changes explicitly and sent those messages across as opposed to reporting of the current state, you report of a stream of changes to state and that you allow these processes to run asynchronously by feeding this message queue from one side and picking it up from the other side.
The other thing I am hearing is that you have one component there which has the most critical need to be up to date, which is the actual transactional processing. This is the part which says "These are the orders, the trades come in and now the orders are adjusted accordingly". That part has to be as close to real time as possible, you probably have some parameters for this. Can you give us a feeling as how far behind can you be on that?
Generally less than 20 milliseconds. Oh, great! That was really interesting, thanks, and I look forward to hearing more about where this leads, and I think that a lot of people can use some of these ideas. This is the first time that I have been an interviewer instead of an interviewee
show all  show all
Domain and Architecture by John Donaldson Posted Jul 3, 2008 8:26 AM
Congratulations! by Rafael Peixoto de Azevedo Posted Aug 8, 2008 6:46 AM
  1. Back to top

    Domain and Architecture

    Jul 3, 2008 8:26 AM by John Donaldson

    Well, very interesting - normal developers don't often get to work on such extreme systems. I would have appreciated a couple of diagrams, and occasionally the dmain knowledge (well, lack of it on my part) got in the way of understanding the application architecture. Lots of follow on questions!

  2. Back to top

    Congratulations!

    Aug 8, 2008 6:46 AM by Rafael Peixoto de Azevedo

    No need for forgiveness! I actually deeply thank you both.

    The reported experience is very rich. The design solutions to address such challenges of speed, reliability and complexity are certainly useful in other design situations.

    I am looking forward to learn more about this excellently done work.

Educational Content

Bindings, Platforms, and Innovation

This presentation focuses on the Internet and separating myth from fact, history from the future, and the mundane from the imaginative. Bob Frankston presents a vision of what could and should be.

Orchestrating Long Running Activities with JBoss / JBPM

This article explores the use of JBoss and jBPM to implement design solutions that effectively address the issue of orchestrating long running activities.

Neo4j - The Benefits of Graph Databases

This presentation covers the use of graph databases as an optimal solution for data that is difficult to fit in static tables, rapidly evolving data or data that has a lot of optional attributes.

Realistic about Risk: Software development with Real Options

This session introduces Real Options and shows how it can help in running your project. Real Options is a decision-making process that can be used to manage risk.

Communication Flexibility Using Bindings

This article discusses the use of bindings on services and references (including the instance of non-configured bindings) as the means to implement SCA communications in a Web and SOA environment.

Writing DSLs in Groovy

After a short introduction to DSLs, Scott Davis plays with the keyboard showing how to approach the creation of a DSL by typing working snippets of Groovy code that get executed.

Scaling Agile with C/ALM (Collaborative Application Lifecycle Management)

IBM Rational and InfoQ present, Scaling Agile with C/ALM, an eBook showing organizations how to become “finely tuned software delivery machines” by enabling team integration and scaling.

Concurrent Programming with Microsoft F#

Amanda Laucher presents a real life enterprise application written in F#. She shows actual code snippets, explaining design decisions and suggesting how to use some of the F# constructs.