Re: Middle Tire in PHP MySQL

From: Tony Marston (tony_at_NOSPAM.demon.co.uk)
Date: 08/26/04


Date: Thu, 26 Aug 2004 17:35:57 +0100


"Michael Austin" <maustin@firstdbasource.com> wrote in message
news:bPmXc.13434$SS5.3168@newssvr22.news.prodigy.com...
> Kumar Saurabh wrote:
>
>> Hi Devs,
>>
>> I was thinking of implementing a middle tire (most probably in XML)
>> for a PHP MySQL web app but couldn't make a head way. can any one
>> suggest how can i proceed with this.
>>
>> Thanks in advance.
>
> I think you mean Tier :)
>
> In a multi-tier application each tier performs certain tasks. Let's take
> a 3-tier system and break them down.
>
> Tier-1: User Interface. Browser or PC app that communicates with an
> Application server.
>
> Tier-2: Application Server: Each application server process is
> generally, but not always multi-threaded/re-entrant such that multiple
> User Interface connections can be handled by one Server process. This
> process is responsible for handling business logic and other validation
> routines as well as communicating with the next Tier.

The 3-Tier architecture does NOT necessarily mean having an application
server between the Presentation layer and the Data Access layer. You are
confusing a 'logical' 3 tier structure with a 'physical' 3 tier structure.

In a 'logical' 3 tier structure the middle tier is known as the Business
layer and is where all the business rules are processed. It is possible to
implement all 3 tiers (layers) on the same machine without even a hint of an
application server. I know because I have done so in two different
languages. This is a purely software thing.

When an application reaches a size where all three layers overload a single
device then one of the options is to put each of the layers onto a different
machine. This then becomes a 'physical' 3 tier structure, and it may be
necessary to have the capabilities of an application server to handle all
the business layer components.

You should note that it is not possible to implement a physical 3 tier
structure unless your software has already been split into logical 3 tier.

> Tier-3: Further processes the data and is responsible for storing it in a
> data store (flat-file or database).
>
> Now if you understand this very basic definition of a multi-tier
> architecture, this means that you would add a layer of unnecessary
> complexity by introducing a level of difficulty that you may not need nor
> completely understand. As a learning exercise this could be valuable.
>
> Write a front-end (Windows or Linux-based) app in GCC, VCC, VB that
> generates XML output that then communicates with an application server
> running a JAVA app

It is not necessary to restrict the communication between the Presentation
and Business layers to the passing of XML files. I use XML, but only to have
it transformed into XHTML from a series of XSL files.

> that then communicates with your PHP app to store the data in MySQL. The
> levels of data obfuscation are virtually unlimited.

But if you have too many levels your application may become so unwieldy that
it is virtually useless. I have seen it done.

-- 
Tony Marston
http://www.tonymarston.net


Relevant Pages

  • Re: Application Performance Question
    ... Generate XML from database, render this XML to client along with XSL to convert it to XHTML. ... You get code for formatting data in the SQL query, as well as other code that ought to be in the presentation layer i.e. all the extra markup it generates (and arguably presentation code should live in the presentation layer - not in a data persistence layer), which makes your application harder to maintain (mixing layers does that - whether it ... s business logic or presentation code in sprocs, bypassing layers, etc), needs some extra queries for those pages that other apps won't use, harder to maintain, puts tons more unecessary load on the DB server, which alone is a reason not to do it as DB servers are usually licensed per CPU whereas an extra server for processing your ASP.Net pages will most likely be far cheaper. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: What am I missing?
    ... Well I dont think so really. ... and its code behind that you have a sort of 2.5 layer anyway. ... protocols regarding how it did business then a business layer is definately ... do subscribe to the three tier club because it does provide a level of ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: Designing of database system based on .net
    ... I recommend stored procedures for data access, as it adds a security layer. ... The middle tier can either be wrapped DataSets ... > I want to build system for about 200 users which will be connected in one> moment to database. ...
    (microsoft.public.dotnet.framework)
  • Re: Authentication and Authorization in distributed app
    ... It's not uncommon for the business layer and DB layer ... > We have web sites that use Single Sign On for authentication for external ... > If we use a trusted subsystem then how do we pass the user information to ... > user information to that tier from the tier above. ...
    (microsoft.public.dotnet.distributed_apps)
  • Re: VB.net and ASP.Net Typed Datasets
    ... that it does, as well can be bound to XML from our Web Service, and easily ... That pretty much means strings and XML. ... your data layer go and get the SQL data and return that to the business ... business layer is not needed at all (which you can't do right now because ...
    (microsoft.public.dotnet.framework.adonet)