store calculated similarity metric in database