Database communication middleware