Design the application architecture - Objective 1.2: Design a distributed application Flashcards
What is a distributed application?
An application that runs on two or more computers.
Which class for Web API controller inherit from?
ApiController
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?
HttpService
Ex:
var host = new Uri("http://www.yourdomain.com"); var path = "your/rest/path"; var parameters = new Dictionary(); var credential = new NetworkCredential("username", "password"); 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?
In Process