Move database access from ap_monitor to aurora_db