Every time you want to talk with db, you call get_db_handle(). Would it cause multiple database connections or it is handled internally within package? In most tutorials or pymongo usages I saw instance of it declared on file and imported. Not factory, but instance.