I'm searching for the best possibility to write web applications that are heavy with JavaScript . So I'd like to present you my ideas and ask for your opinions and alternatives on this, please :)
1 year ago I started looking for possibilities for web development besides PHP. I found JSP and Django. I decided to go with Django. After starting up some projects with Django it lead me to conclude that Django, for me, doesn't provide a possibility for easy web development. I have to worry about too many features and especially the need to keep client and server code in balance.
So I started searching again and found CouchDB which provides a kind of cool back-end for Ajax applications. So my idea was to use CouchDB as database server, which only provides data-validation & storage and kept everything else to the client. Which apparently is not a new idea at all, but I haven't found any good example on this yet. Do you know any?
I'd like to have an architecture with the following components:
- data-storage & validation ( CouchDB )
- web server: which handles files and WebSockets or Polling ( Tornado or Eventlet )
- client-side JavaScript to handle everything else ( fav: self written MooTools )
- client-side templating language ( you know any cool? )
Do you have any suggestions for different software to use for those points?
Which handles requests like the following:
The initial request sends JavaScript files and basic HTML (only <body>
and <head>
tags) to the Client. The loaded JavaScript functions create the HTML code and insert it into the <body>
tag. From now on, the entire navigation on the website only requests JSON which is provided through the Websocket and processed by the client-side JavaScript.
Pros:
- The entire code is written in JavaScript on the client-side
- Animation on updates can be implemented really easy
- The logic of the page would be very lightweight and transparent
- Probably no scaling problems on the server-side
- Very fast application performance due to excellent client-side caching possibilties. For example using Webstorage
Cons:
- Template Processing might be very slow on low Hardware machines?!
- Application code is public to all
Questions
- Do you know any available solution for this kind of web development?
- Do you think writing web applications this way would be crank?
Please also look at Answer 2