Sunday, September 21, 2008

Elements of a Web-based Services

Designing web sites that are responsive to customer needs is a critical prerequisite for the success of online services. In this article three primary development aspects of Web-based services are discussed. The common style and architecture used to design Web-based services, Software development methodology, Software management methodology and Internet Routing Protocol.

Building Web Services

One of most common methods of building a Web-based services is REST. Many common Web-based services, such as book-ordering services, search services, online dictionary services, etc - are REST-based Web services. REST is an architecture style (not standard) of networked systems and stands for Representational State Transfer. It was first introduced by Roy Fileding in his PhD dissertation.

The Web is comprised of resources. REST style refers to transferring Web activities from one resource to another till what user (client) is looking for is accessed and provided to user. For example, when a client is looking for a piece of information from a website, by definition of REST, the Web activities present series of hyperlinks that user traverse through till the last piece of information user is interested is displayed. Each of these hyperlinks is a representation of a resource which basically places the client application in a state. Thus, the client application changes (transfers) state with each resource representation.

Although the REST is not a standard it uses the following Web standards
  • HTTP
  • URL
  • XML/HTML/GIF/JPEG/etc (Resource Representations)
  • text/xml, text/html, image/gif, image/jpeg, etc (MIME Types)
REST hides the implementation details (e.g., using Java servlets or CGI to implement a Web service) from the client and provides only the "big picture" of the Web to client. The following outlines the characteristics of REST:
  • Client-Server: a pull-based interaction style: consuming components pull representations.
  • Stateless: each request from client to server must contain all the information necessary to understand the request, and cannot take advantage of any stored context on the server.
  • Cache: to improve network efficiency responses must be capable of being labeled as cacheable or non-cacheable.
  • Uniform interface: all resources are accessed with a generic interface (e.g., HTTP GET, POST, PUT, DELETE).
  • Named resources - the system is comprised of resources which are named using a URL.
  • Interconnected resource representations - the representations of the resources are interconnected using URLs, thereby enabling a client to progress from one state to another.
  • Layered components - intermediaries, such as proxy servers, cache servers, gateways, etc, can be inserted between clients and resources to support performance, security, etc.
Web Service Design using REST method
  1. Identify all of the conceptual entities that you wish to expose as services.
  2. Create a URL to each resource.
  3. The resources should be nouns, not verbs.
  4. Categorize your resources according to whether clients can just receive a representation of the resource.
  5. All resources accessible via HTTP GET should be side-effect free, that is, invoking the resource should not result in modifying the resource.
  6. Put hyperlinks within resource representations to enable clients to drill down for more information, and/or to obtain related information.
  7. Design to reveal data gradually. Don't reveal everything in a single response document.
  8. Specify the format of response data using a schema (DTD, W3C Schema, RelaxNG, or Schematron).
Software Development Methodology

Since the Web-based services are normally based on customer requirement and is subject to change frequently, Agile method is commonly used to develop software. Agile means being able to quickly change direction. Agile method is a method opposed to waterfall model, in which software development is seen as flowing steadily downwards through the phases of requirement analysis, design, coding, testing, integration and maintenance.
Agile methods focuses on working software as the primary measure of progress. It promotes the iterations in software development life cycle and chooses to do things in small increments, with minimal planning, rather than plan at length. This allows responding to the customer needs much faster by adapting changes quickly into the development cycle and minimizing the overall risk. Also the project stakeholders get more involved in the process and at the end of each iteration are updated to provide feedback.

In agile development method, a deliverable and shippable software is developed in a short time frame, also known as "timeboxes". The software developed during each timebox is referred to as an iteration, which normally takes 2-4 weeks. Each iteration goes through full software development cycle, including planning, requirement analysis, design, code, unit test, integration test, QA, demo to product stakeholders and documentations to prepare software delivery to customers. The goal of agile development is to have an available release with minimum bugs at the end of each iteration. It may not add a new functionality to the software. At the end of each iteration, the stakeholders re-evaluate the project priorities with respect to revenue and return on investment. Every agile team has a committed customer representative who makes himself available for developers to answer mid-iteration problem-domain questions.

