Added database operations. Missing: how to handle update conflicts.