Matching and unifying records in a distributed system