jueves, 13 de noviembre de 2008

REST friends

Five RESTful Friends
Dan McCreary, O'Reilly Technical

Resource orientation asks the web application developer to think about
creating consistent and precise URLs (URIs) for things that you want
to manage. If you manage customers, invoices, purchase orders or products,
think about how you identify these items and the data they contain.
After you do this you will find that you have some new friends to help
your web application fly.  (1) Your first friend is the resource your
local computer's local memory or RAM. Local memory is very fast and you
can usually transform resources in memory to the screen in fractions of
a millisecond... (2) Your second friend is your local hard drive or what
is known as your web browser cache. Although the local cache is much,
much slower then your local hard drive (by about three orders of
magnitude) it still is a great resource to put your data items into...
(3) Your third friend is your regional web cache, or corporate cache.
If you manage IT within your organization you may know that a corporate
proxy cache dramatically reduces your Internet bandwidth needs and
improves response times for your users by caching and reusing frequently-
requested web resource including static pages, images and XML resources...
(4) A fourth friend is the web cache in your own web application server
cluster. Web application servers frequently are not a single web server
but cluster of multiple web servers that have a load-balancing device
in front of it.. (5) And lastly, consider that databases servers
themselves also may have a cache of information that they hold before
they decide to do additional work. Many new databases have an innovative
column store structure that pre-calculate sums and averages for you...
if you design your URIs correctly your five friends will be standing by
to help. This is one reason why the XRX web application architectures
are becoming so popular. They try to leverage the infrastructure of the
web and they don't try to short-circuit a system that is already in
place to help you. Before you bother your database server to do a huge
number of SELECTs with joins on dozens of tables, considering asking
your five friends for some help. You might just find your web application
runs a little faster. And remember that native XML databases like
MarkLogic are usually inherently faster then RDBMS systems since they
may already store the information in the appropriate hierarchical
structures.

http://broadcast.oreilly.com/2008/11/five-restful-friends.html

REST basics

RESTful Web Services: The Basics
Alex Rodriguez, IBM developerWorks

Representational State Transfer (REST) defines a set of architectural
principles by which you can design Web services that focus on a system's
resources, including how resource states are addressed and transferred
over HTTP by a wide range of clients written in different languages.
If measured by the number of Web services that use it, REST has emerged
in the last few years alone as a predominant Web service design model.
In fact, REST has had such a large impact on the Web that it has mostly
displaced SOAP- and WSDL-based interface design because it's a
considerably simpler style to use. REST is not always the right choice.
It has caught on as a way to design Web services with less dependence
on proprietary middleware (for example, an application server) than
the SOAP- and WSDL-based kind. And in a sense, REST is a return to the
Web the way it was before the age of the big application server, through
its emphasis on the early Internet standards, URI and HTTP. As you've
examined in the so-called principles of RESTful interface design, XML
over HTTP is a powerful interface that allows internal applications,
such as Asynchronous JavaScript + XML (Ajax)-based custom user
interfaces, to easily connect, address, and consume resources. In fact,
the great fit between Ajax and REST has increased the amount of
attention REST is getting these days. Exposing a system's resources
through a RESTful API is a flexible way to provide different kinds of
applications with data formatted in a standard way. It helps to meet
integration requirements that are critical to building systems where
data can be easily combined (mashups) and to extend or build on a set
of base, RESTful services into something much bigger.

http://www.ibm.com/developerworks/webservices/library/ws-restful/index.html
See also Roy Fielding's dissertation, Chapter 5: http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm