Mapreduce working, need to write to db