Skip to content

FTGO Application Modeling with TOSCA

In order to identify further required adaptions or extensions, Richardson's FTGO Application1 was modeled. Richardson introduced the FTGO application in his book "Microservices Patterns" [1]. The application is used throughout the book to illustrate and explain the different patterns and concepts he presents. The following description and mapping consider the latest version of the application's code available on Github1 combined with some of its descriptions in Richardson's book [1]. At some points, the code deviates from the book descriptions, for example, by providing additional services. Therefore, the focus lies on the code. However, since the code is still under development, some functions are currently only mocked. For these, suitable assumptions based on the book and the repository descriptions will be made.

Further information about the modeling using the original version of TOSCA can be found here: Original TOSCA.

In addition, the FTGO Application is also modeled using the proposed extension for TOSCA to verify that the extension is able to successfully represent all thirteen entities of the quality model. More detailed information about the modeling using the extended version can be found here: Extended TOSCA.


General Overview

The following table summarizes how the different architectural elements of the FTGO Application1 were mapped to the proposed entities of the CNA quality model1.

Proposed Entity
FTGO Application Element
System FTGO Application
Component {Service} | {Backing Service} | {Storage Backing Service}
Service Order Service | Restaurant Service | Delivery Service | Consumer Service | Kitchen Service | Accounting Service | Order History Service
Endpoint {Endpoint Mapping Table}
External Endpoint GET /orders?consumerId={consumerId} | GET /orders/{orderId} | POST /orders | POST /orders/{orderId}/revise | POST /orders/{orderId}/cancel | POST /consumers
Backing Service API Gateway | CDC Service | Kafka | Zookeeper | Zipkin
Storage Backing Service ftgo_consumer_service | ftgo_order_service | ftgo_kitchen_service | ftgo_restaurant_service | ftgo_accounting_service | ftgoorderhistoryservice | ftgo_accounting_service | ftgo_delivery_service | eventuate | DynamoDbLocal
Link {Link Mapping Table}
Infrastructure MySQL | DynamoDb | Docker Host | Local Computer
Deployment Mapping {Service | Backing Service} – hosted-on – Docker Host |
DynamoDbLocal – hosted-on – DynamoDb | DynamoDb – hosted-on – Docker Host |
{remaining Storage Backing Service} – hosted-on – MySQL | MySQL – hosted-on – Docker Host |
Docker Host – hosted-on – Local Computer
Request Trace {Request Trace Mapping Table}
Data Aggregate Order | Restaurant | Consumer | Ticket | Account
Backing Data Kafka Server | Zookeeper Connection | Datasource Credentials \& Configuration | Logging Configuration | Endpoints Configuration | EventuateTram Configuration | Spring Configuration | Metrics

Mapped Endpoint Entities

The different Request Trace entities included in the example application. Although the original specification of the entities2 defined that only Service entities can have Endpoints, the following table also provides Endpoints for Backing Service and Storage Backing Service entities. This is due to the fact that otherwise, some Link entities would directly point to specific Endpoints, whereas otherwise would not. Therefore, in order to use a consistent representation of Link entities, it was decided to change the entity specification such that Endpoints and External Endpoint entities are part-of Component instead of Service. Then, Backing Service entities and Storage Backing Service entities can also define Endpoints, as the following table does.

FTGO Application Element
Order Service POST /orders
POST /orders/{orderId}/cancel
POST /orders/{orderId}/revise
GET /orders/{orderId}
GET /restaurants/{restaurantId}
Restaurant Service POST /restaurants
GET /restaurants/{restaurantId}
Delivery Service POST /couriers/{courierId}/availability
GET /deliveries/{deliveryId}
GET /deliveries?orderId={orderId}3
Consumer Service POST /consumers
GET /consumers/{consumerId}
Kitchen Service POST /tickets/{ticketId}/accept
GET /restaurants/{restaurantId}
GET /tickets?orderId={orderId}3
Accounting Service GET /accounts/{accountId}
GET /charges?orderId={orderId}3
Order History Service GET /orders?consumerId={consumerId}
Get /orders/{orderId}
Kafka For each topic exists a send-to and receive-from endpoint:
orderService Topic
consumerService Topic
kitchenService Topic
accountingService Topic
net.chrisrichardson.ftgo.orderservice.domain.Order Topic
net.chrisrichardson.ftgo.restaurantservice.domain.Restaurant Topic
net.chrisrichardson.ftgo.consumerservice.domain.Consumer Topic
net.chrisrichardson.ftgo.kitchenservice.domain.Ticket Topic
net.chrisrichardson.ftgo.orderservice.createorder.CreateOrderSaga-reply Topic
net.chrisrichardson.ftgo.orderservice.reviseorder.ReviseOrderSaga-reply Topic
net.chrisrichardson.ftgo.orderservice.cancelorder.CancelOrderSaga-reply Topic
CDC Service, Zookeeper & Zipkin4 /connect
DynamoDbLocal5 /key-value
ftgo_consumer_service, ftgo_order_service, ftgo_kitchen_service, ftgo_restaurant_service, ftgo_accounting_service, ftgoorderhistoryservice, ftgo_accounting_service, ftgo_delivery_service, eventuate5 /sql

