469,631 Members | 1,022 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,631 developers. It's quick & easy.

Middle Tire in PHP MySQL

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.
Jul 17 '05 #1
10 2657
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.

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
that then communicates with your PHP app to store the data in MySQL. The levels
of data obfuscation are virtually unlimited.

--
Michael Austin.
Consultant - NOT Available.
Donations STILL welcomed. Http://www.firstdbasource.com/donations.html
:)
Jul 17 '05 #2
If you want to know how to implement a multi-tier architecture with
PHP/MySQL then take a look at
http://www.tonymarston.co.uk/php-mys...structure.html. This has the
following attributes:-

(a) 3-Tier architecture with separate components in the Presentation,
Business and Data Access layers.
(b) Model-View-Controller (MVC) Design pattern with separate components for
the Model, View and Controller.
(c) Object Oriented components in the Business and Data Access layers.
(d) All XHTML output is produced from dynamically created XML files and XSL
Transformations.

Be aware! This is not for the faint hearted!

It looks complicated, but once you understand it you can create new
components very quickly.

--
Tony Marston

http://www.tonymarston.net

"Kumar Saurabh" <ku**************@gmail.com> wrote in message
news:13**************************@posting.google.c om...
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.

Jul 17 '05 #3

"Michael Austin" <ma*****@firstdbasource.com> wrote in message
news:bP******************@newssvr22.news.prodigy.c om...
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

Jul 17 '05 #4
Tony Marston wrote:

[snip]
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.

Are you mistaking a 'logical' application aerver with a 'physical' one?

Steve

[snip]
Jul 17 '05 #5
Tony Marston wrote:
"Michael Austin" <ma*****@firstdbasource.com> wrote in message
news:bP******************@newssvr22.news.prodigy.c om...
<snip> 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.
Thanks for the clarification but my reply was a basic explaination with a real
example of how it "could" be built not necessisarly a complete dissertation on
the subject. :)
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.


There is a LOT to be said for the old "green-screen" mini- and mainframe
systems. When speed is of the essence, a GUI with drop-downs and text boxes and
radio buttons for every aspect of a transaction, is NOT the answer. I know of
an app that uses a pen-activated tablet that the user can enter the data for 10
transactions while the mouse-equivelant does one.

Multi-tiered apps supposedly were to make things easier, but some companies now
pay many times more to do the same thing - not any faster or better - than the
"legacy" system they replaced. Now they need admins for the middle tier, the
backend tier (system and database) and the user tier, not to mention the
increased complexity of the networks - for which you also need a admins. They
may save a few bucks on the actual server hardware, but the overall cost is
significantly higher in manpower and licensing fees for the various "tiers", but
most companies have yet to figure that out!!!

One such app that I am personnally aware of goes something like this:

The company decided to get away from "dumb" terminals (green-screens) and
commissioned a multi-tiered architecture system "because it was cool". If they
had simply updated/upgraded the current system, it could have cost them maybe
another $200K-$300K Instead they replaced it with a backend MS (NT/SQL Server)
at a cost of ~40K for the hardware and another large chunk for SQLServer (don't
recall what that cost them), they also added a middle tier (4-6 servers) that
cost them ~20-30K. They bought new desktops (~100@900 each including the MS
licenses etc) They also had to hire 6-8 "admins" at an average of 35K-45K/yr +
benefits to administer the whole thing. So, where did they "save"? BTW, there
was only 1 "legacy" system admin and someone capable of stepping in if he was on
vacation.

This "legacy" system is still produced and updated and not "legacy" at all.

MS and MS-centric management is NOT the answer to companies IT problems, it is
the cause.

--
Michael Austin.
Donations STILL welcomed. Http://www.firstdbasource.com/donations.html
:)
Jul 17 '05 #6

"Steve" <Th*****@Aint.valid> wrote in message
news:cg**********@lust.ihug.co.nz...
Tony Marston wrote:

[snip]
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.

Are you mistaking a 'logical' application aerver with a 'physical' one?

Steve


