keep cache consistent with real database state