Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between a web service and application layer of code in an application server

Hello I am a newbie to n-tier architecture and was trying to find out the difference between what an application server hosting application layer of code does, and what a web service does?

So I'll tell you people my understanding of the whole n-tier concept, we have the UI -> Web Server -> business logic/application logic on an Application server -> Database Server. (Of course load balancers and multiple server instances would also be existent to fasten and store the state of processes)

But to be specific, the business logic layer would not be tied to a UI, so it is more or less independent and can be reused.

A web service on an other hand too provides functionality similar to the business logic, where it is not tied to a UI, and can be reused for different cases.

Could anybody explain if what I just explained above is right? And as I did mention earlier, I am a newbie to this, so if this sounds stupid or naive please do not bash me :)

like image 824
macha Avatar asked Jan 17 '11 21:01

macha


People also ask

What is the difference between web application and application?

The difference is that a web application will reside in the server instead of the client's computer and will process everything in the server - but , the control of the program is left for the client. A good example for a web application is this site.

What is difference between webservice and web application?

Web Application means for human beign can read. it is accessed through browsers. Web Services means for computers can read. it is accessed from any languages or platform.

What is web service application layer?

It is also known as a web-based application. The application layer's function is to control communication between user and database. It takes requests from a client-side, sends them to the databases, and when it gets the necessary response returns them to the presentation layer.

How does webserver and application server work?

A web server accepts and fulfills requests from clients for static content (i.e., HTML pages, files, images, and videos) from a website. Web servers handle HTTP requests and responses only. An application server exposes business logic to the clients, which generates dynamic content.


1 Answers

Here's a quick, dirty, and very general explanation of a 4-tier architecture, which I'm assuming may best apply to your application:

Presentation Layer : The interface to the outside world (web site)
Application Layer : The mechanics necessary to create the interface(s) to the outside world (web application frameworks, web services)
Business Logic Layer : The actual logic that embodies/simulates/emulates your business's processes and workflows (algorithms, transformations, approval processes, etc.)
Database Layer : The database and the logic needed to query information from it

In general, web services are not part of the business logic layer. That layer is usually protected as much as the database layer, because there could be trade secrets or confidential ways of doing things in there, and you usually don't want anyone accessing that directly, except programatically or through approved interfaces (such as web services).

Web services, application layers, and business logic can be aptly compared to Coca-Cola and it's business. Bottles and cans are usually how Joe Blow consumes Coke's product (e.g. web site in the presentation layer), but other businesses want to be able to serve Coca-Cola to their customers as well, so Coke lets them use carbonated water and Coca-Cola syrup (e.g. web services in the application layer). Coke's secret formula (e.g. business logic layer), and Coke's distribution processes to get it into the store (e.g. application layer) are all hidden from the consumer. Joe Blow doesn't care how it gets into the store, he just knows he can get Coke from a variety of sources (web site, mobile client, etc.). And Coke doesn't want people knowing its secret formula (business logic). If you want a Coke, you have to go through a store or a restaurant (approved interfaces).

like image 57
Snapman Avatar answered Nov 08 '22 06:11

Snapman