Optimistic Replication in Ubiquitous and Pervasive Computing, Distributed Data Deduplication and Software Transactional Memory.