# Architecture of Flower Simulation Engine

**URL:** https://discuss.flower.ai/t/architecture-of-flower-simulation-engine/952
**Category:** Flower Help - Beginners
**Created:** [May 7, 2025, 7:58am UTC](https://discuss.flower.ai/t/architecture-of-flower-simulation-engine/952 "2025-05-07T07:58:37Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![lukasb](https://avatars.discourse-cdn.com/v4/letter/l/3d9bf3/32.png) [@lukasb](https://discuss.flower.ai/u/lukasb)
#### Post date: [May 7, 2025, 7:58am UTC](https://discuss.flower.ai/t/architecture-of-flower-simulation-engine/952/1 "2025-05-07T07:58:37Z")

</div>

Hello everyone,  
I am interested in the architecture of the flower simulation engine. I found this page in the docs but as I understand it talks about the deployment engine. Are there big differences between the two and are there any resources on that?  
Thanks in advance!

> **[Flower Architecture](https://flower.ai/docs/framework/explanation-flower-architecture.html)**
>
> Learn about the architecture of a deployed Flower federated learning system, including SuperLink, SuperNodes, multi-tenancy, and the role of SuperExec for managing concurrent training runs.

---

<div class="post-metadata">

### Author: ![javier](https://dub1.discourse-cdn.com/flex013/user_avatar/discuss.flower.ai/javier/32/116_2.png) [@javier](https://discuss.flower.ai/u/javier)
#### Post date: [May 8, 2025, 12:10pm UTC](https://discuss.flower.ai/t/architecture-of-flower-simulation-engine/952/2 "2025-05-08T12:10:10Z")

</div>

Hello @lukasb, there are some differences when comparing the Deployment runtime to the Simulation runtime. However, these differences are only “internal” in the sense that they don’t affect how a `ClientApp` or `ServerApp` are loaded and executed.

The main differences is that for simulations there’s no need for a full blow `SuperLink` and N `SuperNodes`.

- **About SuperLink** : The Simulation runtime uses only the `LinkState` (which you can think of it as proxy service that enables the exchange of `flwr.common.Message` objects between `ServerApp` and `ClientApps`). The rest of the functionality that the `SuperLink` brings around it (e.g. authentication, gRPC connections, TLS, etc – these aren’t needed in simulation) isn’t needed for simulations. The `ServerApp` communicates in-memory with the `LinkState`.
- **About SuperNodes**. In simulations we often want to test scenarios with many (hundreds, thousands) of nodes connected to a server. In “flower terms” this would mean many `SuperNodes` connected to a `SuperLink`. But if you recall from that [Flower Architecture](https://flower.ai/docs/framework/explanation-flower-architecture.html) page and also this one about [Flower Network Network Communication](https://flower.ai/docs/framework/ref-flower-network-communication.html), the main job of a `SuperNode` is: (1) pull a `Message` from the `LinkState`; (2) instantiate a `ClientApp` and pass it that `Message`; (3) return to the `LinkState` the `Message` that the `ClientApp` returns. In Simulations we want this functionality but we don’t need other functionality that `SuperNodes` carry (e.g. authentication, gRPC connections, different _isolation_ for `ClientApps`, etc). Therefore, just like it’s done for the _server side_, we can simplify things a bit in simulation and spawn N(no necessarily the number of SuperNodes you want to simulate) workers that implement the _core_ functionality of a `SuperNode` (i.e. the (1)-(2)-(3) steps mentioned earlier). These processes are fairly simple and you can find them implemented [here](https://github.com/adap/flower/blob/e337909c253c8ff170832da420baeeac6d4c1615/framework/py/flwr/server/superlink/fleet/vce/vce_api.py#L88). We currently use [Ray](https://docs.ray.io/en/latest/index.html) (see the [RayBackend](https://github.com/adap/flower/blob/main/framework/py/flwr/server/superlink/fleet/vce/backend/raybackend.py) if you are curious) to have a simple _resource-aware_ mechanism to run the `ClientApps`. But technically speaking Ray isn’t needed and the same could be achieved with vanilla [ProcessPoolExecutor](https://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.ProcessPoolExecutor).

Happy to dive deeper in some parts of the above description if you are interested. Just let me know! The summary is that when writing `ClientApps` and `ServerApps` you don’t need to worry about whether it runs in simulation or not since the mechanism to communicate `Messages` and execute the `*App` is the same in both simulation and deployment.

---

<div class="post-metadata">

### Author: ![lukasb](https://avatars.discourse-cdn.com/v4/letter/l/3d9bf3/32.png) [@lukasb](https://discuss.flower.ai/u/lukasb)
#### Post date: [May 9, 2025, 12:24pm UTC](https://discuss.flower.ai/t/architecture-of-flower-simulation-engine/952/3 "2025-05-09T12:24:08Z")

</div>

Thanks that already helped me a lot!
