Web/database architectures: Why is a server-side extension required in a typical web application stack?
-
ATo allow a client request to access and interact with the database securely.
-
BTo allow a client to fetch a static HTML page only.
-
CTo allow a client to retrieve any web page without HTTP.
-
DTo bypass firewalls for faster responses.
-
ETo eliminate the need for TCP/IP.
Answer
Correct Answer: To allow a client request to access and interact with the database securely.
Explanation
Introduction / Context:Most web applications require dynamic content driven by data. A server-side extension (for example, CGI, servlets, PHP, ASP/ASP.NET, Node.js server code) bridges the HTTP request with application logic and database access on the server.
Given Data / Assumptions:
- The client is a browser or app issuing HTTP(S) requests.
- The site provides dynamic, data-backed content.
- Security, validation, and business logic must execute on the server.
Concept / Approach:Static HTML can be served by a web server with no application runtime. However, querying or updating a database requires code running on the server to accept input, validate it, enforce permissions, execute SQL, and render a response. This code is the server-side extension (or application tier), and it prevents direct, unsafe database exposure to the Internet.
Step-by-Step Solution:
Identify the need for dynamic content and DB interaction.Recognize that server-side code must execute SQL safely and apply business rules.Conclude that a server-side extension is required for database access via the web.Verification / Alternative check:Common frameworks (Django, Spring, ASP.NET, Laravel) all provide server-side handlers and database access layers, demonstrating this architecture pattern.
Why Other Options Are Wrong:
- Static HTML retrieval does not require server-side extensions.
- Fetching web pages without HTTP is incorrect; HTTP is standard.
- Bypassing firewalls or eliminating TCP/IP are not roles of server-side code.
Common Pitfalls:Exposing databases directly to clients, which is insecure and bypasses validation/authorization layers.
Final Answer:To allow a client request to access and interact with the database securely.