Is there a way to execute the backend code (ruby) in the web browser instead in a web application (rails)?
Cause I wonder why all the code should be executed in the server, isn’t it bad architecture.
It’s like the same concept of SVN, it is very dependent of the server, rather than having a more distributed architecture like Git, every client executes the backend code. In that way it will free performance load from the web server and it could handle more clients cause today’s computers are quite performable on the client side.
The client will communicate with the database through the backend server, but the backend will not contain all the application code, just for the communication part. The server code on the client will be compiled.
Isn’t this actually a better approach to solve performance load issues?
I think RIA applications built using Adobe Flex etc / Silverlight are moving in that direction itself. You should look at some of these if you want to do a lot of things on the client rather than the server.
However, there has always existed the old client – server paradigm of building applications. Technologies like VB6, Powerbuilder, Oracle2K etc and their current avatars like WPF/ Windows Forms/ Oracle Forms all provided with a way of doing more on the client side rather than doing everything on the server.
Also, moving all the application logic – other than DB communication logic – to the client means that you are moving back to the thick client way of doing things – which has its benefits but also its drawbacks compared to the thin client model of web applications.
The deployment / upgrades of thick client applications ; support for multiple client OS’es / varying client environments which could potentially make your application performance unpredictable are just some of the issues why there was a move away of thick clients to thin in the first place. Inspite of technologies like ClickOnce which help with deployment, these issues still exist – in varying degrees even today.
Hence its a tradeoff as to whether you choose a thick / thin client depending on your needs.