The various Link entities included in the example application.

Proposed Entity
FTGO Application Element
Link Order Service – subscribes-to – Kafka: orderService Topic receive-from
Order Service – subscribes-to – Kafka: Restaurant Topic receive-from
Order Service – subscribes-to – Kafka: CreateOrderSaga-reply Topic receive-from
Order Service – subscribes-to – Kafka: ReviseOrderSaga-reply Topic receive-from
Order Service – subscribes-to – Kafka: CancelOrderSaga-reply Topic receive-from
Order Service – connects-to – Zookeeper: /connect
Order Service – connects-to – Zipkin: /connect
Order Service – connects-to – ftgo_order_service: /sql

Restaurant Service – connects-to – Zookeeper: /connect
Restaurant Service – connects-to – ftgo_restaurant_service: /sql

Delivery Service – subscribes-to – Kafka: Order Topic receive-from
Delivery Service – subscribes-to – Kafka: Restaurant Topic receive-from
Delivery Service – subscribes-to – Kafka: Ticket Topic receive-from
Delivery Service – connects-to – Zookeeper: /connect
Delivery Service – connects-to – Zipkin: /connect
Delivery Service – connects-to – ftgo_delivery_service: /sql

Consumer Service – subscribes-to – Kafka: consumerService Topic receive-from
Consumer Service – connects-to – Zookeeper: /connect
Consumer Service – connects-to – ftgo_consumer_service: /sql

Kitchen Service – subscribes-to – Kafka: kitchenService Topic receive-from
Kitchen Service – subscribes-to – Kafka: Restaurant Topic receive-from
Kitchen Service – connects-to – Zookeeper: /connect
Kitchen Service – connects-to – ftgo_kitchen_service: /sql

Accounting Service – subscribes-to – Kafka: accountingService Topic receive-from
Accounting Service – subscribes-to – Kafka: Consumer Topic receive-from
Accounting Service – connects-to – Zookeeper: /connect
Accounting Service – connects-to – ftgo_accounting_service: /sql

Order History Service – subscribes-to – Kafka: Order Topic receive-from
Order History Service – connects-to – Zookeeper: /connect
Order History Service – connects-to – DynamoDbLocal: /key-value

API Gateway – routes-to – Order Service: "GET/orders/{orderId}"
API Gateway – routes-to – Order Service: "POST /orders"
API Gateway – routes-to – Order Service: "POST /orders/{orderId}/revise"
API Gateway – routes-to – Order Service: "POST /orders/{orderId}/cancel"
API Gateway – routes-to – Delivery Service: "GET /deliveries?orderId={orderId}"
API Gateway – routes-to – Consumer Service: "POST /consumers"
API Gateway – routes-to – Kitchen Service: "GET /tickets?orderId={orderId}"
API Gateway – routes-to – Accounting Service: "GET /charges?orderId={orderId}"
API Gateway – routes-to – Order History Service: "GET /orders?consumerId={consumerId}"

