writeDB