I've worked on a project that implements a three-tier architecture with the following design:
- Presentation Layer - Uses PHP with an MVC framework to handle frontend presentation and business logic. This layer makes calls to the service layer, which accesses the data.
- Data Access Layer - Uses C# .NET and is separated into Service, Business Logic, and Data Layer. Called by the Presentation Layer. Makes calls to the database and serializes responses to return to the Presentation Layer.
- Data Layer - The database. Provides all of the data for the above two layers.
I understand that a three-tier approach can help security, since there is still no access to the data if the Presentation Layer is compromised. Although this is true, it seems like this approach is over-complicating it a bit, especially since I'm forced to write two models for the same object in the first two layers.
So my question: Is this a bad implementation of a three-tier architecture? If so, how could it be improved? What are the drawbacks, if any, of simply having an MVC implementation that has access to the database? What approache(s) do you use for your web applications?
Thanks for the help!