Revert "temporarily remove document cache from Database"

This reverts commit f1f8b94ecf9d1d1aa84fa1395927b746eca02b44.