A system for managing data in an industrial production environment, the system comprising a distributed database system stored on a first embedded controller and a plurality of second embedded controllers (105A, 105B, 105C, 110A, 110B, 110C), wherein each respective embedded controller is a programmable logic controller, PLC, including a programming logic which comprises instructions for managing an operation of a production device in the industrial production environment, a) the first embedded controller being adapted to execute programming logic to generate process data based on sensor data collected from one or more production devices in the industrial production environment; b) the first embedded controller further comprising a data monitoring module adapted to perform a data monitoring process by: b1) reading the process data and the sensor data during execution of the programming logic, and b2) inserting the process data and the sensor data into a controller database in the first embedded controller, wherein the controller database is part of the distributed database system stored on the first embedded controller and the plurality of second embedded controllers; c) the first embedded controller being further adapted to receive a database processing request; characterized in that d) the first embedded controller being further also adapted to determine one or more of the second embedded controllers storing portions of the distributed database system needed to respond to the database processing request by using a sharding key definition providing a sharding mapping between data stored in the distributed database system and the embedded controllers, the sharding key definition being stored either on each of the embedded controllers or at a centralized server accessible to each of the embedded controllers; e) the first embedded controller further also adapted to transmit a processing instruction to each of the one or more of the plurality of second embedded controllers; f) the first embedded controller being further adapted to receive processed sensor data from the one or more of the plurality of second embedded controllers in response to the processing instruction; g) the first embedded controller further being adapted to create a response to the database processing request by aggregating the processed sensor data; and h) the first embedded controller being also adapted to respond to the database processing request. a) the first embedded controller being adapted to execute programming logic to generate process data based on sensor data collected from one or more production devices in the industrial production environment; b) the first embedded controller further comprising a data monitoring module adapted to perform a data monitoring process by: b1) reading the process data and the sensor data during execution of the programming logic, and b2) inserting the process data and the sensor data into a controller database in the first embedded controller, wherein the controller database is part of the distributed database system stored on the first embedded controller and the plurality of second embedded controllers; b1) reading the process data and the sensor data during execution of the programming logic, and b2) inserting the process data and the sensor data into a controller database in the first embedded controller, wherein the controller database is part of the distributed database system stored on the first embedded controller and the plurality of second embedded controllers; c) the first embedded controller being further adapted to receive a database processing request; characterized in that d) the first embedded controller being further also adapted to determine one or more of the second embedded controllers storing portions of the distributed database system needed to respond to the database processing request by using a sharding key definition providing a sharding mapping between data stored in the distributed database system and the embedded controllers, the sharding key definition being stored either on each of the embedded controllers or at a centralized server accessible to each of the embedded controllers; e) the first embedded controller further also adapted to transmit a processing instruction to each of the one or more of the plurality of second embedded controllers; f) the first embedded controller being further adapted to receive processed sensor data from the one or more of the plurality of second embedded controllers in response to the processing instruction; g) the first embedded controller further being adapted to create a response to the database processing request by aggregating the processed sensor data; and h) the first embedded controller being also adapted to respond to the database processing request.