The 4D Web Platform is a very flexible one. There are numerous ways you could architect your application. This document will explore what some of those options are, and help you decide which is best for you.
Contextual mode is the fastest and easiest way to get web applications onto the Internet.
This approach has some limitations that may make it unsuitable for many public web sites. Serious web applications are built using non-contextual mode. This uses 4D, operating as a classic, stateless web server. The developer has complete control of the entire HTTP request-response cycle. Non-contextual mode will work with any of the architectures outlined here, whereas contextual mode works best when using 4D all by itself.