implement database router