Within the last couple of years, a phrase has begun to emerge in the digital context of the internet:
“Web Application”
(Hopefully the enigmatic blue gives it a nice effect.) Some have sneered at it, others poked it with a stick, many started abusing the phrase because they thought it made them sound cool (like “The Cloud”, oohhhhh! Servers!), and, lastly, many programmers bemoaned that they’d been making them for years.
So what is a Web Application?
Simply, a web application is an executable that sits happily on a server somewhere, and is accessed via web. (Huh, sort of sounds less glorious when put that way.) This definition is almost unhelpful, however, as most people hardly even stop to consider how a web page is constructed at all, much less where it comes from. I might as well say that it’s made by tiny gnomes that live in a server far, far away. Who cares? The real question is: “Why? what’s the advantage?” I’m glad you asked! Let’s work our way up.
How does a normal Web Page work?
Most people have heard the acronym, HTML — or Hypertext Markup Language. What the heck is it? In short, it’s the language of the internet. Everything visual must be broken down to HTML in order for your browser to display it on your screen. So let’s examine some of this fancy stuff:
|
1 2 3 4 5 6 7 8 9 |
<html> <head> <title>Hi there!</title> </head> <body> <p>Hello World!</p> </body> </html> |
Let’s say that code is sitting on a file far, far away on some server. You direct your browser to the address of the site, and it sends the content of the file to your browser. The browser receives it and does what’s called parsing the text — that means it sifts through it to pull out what’s meaningful to itself. It takes the parsed contents and places them in what’s called the Document Object Model (DOM), which is an object structure the browser uses to begin constructing the site.
So in the above example, a Head object would be created, and it has a property called Title which is now “Hi there!”. Meanwhile, the body object has a paragraph property that contains “Hello World!”. It’s not too bad, but it get’s really ugly on a complicated site. Right-click on this page, view the source, and try to imagine that in the DOM. Not only that, but how do you resolve mistakes? Do you break everything and stop, or try to work around it? It’s a nightmare, and for this reason parsing was, for a long time, non-standard — every browser had its own way of building the DOM. That’s why sites don’t look the same on old browsers. Bug I digress slightly.
So what about Web Applications?!
Yeah, sorry. What’s really important here, is that the web page is a file that sits statically on the server. It gets more fancy with PHP and Javascript, as the HTML is actually constructed from browser interaction, databases, style sheets (CSS), etc. This combination of languages, called AJAX, has been a major proliferation of the last ten years. It’s the very thing that allows Google to show you results before you’ve finished typing, and offer suggestions for your search. The capabilities really are impressive.
But they’re… dumb. Javascript and PHP are capable languages, but only in comparison to HTML. The PHP and Javascript are themselves static, and this creates limitation as to how much intelligence you can put into a web page. At least easily. Some would argue the capability of PHP, but that’s like saying you can program anything in Assembly, so why not? Because it would be a nightmare. They have their niche, but as the web expands more and more people are wondering why the internet can’t just replace applications on their desktop…!
And there it is! The Web Application is really a response to the cry for advanced web content. A web application really is an application, like on your desktop, that runs on the server. What’s really fancy is that instead of creating a UI on the server, it constructs a UI out of Javascript and HTML and sends that off. So there is no static file being sent, but dynamic content being constructed from this application and communicating via CGI (worth a search).
Why isn’t the whole internet Web Applications?
Well, Web Applications are cool and capable, but they do have drawbacks. For one, it takes almost nothing for a server to just spit out the content of some files to your browser; but to have an application running, that costs considerably more (relatively speaking) memory and processor power. And hosts make you pay for it, which can be expensive. The second issue is that there’s quite a bit more traffic between the browser and server, and people like their browsers super responsive. In this digital age of microwaves and jukeboxes, people start tapping their foot after two seconds. (In fact, many people haven’t even read this post this far because it takes too long!) Now as internet speeds increase, this isn’t as much of an issue, which is really why Web Applications are proliferating now. They’re not new, but the technology to support them effectively is. Also, HTML5 is a great foundation for more capable HTML with less overhead, as the browser itself is more capable.
The last reason the internet isn’t about to suddenly become all Web Applications, is that it’s simply overkill. Most people don’t want to have to write a program just to blog about stuff, tell about their business, receive donations, etc. It’s really a niche, presently, and it’s being explored.
Alright, so what’s an example, then?
Recently, I wrote a Web Application to run on a local server (you can’t access it from the internet). I had a server that collected data from testing equipment onto a PostgreSQL database. So a way was needed to retrieve the data from the server to be able to be formed into reports and the like. Many people might be doing this at once.
Years ago, that would’ve meant writing a program to be distributed to every employee that planned on generating/viewing reports. That would entail quite a bit of work for cross-platform deployment, and there’s always the nuisance of distribution. If I make an update, every employee needs a way of updating their version.
But, as I scratched my chinny chin chin, I thought, “Hey, I already have a server for the database, what if I just expanded the server to also have a Web Application that people could just connect to? Wouldn’t that also make the database queries faster since it’s on the same machine?” I was right! It was a perfect match, and I got to work. I ended up producing, project name, the “Tribo Reader 5000″ — a mighty name, I felt. It ran extremely well over the network, hardly used up any browser memory (around 50mb cap), queried quickly, and made distribution painless. It also meant that mobile devices like droids, iPhones, and iPads could log on and use it! Snap! And it all just worked because I’m taking advantage of the fact that most electronics these days have a browser! I was very pleased with the outcome.
Conclusion:
So Web Application really is a welcomed old friend to the world of the internet. It does server a purpose, and will likely continue to grow over the next couple years. Creating them is easier than it used to be (e.g. Real Studio Web Edition), but developers need to be careful not to overkill a project. Also, be patient, because HTML5 isn’t complete yet and that makes the compilation into web-code for Web Apps a bit difficult. But no doubt they’re here to last, and hosts will have to respond to the sudden rise in requests for VPS hosting in fair price ranges.
Developers, play around, they’re pretty neat. Feel free to contact me and ask how I set up the Ubuntu server to run the Web App. There are some gotchas, and I’ll be posting a bit more on this in the future.
Users, try to use the phrase correctly. Tell someone how much you’ve learned and shake your head with all-knowing condescension the next time someone glibly tosses the phrase.
Amitava Karan
February 27, 2012 at 5:10 am
Nice article !! good job.
tim
September 29, 2012 at 10:13 am
Jason,
is there any chance you could provide a clear, human-level, intelligable instruction as to how run an RS web ap on shared hosting. I seem to have tried everyting possible, to no avail. Timeouts, Appname, 755, port numbering, etc.. who knows what.
Maybe my problem is free accounts, but I don’t want to pay just for testing.
Will appreciate you help. Tim
Jason
October 1, 2012 at 9:20 am
Hello Tim!
That’s a great idea. I’ll see what I can do. I’ll talk about deployment as a whole as, I’ll tell you right now, I wouldn’t recommend deploying to shared hosting. You really ought to have control over memory, and server OS configuration (installing fonts, for instance). Depending on your need, you don’t need much, and could get a cheap VPS. Still, it is more expensive than shared hosting, so I’ll play around with this and see what I come up with.
Thanks for the idea!