472,348 Members | 1,429 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,348 software developers and data experts.

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 2774
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: ams | last post by:
A table contains records of Ice Cream flavors. There is a primary id field (INT) and a varchar for flavor. I need to get the row in the very...
3
by: brijesh | last post by:
Question. ------------------- I have a table with field serial number(slno double). I have data like this: slno ----- 1 2
47
by: Jeff Relf | last post by:
Hi All, I plan on using the following C++ code to create nodes with unlimited children: // I would like to declare NodeT like this, // but...
4
by: lindsey.crocker | last post by:
I have this links list with background images set on them which changes when they roll over. The <td> is set valign="middle" however as soon as...
6
by: Ian Williamson | last post by:
Greetings, My company has an ASP.NET based enterprise product that is undergoing some changes and I need some community input to help solve a...
1
by: lavanyab | last post by:
how to write the program on n-tire architecture on .net(asp.net with c#)
3
by: vinu | last post by:
Hai, I am new in asp.net, I would like to know about 3 tire architechure, and its sample coding in different layears, If any one can explain...
2
by: rhino | last post by:
I'm working on a layout that has a variable-height middle section and need some suggestions on how I can make the bottom section adapt to that...
1
by: admehta28 | last post by:
Hello to All, I m new in Window Application. Can anyone give me simple window application which is build on three tire architecture. I want one...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.