Landline and mobile phone companies and broadband providers will be ordered to store the data for a year and make it available to the security services under the scheme.
The databases would not record the contents of calls, texts or emails but the numbers or email addresses of who they are sent and received by.
For the first time, the security services will have widespread access to information about who has been communicating with each other on social networking sites such as Facebook.
Direct messages between subscribers to websites such as Twitter would also be stored, as well as communications between players in online video games.
The Home Office is understood to have begun negotiations with internet companies in the last two months over the plan, which could be officially announced as early as May.
It is certain to cause controversy over civil liberties - but also raise concerns over the security of the records.
Access to such information would be highly prized by hackers and could be exploited to send spam email and texts. Details of which websites people visit could also be exploited for commercial gain*.
The plan has been drawn up on the advice of MI5, the home security service, MI6, which operates abroad, and GCHQ, the Government’s “listening post” responsible for monitoring communications.
Rather than the Government holding the information centrally, companies including BT, Sky, Virgin Media, Vodafone and O2 would have to keep the records themselves.
Under the scheme the security services would be granted “real time” access to phone and internet records of people they want to put under surveillance, as well as the ability to reconstruct their movements through the information stored in the databases.
The system would track “who, when and where” of each message, allowing extremely close surveillance.
Mobile phone records of calls and texts show within yards where a call was made or a message was sent, while emails and internet browsing histories can be matched to a computer’s “IP address”, which can be used to locate where it was sent...
*or for blackmail purposes "Do you want your wife to see you visited six porn sites and four gambling sites today, Mr Top Banker?"