write competition into DB