CDC Service – publishes-to – Kafka: orderService Topic send-to
CDC Service – publishes-to – Kafka: consumerService Topic send-to
CDC Service – publishes-to – Kafka: kitchenService Topic send-to
CDC Service – publishes-to – Kafka: accountingService Topic send-to
CDC Service – publishes-to – Kafka: Order Topic send-to
CDC Service – publishes-to – Kafka: Restaurant Topic send-to
CDC Service – publishes-to – Kafka: Consumer Topic send-to
CDC Service – publishes-to – Kafka: Ticket Topic send-to
CDC Service – publishes-to – Kafka: CreateOrderSaga-reply Topic send-to
CDC Service – publishes-to – Kafka: ReviseOrderSaga-reply Topic send-to
CDC Service – publishes-to – Kafka: CancelOrderSaga-reply Topic send-to
CDC Service – connects-to – Zookeeper: /connect
CDC Service – reads-from – ftgo_order_service: /sql
CDC Service – reads-from – ftgo_restaurant_service: /sql
CDC Service – reads-from – ftgo_delivery_service: /sql
CDC Service – reads-from – ftgo_consumer_service: /sql
CDC Service – reads-from – ftgo_kitchen_service: /sql
CDC Service – reads-from – ftgo_accounting_service: /sql
CDC Service – reads-from – ftgoorderhistoryservice: /sql
CDC Service – connects-to – eventuate: /sql

Kafka – connects-to – Zookeeper: /connect

Mapped Request Trace Entities

The different Request Trace entities included in the example application.

