Imagine you have a big distributed database system and you want to perform some read/write operations on it.
We want the transactions to be atomic and consistent. Using one thread to perform both reading and writing task will ensure the stability of the system but speed will take a hit. Also going through the entire database is no cake walk and takes multiple queries to get to the result.
Naturally the operation will take time. So we split the task of reading and writing to multiple threads to optimize performance.
Simple Solution
#architecture #design #java #coding #programming