Middle Tire in PHP MySQL

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kumar Saurabh

    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.
  • Michael Austin

    #2
    Re: Middle Tire in PHP MySQL

    Kumar Saurabh wrote:
    [color=blue]
    > 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.[/color]

    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
    :)

    Comment

    • Tony Marston

      #3
      Re: Middle Tier in PHP MySQL

      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

      This is Tony Marston's web site, containing personal information plus pages devoted to the Uniface 4GL development language, XML and XSL, PHP and MySQL, and a bit of COBOL




      "Kumar Saurabh" <kumar.siddhart ha@gmail.com> wrote in message
      news:13e53775.0 408260234.10a3a ae6@posting.goo gle.com...[color=blue]
      > 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.[/color]


      Comment

      • Tony Marston

        #4
        Re: Middle Tire in PHP MySQL


        "Michael Austin" <maustin@firstd basource.com> wrote in message
        news:bPmXc.1343 4$SS5.3168@news svr22.news.prod igy.com...[color=blue]
        > Kumar Saurabh wrote:
        >[color=green]
        >> 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.[/color]
        >
        > 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.[/color]

        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.
        [color=blue]
        > 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[/color]

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

        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

        This is Tony Marston's web site, containing personal information plus pages devoted to the Uniface 4GL development language, XML and XSL, PHP and MySQL, and a bit of COBOL




        Comment

        • Steve

          #5
          Re: Middle Tire in PHP MySQL

          Tony Marston wrote:

          [snip]
          [color=blue]
          > 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.
          >[/color]
          Are you mistaking a 'logical' application aerver with a 'physical' one?

          Steve

          [snip]

          Comment

          • Michael Austin

            #6
            Re: Middle Tire in PHP MySQL

            Tony Marston wrote:
            [color=blue]
            > "Michael Austin" <maustin@firstd basource.com> wrote in message
            > news:bPmXc.1343 4$SS5.3168@news svr22.news.prod igy.com...
            >[/color]
            <snip>[color=blue]
            > 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.[/color]

            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. :)
            [color=blue]
            >[color=green]
            >>that then communicates with your PHP app to store the data in MySQL. The
            >>levels of data obfuscation are virtually unlimited.[/color]
            >
            >
            > But if you have too many levels your application may become so unwieldy that
            > it is virtually useless. I have seen it done.
            >[/color]

            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
            :)

            Comment

            • Tony Marston

              #7
              Re: Middle Tire in PHP MySQL


              "Steve" <ThisOne@Aint.v alid> wrote in message
              news:cglbim$qt6 $1@lust.ihug.co .nz...[color=blue]
              > Tony Marston wrote:
              >
              > [snip]
              >[color=green]
              >> 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.
              >>[/color]
              > Are you mistaking a 'logical' application aerver with a 'physical' one?
              >
              > Steve[/color]

              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

              This is Tony Marston's web site, containing personal information plus pages devoted to the Uniface 4GL development language, XML and XSL, PHP and MySQL, and a bit of COBOL




              Comment

              • Tony Marston

                #8
                Re: Middle Tire in PHP MySQL


                "Michael Austin" <maustin@firstd basource.com> wrote in message
                news:9nqXc.5536 $O83.3527@newss vr23.news.prodi gy.com...[color=blue]
                > Tony Marston wrote:
                >[color=green]
                >> "Michael Austin" <maustin@firstd basource.com> wrote in message
                >> news:bPmXc.1343 4$SS5.3168@news svr22.news.prod igy.com...
                >>[/color]
                > <snip>[color=green]
                >> 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.[/color]
                >
                > 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. :)[/color]

                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

                This is Tony Marston's web site, containing personal information plus pages devoted to the Uniface 4GL development language, XML and XSL, PHP and MySQL, and a bit of COBOL




                Comment

                • Steve

                  #9
                  Re: Middle Tire in PHP MySQL

                  Michael Austin wrote:[color=blue]
                  > Tony Marston wrote:
                  >[color=green]
                  >> "Michael Austin" <maustin@firstd basource.com> wrote in message
                  >> news:bPmXc.1343 4$SS5.3168@news svr22.news.prod igy.com...
                  >>[/color]
                  > <snip>
                  >[color=green]
                  >> 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.[/color]
                  >
                  >
                  > 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. :)
                  >[color=green]
                  > >[/color]
                  >[/color]
                  [snip][color=blue]
                  >
                  > 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.
                  >[/color]
                  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

                  Comment

                  • Steve

                    #10
                    Re: Middle Tire in PHP MySQL

                    Michael Austin wrote:[color=blue]
                    > Tony Marston wrote:
                    >[color=green]
                    >> "Michael Austin" <maustin@firstd basource.com> wrote in message
                    >> news:bPmXc.1343 4$SS5.3168@news svr22.news.prod igy.com...
                    >>[/color]
                    > <snip>
                    >[color=green]
                    >> 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.[/color]
                    >
                    >
                    > 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. :)
                    >[color=green]
                    > >[/color]
                    >[/color]
                    [snip][color=blue]
                    >
                    > 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.
                    >[/color]
                    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

                    Comment

                    • Michael Austin

                      #11
                      Re: Middle Tire in PHP MySQL

                      Steve wrote:
                      [color=blue]
                      > Michael Austin wrote:
                      >[color=green]
                      >> Tony Marston wrote:
                      >>[color=darkred]
                      >>> "Michael Austin" <maustin@firstd basource.com> wrote in message
                      >>> news:bPmXc.1343 4$SS5.3168@news svr22.news.prod igy.com...
                      >>>[/color]
                      >> <snip>
                      >>[color=darkred]
                      >>> 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.[/color]
                      >>
                      >>
                      >>
                      >> 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. :)
                      >>[color=darkred]
                      >> >[/color]
                      >>[/color]
                      > [snip]
                      >[color=green]
                      >>
                      >> 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.
                      >>[/color]
                      > 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[/color]

                      Then there are a LOT of people in their left mind... or their mind has left
                      them... running too many companies these days...
                      [color=blue]
                      > Steve[/color]


                      --
                      Michael Austin.

                      Comment

                      Working...