I wonder if we should separate the interfaces from the database specific code into separate files? That way db.py is the interface specification and es.py (or something similar) is the Elastic Search version of this.