3.3 Accessing the database
So far in Deconstructing a Web Page you've only been dealing with the client side, that is the Web Server. The HTML and JavaScript are served up from a Web Server but after that it's the browser doing the work, rendering the page and executing JavaScript whenever an event happens.
A real world application will be more complex. You will request data from and send data to your Application Server which can access your database. This is where Server Modules come into the picture.
The JavaScript on the client side dictates much of the behavior but it needs to consume server side data. To do this the Web Page or Reusable Part executing on the client side executes a request to a Server Routine in a Server Module. Information is communicated between the client side and the Server Module in JSON format.
When compiled, a Server Module generates a DLL on Windows or a server program *SRVPGM on IBM i.