This is an open-ended question which I am analysing while doing some fun projects in leisure. Websites like Google, Facebook do store user activities and perhaps sell them or use them for advertisements. But I believe anonymity is maintained. For instance, I need to expose that there are 5 people between age 45-50 who are drug-addicts in a given area... but I don't want to offer the names of the people. In fact I want to be sure that noone can access their names, otherwise resulting in privacy violation (Sorry for the weird example !)
Is there some tool/standard which everyone(especially smaller organizations) follow to limit legal complications due to identity theft like this ?
I am tagging MongoDB and Java, as I am using these technologies and answers specific to them would be easier to implement.