Proposed Entity FTGO Application Element
Request Trace "GET /orders?consumerId={consumerId}":
Trace[API Gateway, Order History Service, DynamoDbLocal,
API Gateway – routes-to – Order History Service: "GET /orders?consumerId={consumerId}",
Order History Service – connects-to – DynamoDbLocal: /key-value]
"GET /orders/{orderId}":
Trace[API Gateway, Order Service, Kitchen Service, Delivery Service, Accounting Service, ftgo_order_service, ftgo_kitchen_service, ftgo_delivery_service, ftgo_accounting_service,
API Gateway – routes-to – Order Service: "GET/orders/{orderId}",
Order Service – connects-to – ftgo_order_service: /sql,
API Gateway – routes-to – Kitchen Service: "GET /tickets?orderId={orderId}",
Kitchen Service – connects-to – ftgo_kitchen_service: /sql,
API Gateway – routes-to – Delivery Service: "GET /deliveries?orderId={orderId}",
Delivery Service – connects-to – ftgo_delivery_service: /sql,
API Gateway – routes-to – Accounting Service: "GET /charges?orderId={orderId}",
Accounting Service – connects-to – ftgo_accounting_service: /sql]
"POST /orders":
Trace[API Gateway, Order Service, Consumer Service, Kitchen Service, Accounting Service, CDC Service, Delivery Service, Order History Service, Kafka, ftgo_order_service, ftgo_consumer_service, ftgo_kitchen_service, ftgo_accounting_service,
API Gateway – routes-to – Order Service: "POST /orders",
Order Service – connects-to – ftgo_order_service: /sql,
CDC Service – reads-from – ftgo_order_service: /sql,
CDC Service – publishes-to – Kafka: consumerService Topic send-to,
Consumer Service – subscribes-to – Kafka: consumerService Topic receive-from,
Consumer Service – connects-to – ftgo_consumer_service: /sql,
CDC Service – reads-from – ftgo_consumer_service: /sql,
CDC Service – publishes-to – Kafka: CreateOrderSaga-reply Topic send-to,
Order Service – subscribes-to – Kafka: CreateOrderSaga-reply Topic receive-from,
CDC Service – publishes-to – Kafka: kitchenService Topic send-to,
Kitchen Service – subscribes-to – Kafka: kitchenService Topic receive-from,
Kitchen Service – connects-to – ftgo_kitchen_service: /sql,
CDC Service – reads-from – ftgo_kitchen_service: /sql,
CDC Service – publishes-to – Kafka: accountingService Topic send-to,
Accounting Service – subscribes-to – Kafka: accountingService Topic receive-from,
Accounting Service – connects-to – ftgo_accounting_service: /sql,
CDC Service – reads-from – ftgo_accounting_service: /sql,
CDC Service – publishes-to – Kafka: orderService Topic send-to,
Order Service – subscribes-to – Kafka: orderService Topic receive-from,
CDC Service – publishes-to – Kafka: Order Topic send-to,
CDC Service – publishes-to – Kafka: Ticket Topic send-to,
Order History Service – subscribes-to – Kafka: Order Topic receive-from,
Delivery Service – subscribes-to – Kafka: Order Topic receive-from]
"POST /orders/{orderId}/revise":
Trace[API Gateway, Order Service, Kitchen Service, Accounting Service, CDC Service, Kafka, ftgo_order_service, ftgo_kitchen_service, ftgo_accounting_service,
API Gateway – routes-to – Order Service: "POST /orders/{orderId}/revise",
Order Service – connects-to – ftgo_order_service: /sql,
CDC Service – reads-from – ftgo_order_service: /sql,
CDC Service – publishes-to – Kafka: orderService Topic send-to,
Order Service – subscribes-to – Kafka: orderService Topic receive-from,
CDC Service – publishes-to – Kafka: ReviseOrderSaga-reply Topic send-to,
Order Service – subscribes-to – Kafka: ReviseOrderSaga-reply Topic receive-from,
CDC Service – publishes-to – Kafka: kitchenService Topic send-to,
Kitchen Service – subscribes-to – Kafka: kitchenService Topic receive-from,
Kitchen Service – connects-to – ftgo_kitchen_service: /sql,
CDC Service – reads-from – ftgo_kitchen_service: /sql,
CDC Service – publishes-to – Kafka: accountingService Topic send-to,
Accounting Service – subscribes-to – Kafka: accountingService Topic receive-from,
Accounting Service – connects-to – ftgo_accounting_service: /sql,
CDC Service – reads-from – ftgo_accounting_service: /sql,
CDC Service – publishes-to – Kafka: Ticket Topic send-to,
CDC Service – publishes-to – Kafka: Order Topic send-to]
"POST /orders/{orderId}/cancel":
Trace[API Gateway, Order Service, Kitchen Service, Accounting Service, Delivery Service, Order History Service, CDC Service, Kafka, ftgo_order_service, ftgo_kitchen_service, ftgo_accounting_service,
API Gateway – routes-to – Order Service: "POST /orders/{orderId}/cancel",
Order Service – connects-to – ftgo_order_service: /sql,
CDC Service – reads-from – ftgo_order_service: /sql,
CDC Service – publishes-to – Kafka: orderService Topic send-to,
Order Service – subscribes-to – Kafka: orderService Topic receive-from,
CDC Service – publishes-to – Kafka: CancelOrderSaga-reply Topic send-to,
Order Service – subscribes-to – Kafka: CancelOrderSaga-reply Topic receive-from,
CDC Service – publishes-to – Kafka: kitchenService Topic send-to,
Kitchen Service – subscribes-to – Kafka: kitchenService Topic receive-from,
Kitchen Service – connects-to – ftgo_kitchen_service: /sql,
CDC Service – reads-from – ftgo_kitchen_service: /sql,
CDC Service – publishes-to – Kafka: accountingService Topic send-to,
Accounting Service – subscribes-to – Kafka: accountingService Topic receive-from,
Accounting Service – connects-to – ftgo_accounting_service: /sql,
CDC Service – reads-from – ftgo_accounting_service: /sql,
CDC Service – publishes-to – Kafka: Ticket Topic send-to,
CDC Service – publishes-to – Kafka: Order Topic send-to,
Delivery Service – subscribes-to – Kafka: Ticket Topic receive-from,
Order History Service – subscribes-to – Kafka: Order Topic receive-from]
"POST /consumers":
Trace[API Gateway, Consumer Service, Accounting Service, CDC Service, Kafka, ftgo_consumer_service,
API Gateway – routes-to – Consumer Service: "POST /consumers",
Consumer Service – connects-to – ftgo_consumer_service: /sql,
CDC Service – reads-from – ftgo_consumer_service: /sql,
CDC Service – publishes-to – Kafka: Consumer Topic send-to,
Accounting Service – subscribes-to – Kafka: Consumer Topic receive-from]

References

[1] Chris Richardson, "Microservices Patterns: With Examples in Java". Manning Publications, 1st edition, November 2018. ISBN 9781617294549.


  1. last accessed: 2022-03-29 

  2. https://github.com/r0light/cna-quality-model/tree/0.1, last accessed: 2022-03-29 

  3. Currently not yet included in the implementation but described in the book [1, p. 224] 

  4. Default Endpoint for connection purposes 

  5. Generic database Endpoints 


Last update: 2022-08-31
Back to top