Authors - El Hadji Bassirou TOURE, Ibrahima FALL, Mandicou BA, Alassane BAH Abstract - Microservice architectures offer scalability and deployment benefits but introduce significant data consistency challenges due to distributed data ownership and the necessity of data duplication across services. Current approaches either compromise service autonomy with strong consistency mechanisms or shift complexity to developers. This paper presents Micro-Flex, a novel megamodel-based consistency management framework that treats data entities as component models with formally tracked consistency states.We extend the Modified-Shared-Invalid protocol with differentiated Shared states (Shared+ and Shared−) to accommodate varying consistency requirements while maintaining formal guarantees. Our approach formalizes Global Operation Models (GOMs) as application specifications where consistency states are actively managed through well-defined transition rules. We validate Micro-Flex through an e-commerce case study, demonstrating its effectiveness in balancing consistency guarantees with service autonomy while addressing data duplication challenges. 4 By applying Model-Driven Engineering principles to distributed consistency challenges, our framework contributes to more disciplined data management in microservice architectures.