What is a SOA – Service Oriented Architecture

This entry is part 2 of 14 in the series REST Assured Tutorial

Need for SOA :

Web applications traditionally designed in Client Server fashion, where a web browser as a client will send request to the server and the server will respond to the client. Data is transferred throughout these request. To achieve this website code was deployed to a server and a database to the same or another server, this was fine for the small and independent applications, where they do not communicate with other websites or applications over the internet, but as your applications grows and it requires to communicate with other applications, it requires interoperability. For example you have a e-commerce website, selling products which is written in PHP and you want your application to communicate with all the major banks website when your customers wants to make payment. Now the problem is you dont know the technology they used to build their websites. Web services can help you achieve this. You can build webservices in any language you want and communicate with other webservice or website which is written in different technology. This communication will be handled by common internet protocols such as HTTP. The data will be transferred between these two applications using XML or JSON format or even using simple text. XML and JSON formats are known to every programming language and technology and are commonly used for webservices communications.

There are two types of webservices SOAP and RESTful. A large application like Google or Facebook can have multiple webservices communicating with each other for processing data. So the systems/applications built using these webservices can be called as Service Oriented Architecture.

Communication in SOA :

Now these webservices can not only talk to a web browser or websites but also talks to other webservices and databases to. Lets consider a scenario where you are accessing facebook.com. When you try to access your profile on Facebook, your web browser sends the request to access your profile information using the facebook webservices, the facebook webservices will contact the database and will make a database query to access your information. This information will be provided to the webservice and then the webservice will transfer that infromation to your web browser. Its not necessary that only one webservice or only one database was involved in serving this request. There can be multiple of them. And as I mentioned earlier these webservices will communicate with each other to perform specific tasks, such as for example one webservice will only take request and provide response to the web browsers other webservice may contact the database and compress the images before sending them to web browser. This kind of architecture is called as Service Oriented Architecture, where all or many things/operations are performed using services.

Now lets understand how the API communicates with each other in more detail. Webservices are not visible to the user of a service, these services are running in background and gets executed whenever your front-end applications calls them. So you can say front-end applications like websites and desktop applications are for human consumption because you are directly accessing them and are visible to you, but webservices are for consumption of website, mobile and desktop application consumption. You dont directly use them, you use them through these front-end applications. Also these services send data to each other or to the front-end applications in XML, JSON, Plain-Text formats and also receives them in these formats.

For a greater detail about SOA read here

Series NavigationIntroduction to REST-API and REST-Assured >>