What Is n-Tier Architecture? | Scott Duffy

What Is n-Tier Architecture? | Scott Duffy


Hi there, this is Scott
Duffy from SoftArchitect.ca and I want to address sort of one of the most fundamental questions that comes up from time to time, what is an n-tier architecture? It’s kind of a funny term and maybe if you haven’t
encountered it before it doesn’t intuitive
exactly what it means. The N in n-tier architecture
just represents any number. Okay, sometimes it’s called
a three-tier architecture or a two-tier architecture but the n-tier architecture means it can be any number of tiers. Now, what’s a tier? A tier in software architecture is a boundary between a
layer of the application. So, you’ve got the presentation layer, you can have a business layer and you can have the data layer and those are three layers
of a three-tier application. Oftentimes the data layer
is actually a database and it has maybe stored procedures that run inside the database and that’s considered its own tier, and so the business objects tier, the center tier is a backend process that runs on a server
that allows your front end to talk to a database. It’s considered bad programming practice in modern development to have
your front end application talking direct to the database because that traps you into so many ways and it also introduces some
security vulnerabilities, especially if your front end is running on a client’s computer or it’s a website and it’s
written in JavaScript or HTML. Having a JavaScript programmed
right to our database would be terrible. So, oftentimes you see a
minimum of three tiers. There is such a thing as a four tier or five-tier application. How does that work? So, I’ve worked in companies
that split their business tier into two separate tiers. What you have is the business layer and then you have a data access layer. That’s written in code. There are things like Microsoft does have a enterprise library that does come with data access block but you can write code
that simply interfaces with the database, you can call a method, it does one thing, returns
the results to the caller but the business layer
contains the business logic. So, basically an n-tier architecture is a software program divided into tiers, the front end, the presentation tier, could be the web development, could be a mobile app, could be running on your desktop, business tier running on a server and the data tier oftentimes
running inside of a database. And that’s an n-tier architecture. Thanks for watching. If you have any questions
about architecture, leave them in the comments and I’ll be sure to get to them. Thanks a lot and see you next time. Thank you so much for watching. Click the thumbs up button
if you like this video. There’s the subscribe button down below if you want to see more videos like this as I create them. On the right is another video
about software architecture that you might enjoy. On the left, I actually have
a course on architecture. I want you to check it out. Up above is my website. If you want to go there,
read some blog articles, things like that, and finally, if you have any questions about software enterprise architecture, just leave them in the
comments on YouTube channel and I’d be happy to talk to you there. So, thanks again and I
hope to see you again.

10 Comments

  • Roselaine Migotto Watanabe says:

    Parabéns, Scott

  • Arne says:

    at 0:43 I don't follow you anymore because then you start to mix tiers and layers. Layers describe logical groupings in a static view while tiers describe physical groupings in a runtime view – or physical distribution of various software packages. So layers is logical separation and tiers physical separations. This means that a 5 layer software package can end up as one tier.

  • Sreenivas Reddy G says:

    what is diff 3 tire and n tire

  • Eduardo says:

    There are more tiers.

    For example, in JEE there is a presentation tier (for servlets and JSP), and client tier is the browser(and JSP as well I think)

  • 2017 October says:

    Thanks a lot from Oman our professor some times call it layers and other times call it tiers

  • Chakra Bracelet says:

    Can you tell me what this is good for?

  • Arun Singh says:

    is "Database Tier" just a database?
    or the layer where we do write CRUD logic?

  • Star Feel says:

    Finally, someone who isn't Indian.

  • Kyle Smith says:

    you guys know of any real world examples, like what companies use this?

  • Joy Avila says:

    I have a question my existing project is about ordering and delivery management. The system combines w/ customer app for ordering, driver app for delivery task, GPS tracking using arduino that sends data to main server (SMS/Web control), and the main website that monitors the order, delivery and tracking. What is the best n-tier architecture setup for this?

Leave a Reply

Your email address will not be published. Required fields are marked *