Basically it work done by Server Side Scripting languages like PHP,ASP,JSP Python (DJango) but now days JavaScript is also capable to preforms these type of task using frameworks like Node.js, Express.js, or Meteor.js.