Managing Agile Software Development Projects

Scrum is one of the methods commonly used to manage agile software development method.

Scrum is a process that includes a set of practices and predefined roles. The main roles in Scrum are the ScrumMaster (project manager), the Product Owner (stakeholders representative), and the Team which includes the developers.

During each development period (sprint), which usually takes two to four weeks, the team creates an increment of a shippable software. The feature set for each sprint is prioritized by Product Owner who informs the team of the items that he wants completed. The team then determines how much of this they can commit to complete during the next sprint.

One of Scrum's biggest advantages is that it is very easy to learn and requires little effort to start using. Following are some general practices of Scrum:

  • Customers become a part of the development team.
  • Like all other forms of agile software processes, Scrum has frequent intermediate deliveries with working functionality. This enables the customer to get working software earlier and enables the project to change its requirements according to changing needs.
  • Frequent risk and mitigation plans developed by the development team itself.
  • Frequent stakeholder meetings to monitor progress – Balanced (Delivery, Customer, Employee, Process) Dashboard updates – Stakeholders' update – You have to have Advance Warning Mechanism, i.e. visibility to potential slippage / deviation ahead of time.
  • No problems are swept under the carpet. No one is penalized for recognizing or describing any unforeseen problem.
Internet Routing Protocol

To connect a client to a Web server, series of routing protocols are used to locate and reach the Web server that can provide the service to client. Some of the most common used protocols are BGP and OSPF.

BGP
Border Gateway Protocol (BGP) is the routing protocol used to exchange routing information across the Internet. BGP is an exterior routing protocol and as such is concerned with routing between networks rather than within them (this is the domain of the interior routing protocols such as RIP, OSPF).

BGP is designed to efficiently manage a large, multi-organisation routing table, such as the global Internet routing table. BGP uses TCP as a reliable transport medium and so it needs only to send out updates when necessary rather than continuously. BGP also has many features to manage routing announcements which are not needed in an interior routing protocol.

On a Cisco router you can configure BGP using the following commands:
router bgp ASN
neighbor neighbor remote-as remote-AS
neighbor neighbor filter-list 1 out
!
ip as-path access-list 1 permit ^$
The main thing to remember is to announce only the networks that you originate or are providing transit to. In general this means applying an AS path filter so that only the NULL path is announced. This avoids announcing all of AAPT's routes to your other provider(s) and then having them use you for transit, which could be expensive! AAPT uses BGP communities (public and private) to control routing announcements, i.e. the routes we send to customers as well as the routes we send to our peers and providers.

OSPF
Open Shortest Path First (OSPF) is an interior routing protocol used within larger autonomous system network in preference to the RIP (Routing Information Protocol), an older routing protocol that is installed in many of today's corporate networks.

Using OSPF, a host that obtains a change to a routing table or detects a change in the network immediately multicasts the information to all other hosts in the network so that all will have the same routing table information. Unlike the RIP in which the entire routing table is sent, the host using OSPF sends only the part that has changed. With RIP, the routing table is sent to a neighbor host every 30 seconds. OSPF multicasts the updated information only when a change has taken place.

Rather than simply counting the number of hops, OSPF bases its path descriptions on "link states" that take into account additional network information. OSPF also lets the user assign cost metrics to a given host router so that some paths are given preference. OSPF supports a variable network subnet mask so that a network can be subdivided. RIP is supported within OSPF for router-to-end station communication. Since many networks using RIP are already in use, router manufacturers tend to include RIP support within a router designed primarily for OSPF.

About me:
bruce atlasi is a professional computer engineer, skilled in telecomm and datacomm technologies and architecture. He has diverse working experience with many telecomm start-ups and fortune 100 companies, including Cisco Systems, IBM, and Siemens. He regularly blogs on About Hi-Tech site.

References
REST-Web-Services

info-connect

No comments:

 
Directory Bin