How diku-dk/eventbenchmark works
Main Components
• Data Generation Module:
• Represented in the Common/DataGeneration folder. There are two kinds of generators: Synthetic and Real.
• This module uses libraries like Bogus for realistic synthetic data and leverages DuckDB (via DuckDB.NET) to persist and query generated data.
• Configuration Module:
• Shown by the Configuration directory and example configurations in the README. It governs experiment parameters such as transaction ratios, concurrency levels, API endpoints, and more.
• Ingestion Manager:
• Found under Common/Ingestion and related orchestration code that maps data and sends them to the microservice endpoints.
• Workload (Experiment) Manager:
• Related classes in Common/Experiment and Common/Workload. This component manages the experiment’s lifecycle (data population, workload submission, and metrics collection).
• Workers:
• Divided into Customer, Seller, and Delivery workers (located in Common/Workers and further emphasized in dedicated implementations like in Orleans, DriverBench, and Statefun directories).
• Each worker simulates a specific microservice interaction (e.g., customer sessions, seller price adjustments, or delivery updates).
• Metrics and Logging:
• Refer to Common/Metric and common logging utilities in Common/Infra. This portion gathers execution times, transaction counts, and latency metrics.
• Experiment Driver:
• The core driver application (for instance, within DriverBench or the corresponding Program.cs files in Orleans, Statefun, and Dapr projects) orchestrates the overall experiment based on user menu options. It starts data generation, ingestion, and runs experiments.
Relationships and Data Flows
• Data Generation uses these settings to either generate data in-memory or in DuckDB. From here, the Ingestion Manager picks up this data and pushes it to the target data platform (via HTTP API calls).
• The Workload Manager (and associated Worker components) initiates simulated transactions:
• Customer workers simulate actions like cart operations (add item, checkout).
• Seller workers simulate product updates and price adjustments.
• Delivery workers trigger shipment or delivery status updates.
• Each worker communicates via HTTP endpoints, as detailed in the README (for example, /cart/{id}, /customer, /product, etc.).
• Metrics and Logging components continuously collect performance and anomaly data, which is then output to the console and stored in text files for post-run analysis.
• For the Orleans, Statefun, and Dapr implementations, treat each as a distinct sub-system that adheres to the same internal workload orchestration but may have specific internal modules (for instance, the Orleans directory shows Actor-based workers and their respective Experiment Managers).
Architectural Patterns and Technologies
• The design follows a modular, layered approach with a clear separation of concerns:
• The Common layer encapsulates shared entities, data generation, ingestion, metrics, and workload orchestration.
• There is a plug-and-play nature that allows one to swap between Orleans, Statefun, and Dapr implementations depending on the experimental setup.
• From configuration to data generation.
• Then to ingestion (data population).
• Followed by workload submission where each worker interacts with external microservice API endpoints.
• Finally, reporting via metrics collection.
• Technologies to note include .NET 7 as the framework, DuckDB for data handling on Unix-based systems, Dapper for object-relational mapping, and Bogus for synthetic data generation.
Additional Details
• Incorporate the role of the experiment driver’s menu which allows users to select between generating data, ingesting data, or running the experiment.
• Experiment lifecycle, from initialization with the configuration to final post-run tasks (such as cleanup via specific HTTP calls).