FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Web Layer and Application Layer





polly-gone
Now, I am currently looking at various managed dedicated server services and a lot of them are talking about servers for a web layer, an application layer, and a database layer and then a development/management server.

Does that mean that there is a set of servers to store and process the front end HTML, CSS, JavaScript, etc., a set of servers to store back end PHP, Java, etc., a database server to store MySQL databases and a development/management server to manage all the other servers?

Do you know of any resources that I can look at to learn about creating applications using this system?

Thanks,

Nick Smile Smile Smile
rvec
here's a bit basics:
http://www.linuxadmin.org/blog/wordpress-architecture-for-high-load-blogs/

MySQL and apache are easily split, so that's an easy first choice and would be a big gain to performance.

Dynamic content can sometimes be cached and should be when possible, while static content can be served by the more 'simple' servers that only serve static content, so they won't check for every file if it's dynamic, might have special settings on it or stuff like that (same reason .htaccess files shouldn't be used or even turned on when possible).

I'm probably missing a lot of stuff, because I'm not really experienced with high load applications, but I hope it helps.
leontius
Perhaps you're talking about MVC http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller ? This concept is used by the more modern web frameworks, e.g. Ruby on Rails, CakePHP, Pylons etc.
rvec
that's almost the same, but this isn't in the application, but more on the server level.

MVC splits the application in three parts, whereas what polly-gone means splits not the application, but the sort of services the server delivers in three.

The database server would be the actual database, no PHP should run on that server.

The application server would run the application. It would run the model, the view (the dynamic parts) and the controller.

The other web server would serve all the static files like images and css files (both assumed that they are static and don't use PHP to be generated on every view).

This way you can configure a server for each purpose individually and get the best performance.

It looks kinda like MVC (model=database, view=static, controller=application), but it's on a different level and should not be confused.
polly-gone
So let's use an example of a simple blog. The web layer would serve the HTML, css, images, etc. The dynamic content like the blog posts would be retrieved from the database by the application server, which is called on by a script on the web layer?

-Nick Smile Smile Smile
rvec
A user makes a request to either the application or the static server. If the user requests an image, css or html file he'd request it from the static server, if the user requests a php file he'd request it from the application server. Normally you don't want the users to be able to do anything on the database server directly.

The application server would run something like apache and PHP.
The database server would run something like mysql.
The static server would run something like lighttpd.

If a user wants to take a look at a blog page, he'd request the page from the application server, that would generate the html for the page (and optionally cache it for later requests) and send it to the user. To get all the posts the application server would need to connect to the database server and request all the posts.

In the html there'd be links to images (like a banner or icons) and css files. Those files are static and can be served by a much faster and lighter server, so they are stored on the static server. Using the application server for those would be like using a tank to kill a fly, and use much more resources than needed.
Fire Boar
Of course, the same can also be true the other way around. For low to medium traffic websites, a single server is often just fine, and having three separate servers for application/database/static is a waste of resources. Only higher traffic websites where the servers struggle to meet the high demands on their resources would properly benefit from a split like this.
toasterintheoven
The way I understand MVC is Model is for the database layer, how the data is represented, like in MySQL tables, the view is how the data is presented, the PHP scripts for displaying the content, and Controller is for the business layer, all logic as per business requirements should go there.
rvec
toasterintheoven wrote:
The way I understand MVC is Model is for the database layer, how the data is represented, like in MySQL tables, the view is how the data is presented, the PHP scripts for displaying the content, and Controller is for the business layer, all logic as per business requirements should go there.

Almost.
Model is the database (mysql)
View is the display (HTML/CSS/JavaScript)
Controller is the logic (PHP)
Also you need PHP to connect the layers.
shenyl
Most modern web based applications has to deal with several issues:

1. Performance - this means encapsulating the functionality that can be optimized for performance.
E.g. Database Layer (Model) - allowing various clustering and backup/recovery functions

2. Data Integration - the same problems from the 1980s - where we encounter islands of databases.
So to enable Enterprise Application Integration - basically data integration.
This again points to the need for layered architecture and a new layer appears between
The Web Application Server and Database Server layers - it is called the middleware layer.

3. Integration with external entities - such as suppliers and customers.
As a company grows more and more requirements for faster integration of information.
And this has to be over the Internet - in the past over privately created and costly networks.

So the architecture of a company needs to be designed either by tearing and rebuilding as one grows, or designed for growth by adopting the multi-tier architecture to avoid the painful and error prone approach of adjusting as one grow.

Suggested structure for sustainable growth rate will be :
Web Performance and Security Layer - allowing distribution of transactions to different web layer servers.
Web Layer - Here Web server with extension for Web Application (such as JSP, .NET, Php)
Intranet Web Service Layer - Using Open standard (HTTP, SOAP, XML, WSDL) for data integration
Extranet Web Service Layer - Allowing external entities to perform data and process sharing
This layer is side by side with the internal Web Service layer
Internal Security Layer - can be hardware or software or combined
Database layer

Hope this is of some use. With regards.
jucanet
rvec wrote:
toasterintheoven wrote:
The way I understand MVC is Model is for the database layer, how the data is represented, like in MySQL tables, the view is how the data is presented, the PHP scripts for displaying the content, and Controller is for the business layer, all logic as per business requirements should go there.

Almost.
Model is the database (mysql)
View is the display (HTML/CSS/JavaScript)
Controller is the logic (PHP)
Also you need PHP to connect the layers.


Do you know some framework in PHP that implement real MVC. I looked around and every framework that I test, don't really apply the (V)iew concept. Let me explain, the View part (HTML & CSS) is programmed with some "special(magic)" tags for make the magic, but if I send this HTML to a web designer, or use a good HTML editor, all this "special(magic)" tags are deleted because is not in the HTML standart.
Marcuzzo
jucanet wrote:
rvec wrote:
toasterintheoven wrote:
The way I understand MVC is Model is for the database layer, how the data is represented, like in MySQL tables, the view is how the data is presented, the PHP scripts for displaying the content, and Controller is for the business layer, all logic as per business requirements should go there.

Almost.
Model is the database (mysql)
View is the display (HTML/CSS/JavaScript)
Controller is the logic (PHP)
Also you need PHP to connect the layers.


Do you know some framework in PHP that implement real MVC. I looked around and every framework that I test, don't really apply the (V)iew concept. Let me explain, the View part (HTML & CSS) is programmed with some "special(magic)" tags for make the magic, but if I send this HTML to a web designer, or use a good HTML editor, all this "special(magic)" tags are deleted because is not in the HTML standart.


the topic was 2 years old but clearly talking of separation of concerns and more specifically about multitier architecture

in PHP there is the CodeIgniter framework that actually works with the MVC pattern and the HTML code in the views can be viewed and edited in any text editor or IDE.

if you look at ASP MVC (n) then you've got another story, here there are specific tags ( or magic tags as you called them) that are interpreted by the code on the server and translated to HTML before sending the output to the browser

I love codeigniter, you put all your database logic in the models, all your HTML code in the views and handle the business logic in the controllers
Related topics
GMail Drive
Help for RAM
Fun With Pokies
PHP VS ASP
Do u Use Flash Content in your web site
Best Web-Based Instant Messaging Client
Web security testing
Linux vs. Windows (for businesses)
portable apps
FreeBSD - Is it reliable and secure?
setting my own pc as a private server
Creating a Website
Web and Application Layers
Factor affecting web design company
Reply to topic    Frihost Forum Index -> Scripting -> Website Software

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.