chapter eleven

11 The design of the FTGO 'Create Order saga'

 

This chapter covers

  • The definition of the FTGO Create Order Saga, including its steps, participants and compensating transactions
  • The service architecture that implements the saga
  • The design and implementation of the Create Order Saga orchestrator
  • The communication between the orchestrator and participants

In the previous two chapters, you learned the fundamentals of sagas, the design challenges they introduce and how they are coordinated. Chapter {chapter-sagas} defined the Saga pattern, explained why sagas are ACD rather than ACID, and examined the implications of the lack of isolation, including countermeasures for addressing it. Chapter {chapter-sagas-coordination} explored the two saga coordination mechanisms - choreography and orchestration - and described how each one is implemented.

In this chapter, we apply those concepts to a concrete example and explore the detailed design of the FTGO Create Order saga. We begin with an overview of the FTGO Create Order saga, its definition and the architectural elements that implement it. Next, we examine the implementation of the Create Order Saga's orchestrator. Finally, we look at how the participants handle the commands sent by the orchestrator.

11.1 An overview of the FTGO Create Order saga

11.1.1 The FTGO Create Order Saga definition

11.1.2 The Create Order Saga's orchestrators design

11.1.3 The Eventuate Platform’s Tram Saga framework

11.2 The Create Order Saga orchestrator design

11.2.1 The OrderSagaService class

11.2.2 The CreateOrderSaga orchestrator class

11.2.3 The CreateOrderSagaState class

11.2.4 The OrderService class

11.2.5 The saga participant proxy classes

11.3 The saga participant command handlers

11.4 Summary