integrate remote and local database