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

Hello, I am new to n-tier architecture and trying to figure out the difference between what the application server does, which hosts the application code layer, and what does the web service do?

So, I will tell you how I understand the whole concept of the n-level, we have a user interface β†’ Web server β†’ business logic / application on the application server β†’ Database server. (Of course, load balancers and multiple server instances will also exist to consolidate and maintain the state of the processes)

But to be specific, the level of business logic will not be tied to the user interface, so it is more or less independent and can be reused.

A web service, on the other hand, also provides functionality similar to business logic, where it is not tied to a user interface and can be reused for different occasions.

Can someone explain if I explained correctly above? And, as I mentioned earlier, I'm new to this, so if that sounds silly or naive, please don't bash me :)

+6
web-services service business-logic n-tier-architecture
source share
1 answer

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

Presentation level : interface to the outside world (website)
Application level : the mechanics required to create the interface (s) for the outside world (web applications, web services)
Level of business logic : the actual logic that implements / simulates / emulates your business processes and work processes (algorithms, transformations, approval processes, etc.)
Database level : the database and the logic necessary to request information from it

In general, web services are not part of the business logic layer. This level is usually protected in the same way as the database level, because there may be commercial secrets or confidential ways to do something there, and usually you do not want anyone to access it directly, except programmatically or through approved interfaces ( e.g. web services).

Web services, application tiers, and business logic can be matched exactly to Coca-Cola and its business. Bottles and cans typically represent how Joe Bill consumes a coke product (such as a website in a presentation layer), but other companies want to be able to serve Coca-Cola to their customers, so Coke allows them to use sparkling water and Coca-Cola syrup (e.g. web services at the application level). The coke secrecy formula (for example, the business logic level) and the coke distribution processes to get to the store (for example, the application level) were hidden from the consumer. Joe Blau doesn't care how he gets to the store, he just knows that he can get coke from various sources (website, mobile client, etc.). And Coke doesn't want people to know their secret formula (business logic). If you need Coca-Cola, you need to go through a store or restaurant (approved interfaces).

+17
source share

All Articles