Method and system for providing data service based on middleware

The invention discloses a method and a system for providing data service based on middleware. The method comprises the following steps: I, receiving a data access request by using a data service middleware device, querying servers in which master and slave libraries corresponding to a service system in a service and database mapping table are positioned, judging whether an access way is data writing operation, and if so, turning to a step II; and II, sending the data access request to the server in which the master library is positioned, storing the data access request in a memory library when data of the master library is updated by the server in which the master library is positioned, scanning the memory library regularly by using the data service middleware device, extracting the data access request from the memory library when the presence of the data access request in the memory library is detected, sending the data access request to the server in which the slave library is positioned, and updating data of the slave library by the server in which the slave library is positioned. The method and the system belong to the technical field of network communication, and can be used for shielding specific database running ways for a service layer and providing uniform data service.