# gpr-indevelopment/cec-lambda-spring-quarkus-node-benchmark architecture

> Architecture diagram of the GitHub repository gpr-indevelopment/cec-lambda-spring-quarkus-node-benchmark, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gpr-indevelopment/cec-lambda-spring-quarkus-node-benchmark
- Repository: https://github.com/gpr-indevelopment/cec-lambda-spring-quarkus-node-benchmark

## Overview

##### Main Components

a) Test Infrastructure Layer:
- JMeter Load Testing Component
- Cloudwatch Monitoring & Metrics
- Log Insights Component

b) Lambda Functions Layer (3 parallel implementations):
- Spring Cloud Function Implementation
- Quarkus Implementation
- NodeJS Implementation

c) External Dependencies Layer:
- CAMARA API (External Service)

**[Spring] | [Quarkus] | [NodeJS]**

**[Load Testing (JMeter)]**
- ↓
**[Lambda URL Endpoint]**
- ↓
**[Lambda Runtime]**
- ↓
**[Framework Implementation]**
- ↓
**[External API Call]**

##### Important Details

For each Lambda implementation, show:
- Runtime environment (Java 11 Corretto for Spring/Quarkus, NodeJS)
- Handler configurations
- Memory allocation
- Cold start metrics
- Average duration metrics

##### Metrics Visualization

A separate section showing comparative metrics:
- Cold start times
- Memory usage
- Average execution times
- Maximum duration
- Number of invocations

##### Technical Details to Note

For Java implementations:
- Spring: Handler: org.springframework.cloud.function.adapter.aws.FunctionInvoker::handleRequest
- Quarkus: Handler: io.quarkus.amazon.lambda.runtime.QuarkusStreamHandler::handleRequest
- Deployment package types (JAR vs ZIP)

##### Performance Comparison

- Cold start times (Spring: 6.66s, Quarkus: 7.29s, NodeJS: <0.5s)
- Memory usage (Spring: 190.5MB, Quarkus: 157.4MB, NodeJS: significantly less)

Remember to emphasize the performance testing aspect of the architecture, as this is primarily a benchmark comparison project rather than a production system.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Testing
        JM[JMeter Load Testing]
        CW[CloudWatch Monitoring]
        LI[Log Insights]
    end

    subgraph Lambda_Implementations
        subgraph Spring
            SLE["/spring-endpoint"]
            SLF[Spring Cloud Function]
            SC[Spring Configuration]
            SP[Spring Properties]
        end

        subgraph Quarkus
            QLE["/quarkus-endpoint"]
            QLF[Quarkus Lambda]
            QP[Quarkus Properties]
        end

        subgraph NodeJS
            NLE["/node-endpoint"]
            NLF[NodeJS Lambda]
        end
    end

    subgraph Results
        SR[Spring Results]
        QR[Quarkus Results]
        NR[NodeJS Results]
    end

    subgraph External
        CA[CAMARA API]:::external
    end

    %% Connections
    JM --> SLE & QLE & NLE
    SLE --> SLF
    QLE --> QLF
    NLE --> NLF
    SLF & QLF & NLF --> CA
    SLF --> SC
    SC --> SP
    QLF --> QP
    
    %% Monitoring Connections
    SLF & QLF & NLF -.-> CW
    CW -.-> LI
    
    %% Results Connections
    SLF --> SR
    QLF --> QR
    NLF --> NR

    %% Styling
    classDef external fill:#FFA500
    classDef lambda fill:#90EE90
    classDef monitoring fill:#87CEEB
    classDef endpoint fill:#98FB98
    classDef results fill:#DDA0DD

    class CA external
    class SLF,QLF,NLF lambda
    class CW,LI monitoring
    class SLE,QLE,NLE endpoint
    class SR,QR,NR results

    %% Click Events
    click SLF "https://github.com/gpr-indevelopment/cec-lambda-spring-quarkus-node-benchmark/blob/main/functions-spring/src/main/java/io/github/gprindevelopment/CecFunction.java"
    click SC "https://github.com/gpr-indevelopment/cec-lambda-spring-quarkus-node-benchmark/blob/main/functions-spring/src/main/java/io/github/gprindevelopment/FunctionConfiguration.java"
    click QLF "https://github.com/gpr-indevelopment/cec-lambda-spring-quarkus-node-benchmark/blob/main/functions-quarkus/src/main/java/io/github/gprindevelopment/CecLambda.java"
    click NLF "https://github.com/gpr-indevelopment/cec-lambda-spring-quarkus-node-benchmark/blob/main/functions-node.js"
    click JM "https://github.com/gpr-indevelopment/cec-lambda-spring-quarkus-node-benchmark/blob/main/jmeter/Load testing.jmx"
    click SR "https://github.com/gpr-indevelopment/cec-lambda-spring-quarkus-node-benchmark/blob/main/jmeter/Spring results.csv"
    click QR "https://github.com/gpr-indevelopment/cec-lambda-spring-quarkus-node-benchmark/blob/main/jmeter/Quarkus results.csv"
    click NR "https://github.com/gpr-indevelopment/cec-lambda-spring-quarkus-node-benchmark/blob/main/jmeter/Node results.csv"
    click LI "https://github.com/gpr-indevelopment/cec-lambda-spring-quarkus-node-benchmark/blob/main/log-insights-filter.txt"
    click SP "https://github.com/gpr-indevelopment/cec-lambda-spring-quarkus-node-benchmark/blob/main/functions-spring/src/main/resources/application.properties"
    click QP "https://github.com/gpr-indevelopment/cec-lambda-spring-quarkus-node-benchmark/blob/main/functions-quarkus/src/main/resources/application.properties"
```
