4.7. Database Module
4.7.1. Module Files
4.7.1.1. Driver
src/app/engine/database/database.c
src/app/engine/database/database.h
4.7.1.2. Configuration
src/app/engine/config/database_cfg.c
src/app/engine/config/database_cfg.h
4.7.1.3. Unit Test
tests/unit/app/engine/config/test_database_cfg.c
tests/unit/app/engine/database/test_database.c
4.7.2. Detailed Description
The data-exchange module, sometimes also called database ensures a reliable and safe asynchronous data exchange between different tasks and/or software modules. It is implemented based on a producer/consumer pattern. The exchanged data is always produced by a single data producer and then stored in the data-exchange module. Afterwards, it can be used by multiple consumers while the data integrity is always ensured. The concept is shown in Fig. 4.3.
Note
It has to be ensured by SW architecture that every data entry in the Data-Exchange Module is only written by a single data producer! Data integrity can NOT be ensured if multiple data producers write into the same data entry.
4.7.3. Further Reading
A How-to is found in How to Use the Database Module.