Web Applications Should Be Compiled
31–40 of 177 posts
Re: Web Applications Should Be Compiled
#32In web the model is different: You develop an app, push it live and find out what works and what does not, change and iterate. This means that doing the iterations with minimum time and effort are important than worrying about scalability and performance. You can always throw hardware at the perfortmace problem. If you get enough traffic to become worried about performace, that itself is the mark of success. But to b…
You can always throw hardware at the performance problem. No, you can't. That's what scalability means . If you don't have scalability, then additional hardware will only take you so far before you begin wasting it.
If you build your app such that the webservers can act independently, then by using various methods of load balancing you can just throw hardware at the problem.
However, this just usually leaves the database as the single point of contention among all webservers. There are various ways to reduce load on the database server by some constant factor (memcache, query caching), but in the end database load will be roughly linear with site load (requests/time). You can't just add SQL-based DB servers and get linear speedup like (properly thought out) webservers.
If you think your site will get so big so fast you won't have time to hire engineers to figure out the scaling problems before they become unmanageable (for example, facebook got huge, but it took a few years, so they had time to raise money and adapt their stuff, although they were pretty slow for a long time), then use appengine datastore or simpledb or some other db that promises to scale really well (this is a really hard problem, which is why there aren't a lot of open source things that do this. Note: couchedb can't scale writes, so I don't count it).
My personal thinking is that one big properly designed database can get you pretty far, and database clustering can get you far enough. If you find it pleasant, putting your app in appengine would make you pay the price of scalability a little at a time starting right away, instead of letting you push it off (but with a huge performance wall that you won't be able to get over without basically redesigning much of your apps internals).
Re: Web Applications Should Be Compiled
#33I had that basic idea when web app frameworks starting becoming popular. So I implemented a web framework which took a 'description' of the app written in perl, and generated C++ which compiled into a single exe file which served the app with a built in http server. Small bits of business logic were written in C++, but basically it was done by the perl. All templates, internationalisation, everything, compiled down to a few database queries, string concatenations and the odd if statement.
I then build a couple of production sites in this, one on my own, and another with a few other developers.
Conclusions from this:
1) It's really really fast and efficient, and the single exe model for deployment is lovely.
2) It's a pain to implement such a framework, and a pain to use it.
3) I'm never using perl again.
4) Life's too short for this kind of game.
The code is here: http://www.boxbackup.org/trac/ticket/6
Re: Web Applications Should Be Compiled
#34Re: Web Applications Should Be Compiled
#35If you're going to write it in C, why not just write it in Java? You could use the Google Web Toolkit..
removed ... i'm embarrassed at the wrongness of what i typed
Re: Web Applications Should Be Compiled
#36Re: Web Applications Should Be Compiled
#37There are already a few options for a MVC web framework in compiled code. I'm working on ASP.NET MVC now. It's compiled, but development does not feel like that because of JIT compilation. Also, it will run in Mono on Linux if I want.
Re: Web Applications Should Be Compiled
#38In web the model is different: You develop an app, push it live and find out what works and what does not, change and iterate. This means that doing the iterations with minimum time and effort are important than worrying about scalability and performance. You can always throw hardware at the perfortmace problem. If you get enough traffic to become worried about performace, that itself is the mark of success. But to b…
You can always throw hardware at the performance problem. No, you can't. That's what scalability means . If you don't have scalability, then additional hardware will only take you so far before you begin wasting it.
Re: Web Applications Should Be Compiled
#39Re: Web Applications Should Be Compiled
#40Ranting aside, this seems like a valid complaint. Scaling and performance seem to be reasonably important in web applications, so why not write them in C? If the only complaint is the lack of good tools, why not build those tools? Disclaimer: I don't actually work on web apps, and therefore have no experience with these things.
However, most website projects are business-driven, which means that you are constantly changing and refactoring stuff as misunderstandings get cleared up, design flaws emerge, business models change, minds change, etc etc.
Business software projects are not just engineering, and if you treat them as such you will endure pain.
The analogy with a house is odd - if a house was purely an engineering problem, then they would probably all be built out of precast concrete or something, not "wood and steel". Aesthetics, tastes, budgets, and tradition all have an impact, and nearly every house is unique, so you use the "best tool for the job" - the one that is the easiest to customize on-site.