主权项 |
1. A method for providing a persistence layer to an application, the method comprising:
receiving, from the application, an entity-level persistence command for an entity of the application, the entity comprising an object of the application that can be persisted; retrieving metadata associated with the entity, wherein the metadata specifies a set of persistence requirements associated with the entity, a virtual instruction set, and an entry point to a virtual instruction in the virtual instruction set associated with the received entity-level persistence command, the persistence requirements including a volume of processed data, a partition tolerance, or a latency; selecting a database system from a plurality of candidate database systems based on the set of persistence requirements associated with the entity and persistence capabilities associated with the candidate database systems; linking the virtual instruction to an instruction processor specific to the selected database system; and executing the received entity-level persistence command by invoking the linked instruction processor to translate the virtual instruction to one or more database-specific commands and apply the one or more database-specific commands to the selected database system. |