Comment on page
Modeling a sample Java-based e-commerce application (Konakart)
This page provides code snippets for each Akamas construct by considering the Konakart, a Java-based e-commerce application (https://www.konakart.com/), as a reference and modeling it as a 2-tier application, with an application server and a database (MySQL) layers.
For simplicity's sake, the optimization use case is defined as follows:
- Optimization scope: JVM parameters
- Optimization goal: reduce the application memory footprint (i.e. heap max that can be allocated by the JVM)
- Optimization constraints: no impact on service level (i.e. response times, throughput, and error rate have to be the same before/after the optimization)
This is the YAML file providing the system definition for the reference use case:
description: Konakart e-commerce application
Since the optimization scope only considers JVM parameters, only a java component needs to be modeled.
The following snippet defines a Konakart java component based on a java-openjdk-11 component type.
name: Konakart jvm
description: jvm layer of Konakart e-commerce
A different optimization scope would have required a different modeling approach. For instance, a broader optimization scope including the Linux layers of both application and database and the database layer would have required 3 additional components: 2 distinct components (of the same component type) for the 2 Linux layers and 1 component for the database layer.
From a monitoring perspective, there are only 2 mandatory data sources: the JVM layer, which will provide the goal metric needed to evaluate the score (heap size), and the web application layer, which will provide the metrics needed to evaluate optimization constraints (response time, throughput and error rate). The web-application component is based on a particular component type that aims to ease the collection of end-users metrics and has no parameters attached. Generally speaking the definition of a component based on the web application component type can be handy every time an optimization foresees the execution of a performance test and it is required to evaluate the end-to-end metrics.
The following snippet defines a Konakart component based on a web-application component type.
description: Web Application layer of Konakart e-commerce
componentType: Web Application
A more comprehensive approach to telemetries could include additional metrics and data sources to provide a better understanding of the system behavior. The example provided only focuses on the mandatory metrics and the components needed to model them.
Here is a (simplified) component types definition for the reference use case.
description: The component type of Java OpenJDK and Oracle HotSpot version 11
- name: jvm_maxHeapSize
domain: [16, 102400]
- name: jvm_gcType
categories: [Serial, Parallel, ConcMarkSweep, G1]
- name: jvm_heap_size
- name: jvm_gc_time
name: Web Application
description: Component-type containing the metrics representing a web application.