Design – API in the 3-tier architecture

Architecturedesign

Where exactly in the 3-tier-architecture is the access to the business layer (e.g. REST API) located? I would say that the API must be between the presentation and business layer, but I have never seen that someone has defined it that way.

Presentation -> API -> Business Layer -> Data Layer

Would that be a reasonable approach?

Best Answer

Yes, this makes sense !

The three tier architecture decouples presentation layer, business (application) layer and database layer. Typically the business layer and the database layer communicate using the database API. The business layer typically exposes its API for other applications and of course for the (remote) presentation layer. There you should find the REST API.

Martin Fowler in his book Patterns for Enterprise Application Architecture calls the boundary of the domain logic (business layer) the service layer. In this article you'll find some more information on how the service layer can be distributed on the tiers.