Database update in units