Flashcards in Design the application architecture - Objective 1.2: Design a distributed application Deck (26)
What is a distributed application?
An application that runs on two or more computers.
Which class for Web API controller inherit from?
Which controller should you use when creating a REST service, MVC controller or Web API controller?
Web API controller
How do you consume a web service in ASP.Net MVC?
Add a reference to the the web service and use the generated proxy as follows:
using (ServiceProxy proxy = new ServiceProxy())
model = proxy.GetData(input);
What class can be used to get output from a REST URL?
var host = new Uri("http://www.yourdomain.com");
var path = "your/rest/path";
var parameters = new Dictionary();
var credential = new NetworkCredential("username",
XDocument xml = _httpService.Get(host, path, parameters, credential);
What is a hybrid application?
An application that is hosted in multiple places
Ex: Part of the application is hosted in Windows Azure and part is hosted within a company's network.
What are the two primary hybrid application patterns?
Client-centric and system-centric
What is the client-centric hybrid application pattern?
The client application determines where the application needs to make its service calls. Easiest to code but most likely to fail since any change to the server or client might require a change to the other part.
What is the server-centric hybrid application pattern?
Uses a service-oriented architecture approach such as a service bus which will distribute service calls to a service in the cloud, on-premise or elsewhere.
What are some of the design concerns with using a hybrid application pattern?
Connection resiliency - service calls may need to retry
Latency - Latency will be higher for hybrid applications versus on-premise applications
Authorization and access - Hybrid applications will require you to either maintain duplicate user accounts or federate on-premise accounts to the cloud
Consistency and concurrency - Plan for sequential message handling and life cycles if needed.
How are sessions identified by the server for each browser accessing a web site?
A session ID is passed by the browser to the server via a cookie or appended to the query string.
What are the two approaches to sessions in ASP.Net MVC?
Using sessions to store small amounts of data or remaining stateless and not using sessions at all. ASP.Net MVC is designer to be stateless.
What is the surest way to manage state or session in a distributed application?
Passing information from the browser using cookies, hidden input fields, or the query string.
What are the three modes of session management available in IIS?
In Process, State Server, and SQL Server
What is the default mode of session management in IIS?
Which mode of session management in IIS can only be used with a single web server?
Which modes of session management in IIS can use used in a web farm?
State Server and SQL Server
Which mode of session management in IIS offers the best performance?
Where does the In Process mode of session management in IIS store session information?
In the web server's local memory
Where does the State Server mode of session management in IIS store session information?
In the local memory of a separate server
Where does the SQL Server mode of session management in IIS store session information?
In a SQL Server database
Which mode of session management in IIS offers the best availability and redundancy?
SQL Server, but only if the database used is clustered or is configured for database mirroring
What is a web farm?
A group of servers that share the load of handling web requests
What is required to direct web requests to the appropriate servers in a web farm?
A load balancer
How does ASP.Net MVC support running web applications in a web farm?
The different components of ASP.Net MVC, controllers, views and models, can be hosted a separate servers.