Certainly not. A 'logical' application server is a piece of software, while
a 'physical' application server is a physical device on which the software
runs. In a 'physical' 3 tier architecture you may have a device which
handles the Presentation layer components (a web server), a device for the
Data Access layer (a database server), and a device in the middle to handle
the Business layer components (an application server).

If you have a 3-tier 'logical' structure which is actually split across a
3-tier 'physical' structure you may or may not need some special software
(an application server) to handle communicate between the Presentation and
Business layers. If both of these layers exist on the same physical device
then you do not need any software to act as an application server.

Remember that 'web server' and 'database server' can mean either software or
hardware. It is the same for application server.

--
Tony Marston

http://www.tonymarston.net

Jul 17 '05 #7

"Michael Austin" <ma*****@firstdbasource.com> wrote in message
news:9n*****************@newssvr23.news.prodigy.co m...
Tony Marston wrote:
"Michael Austin" <ma*****@firstdbasource.com> wrote in message
news:bP******************@newssvr22.news.prodigy.c om...

<snip>
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.


Thanks for the clarification but my reply was a basic explaination with a
real example of how it "could" be built not necessisarly a complete
dissertation on the subject. :)


Yes, but you assumed that the OP was talking about 3 tiers of hardware, not
3 tiers of software. There is a big difference.

--
Tony Marston

http://www.tonymarston.net

Jul 17 '05 #8
Michael Austin wrote:
Tony Marston wrote:
"Michael Austin" <ma*****@firstdbasource.com> wrote in message
news:bP******************@newssvr22.news.prodigy.c om...
<snip>
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.

Thanks for the clarification but my reply was a basic explaination with
a real example of how it "could" be built not necessisarly a complete
dissertation on the subject. :)
>

[snip]
This "legacy" system is still produced and updated and not "legacy" at all.

MS and MS-centric management is NOT the answer to companies IT problems,
it is the cause.

Nobody in their right mind would use purely M$ products for a multi-tier
implementation. You use the right tools for the job, and this is what
this approach offers. Most people would argue for a M$ desktop, although
the safety aspects of alternatives is now becoming a major issue. Also
web browsers ( M$ abuse of the standards notwithstanding ) allow for a
cross-platform application to be simply deployed.

Steve
Jul 17 '05 #9
Michael Austin wrote:
Tony Marston wrote:
"Michael Austin" <ma*****@firstdbasource.com> wrote in message
news:bP******************@newssvr22.news.prodigy.c om...
<snip>
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.

Thanks for the clarification but my reply was a basic explaination with
a real example of how it "could" be built not necessisarly a complete
dissertation on the subject. :)
>

[snip]
This "legacy" system is still produced and updated and not "legacy" at all.

MS and MS-centric management is NOT the answer to companies IT problems,
it is the cause.

Nobody in their right mind would use purely M$ products for a multi-tier
implementation. You use the right tools for the job, and this is what
this approach offers. Most people would argue for a M$ desktop, although
the safety aspects of alternatives is now becoming a major issue. Also
web browsers ( M$ abuse of the standards notwithstanding ) allow for a
cross-platform application to be simply deployed.

Steve
Jul 17 '05 #10
Steve wrote:
Michael Austin wrote:
Tony Marston wrote:
"Michael Austin" <ma*****@firstdbasource.com> wrote in message
news:bP******************@newssvr22.news.prodigy.c om...
<snip>
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.


Thanks for the clarification but my reply was a basic explaination
with a real example of how it "could" be built not necessisarly a
complete dissertation on the subject. :)
>

[snip]

This "legacy" system is still produced and updated and not "legacy" at
all.

MS and MS-centric management is NOT the answer to companies IT
problems, it is the cause.

Nobody in their right mind would use purely M$ products for a multi-tier
implementation. You use the right tools for the job, and this is what


Then there are a LOT of people in their left mind... or their mind has left
them... running too many companies these days...
Steve

--
Michael Austin.
Jul 17 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

47 posts views Thread by Jeff Relf | last post: by
6 posts views Thread by Ian Williamson | last post: by
3 posts views Thread by vinu | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.