Is there a universal cache middleware between database and application that can automatically cache objects/entities when they are inserted/updated to database or queried from database, and return them to application instead of querying from database when they are already cached? Or in short words, a universal bidirectional cache, illustrated as bellow:
Already know that we can manually implement such cache for specific query. But can the coding be more general/universal? Someone somewhere might have done that; if not, what might be the best approach to implementing it?