A _________ balancer distributes network or application traffic across a number of servers.
- Firewall
- Load
- Proxy
- Router
A Load balancer distributes network or application traffic across a number of servers.
In cloud environments, _________ scaling refers to the automated process of adding or removing resources as needed.
- Elastic
- Horizontal
- Static
- Vertical
In cloud environments, Horizontal scaling refers to the automated process of adding or removing resources as needed, also known as scaling out or in.
An e-commerce website uses auto-scaling but faces downtime during sudden traffic spikes. What might be missing in their scaling strategy?
- Inadequate Database Scaling
- Inefficient Caching Strategy
- Insufficient Monitoring and Alerting
- Lack of Horizontal Scaling
Downtime during traffic spikes suggests a possible lack of horizontal scaling, where the application fails to dynamically add more instances to handle increased load. Monitoring and alerting can help detect such issues early.
What is the basic difference between horizontal scaling and vertical scaling?
- Distributing traffic
- Increasing resources on a server
- Increasing servers
- Load balancing
The basic difference is that horizontal scaling increases the number of servers to handle increased load, while vertical scaling involves increasing the resources (CPU, RAM) on a single server.
Which load balancing algorithm distributes requests based on the server with the least connections?
- Least Connections
- Random
- Round Robin
- Weighted Round Robin
The load balancing algorithm that distributes requests based on the server with the least connections is known as the Least Connections algorithm.
In the context of web applications, what does the term 'sticky session' mean?
- A session that retains client affinity
- A session with a fixed duration
- A session with persistent data
- A session with secure connections
'Sticky session' refers to a session that retains client affinity, meaning requests from the same client are directed to the same server, enhancing user experience in stateful applications.
What is a common challenge when scaling stateful applications?
- Caching
- Data consistency
- Load balancing
- Stateless communication
Achieving Data consistency is a common challenge when scaling stateful applications, as it involves ensuring that data is synchronized across multiple instances of the application.
Which method is used to get a reference to the ServletContext object?
- context()
- getServletConfig()
- getServletContext()
- initContext()
The method getServletContext() is used to obtain a reference to the ServletContext object within a servlet.
The __________ method is used by an HTTP servlet to handle PUT requests.
- doPost()
- doProcess()
- doPut()
- doUpdate()
The doPut() method is used by an HTTP servlet to handle PUT requests, allowing the servlet to process and respond to PUT requests.
How does a servlet handle a scenario where it needs to redirect a client to an external website for authentication?
- request.getRequestDispatcher("externalURL").forward()
- request.sendRedirect("externalURL")
- response.forward("externalURL")
- response.sendRedirect("externalURL")
To redirect a client to an external website, a servlet should use response.sendRedirect("externalURL"). This method sends a temporary redirect response to the client, changing the URL in the browser to the specified external URL.