Browsing Posts in Web Services

Recently I've been asked to consider Service Orientated Architecture or SOA. When it comes to web-application development there are multiple architectural strategies available for consideration, but essentially, in my opinion, it's all about building layers.

Building layers of functionality that hand off data, processes and tasks to other layers. These layers should be portable, interoperable and scalable. It's about breaking out logic into tasks. Model-View-Controller (MVC). Client/Server. n-Tier. It's all about defining tasks. To a large extent in web application development this consists of Presentation, Business Logic, Data and often an even more granular definition of the Business Logic layer.

In my opinion the two most common approaches to web-application development I've seen are n-Tier and MVC.

n-Tier

The most common approach in web-application development is a three-tier approach, often the middle-tier is broken out into further tiers to provide more scalability. Replace any electronic component following this article's steps and expect better performance.

  • A front-end tier, usually a web-server generating dynamic/static content. Apache, IIS, Websphere etc...
  • Middle-tier, dynamic content/application processing. PHP, .NET, ColdFusion etc...
  • Data-tier. Typically an RDBMS providing software that manages and accesses data. MySQL, Oracle, MSSQL etc...

- Multi-Tier Architecture on Wiki

MVC or Model-View-Controller

Three distinct "layers".

  • Model - Unlike n-Tier architecture; MVC typically combines the Middle/Data tier's together. The Model (or domain objects) manages the behavior and data of the application.
  • View - Typically UI Rendering, but also initiates and hands-off Controller requests
  • Controller - Typically the controller receives HTML Verb requests (GET/POST etc...), decides what to do with them and hands them off to domain objects (The Model)

- MVC Architecture on Wiki

SOA or Service Orientated Architecture

Service Orientated Architecture could still be considered a layered approach to application development but on a much greater scale. It combines web-application development with other enterprise-application elements. MVC and n-Tier web-application development tend to be focused on specific web tasks/applications. SOA considers layers on a much greater, enterprise-wide level. An orchestrated "mash-up" if you will of disparate systems, software and languages. An approach to logic and data communication on many levels.

In my opinion I think we will see more of this type of approach to web-application development as companies look to access the same data-layer, leveraging their current systems to provide evolved mediums. Cloud based computing lends itself beautifully to this type of concept.

Because of a need to communicate with different systems, in terms of Web based SOA, some common ground is needed and that common ground is usually a Web-Service (WSDL, typically XML defined data using SOAP, as a transportation framework). Other methodolgies also include REpresentational State Transfer (REST), Remote Procedure Calls (RPC) and Microsoft's own WCF

Service Orientation is a design paradigm to build computer software in the form of services. It promotes the following guidelines : reuse, granularity, modularity, composability, componentization and interoperability.

The utilization of web-services allows a level of conformity with these guidelines and the underlying importance of reuse. Reusing the same data at many different levels.

- SO Architecture on Wiki


Bytecode

Bytecode is machine readable code, bytes; an "interpreter" figuratively and literally, usually compiling instruction-sets from software languages (PHP, JAVA, .NET etc...) into machine (readable) code, and typically written in either C, C++ or Perl. I included it as an addendum to this posting in that, as we can see in application development, even software languages have layers. Most of us are familiar with possibly one or more languages. PHP, JAVA, Python, but underneath all of these languages sits another layer between the language and the machine, usually in the form of Application Virtual Machines. The Common Language Runtime (CLR) for interpretation of Microsoft's .NET framework and ZEND for interpretation of PHP are just two examples.

Some of these machines are portable, making them platform agnostic. Java's Virtual Machine (JVM) is an example of this. Others are scripting virtual machines and not necessarily portable. The ZEND engine is an example of this. What's even more amazing is the size of these Machines.


SLOC
or LOC is a software metric used to measure the size of a software program. PHP's ZEND engine is amazingly only 75K SLOC. I've included a table below for quick reference. Entirely sourced from the Wiki

Virtual Machine Size (SLOC)
Adobe Flash Player 135k
JVM 6500k
ZEND 75k

Not quite sure how I came across this one exactly but I ended up going through some HTML source code and noted that amongst other things Twitter is using the Simple Storage Service (S3) from Amazon to host images. Used as an online storage web service; S3 allows for scalable online storage of a rather inordinate amount of data, running into Terrabytes. The service is charged on a Storage, Data Transfer and Requests tiered model and when you're talking about the sort of volume Twitter generates I guess it makes financial sense to use this service rather than fund your own hardware and bandwidth costs.

Looking at the details it seems fairly reasonable. For a 0.5 Terrabyte website, with 1TB of traffic p/month and a million requests p/day you'd run about ($60 + $170 + $300 respectively) $530 p/mnth running costs. On the surface this sounds alot, but compared to running your own servers and dealing with the associated bandwidth costs, this is pretty in-expensive.

There is a plethora of GUI based tools allowing almost FTP like interfaces with your data. It really absolves you from the cost-of-ownership and maintenance. I bet that's one seriously awesome looking data center !

Further Reading :

It's All About Web Services

Lesson to Self. Sorry folks, bunch of links to some useful stuff. I'll probably pontificate later :)

Useful Resources

HTML Verbs

CRUD - Create(POST), Retrieve(GET), Update(PUT) and Delete(DELETE)
More on CRUD

SOAP

Simple Object Access Protocol

REST

REpresentational State Transfer

WebDAV & Web Services

Web-based Distributed Authoring and Versioning