Internet of Things (IoT) is a computing infrastructure underlying powerful systems and applications, enabling autonomous interconnection of people, vehicles, devices, and information systems. Many IoT sectors such as smart grid or smart mobility will benefit from the recent evolutions of the smart city initiatives for building more advanced IoT services, from the collection of human-and machine-generated data to their storage and analysis. It is therefore of utmost importance to manage the volume, velocity, and variety of the data, in particular at the IoT gateways level, where data are published and consumed. This paper proposes an access time improvement framework to optimize the publication and consumption steps, the storage and retrieval of data at the gateways level to be more precise. This new distributed framework relies on a consistent hashing mechanism and modular characteristics of microservices to ensure a flexible and scalable solution. Applied and assessed on a real case study, experimental results show how the proposed framework improves data access time for standardized IoT gateways.