Search code examples
architectureserver-sideriaserver-side-scripting

How to develop 100% server-side applications?


TL;DR

What framework can I use to keep 100% application logic on the server while providing the interactivity of RIA?

Explanation

Back in the 90's, one could build 100% server-side application with ordinary PHP. But then demands for in-page interactivity increased and more and more application logic was moved into client-side javascript. Today, with websocket and fully dynamic DOM, it is once again possible to build server-side applications while satisfying all in-page interactivity requirements. All that's needed on the client is a generic javascript library that syncs DOM with the server over websocket.

While I believe this approach to web development has its merits, I don't want to discuss pros and cons of this technique here.

My question is about state of the art frameworks available by the end of 2014 that support this style of development. Experimental frameworks are also okay as far as their architecture is sufficiently clear. I don't need a laundry list of existing frameworks. I would like to see some framework that implements this kind of software architecture or, should there be no such framework, I would like to learn about those that get closest to the ideal.

My own research so far shows that Meteor is going the right way, but it still encourages too much app-specific javascript on the client and it ties server-side platform to client-side platform (i.e. javascript). I've read about Trello architecture, which largely reduces the client to a template processor, but templates and associated template/binding libraries are among the things I would like to move back to server side. Amazon AppStream will keep all the UI logic on the server, but it's prohibitively expensive for web development, especially when users leave apps sitting idly in the background.

Update: All the answers so far focus on Meteor. I have removed Meteor tag, because it might be misleading. I've mentioned Meteor, because the Meteor presentation made it look like I have a choice as to whether I want to run code server-side or client-side. It's now clear that Meteor won't transmit any UI over the wire, just data. It thus needs half the application on the client, at least in the form of templates.

Update 2: I've found Remote Events for XML (REX), a protocol that could be used to manipulate client-side DOM remotely from server-side app. There's no clear way to send user actions (clicks, edits) back to the server, but perhaps these could be defined as extension events in REX, which is permitted by the spec. It's still just a protocol though. No real software I could use.

Update 3: I have to clarify one thing. Simply taking server-side templates and translating them to client-side templates, which are then subsequently executed on the client, doesn't count as 100% server-side app logic. While such frameworks allow me to use server-side API, they will inevitably burden the client and expose large part of application code. I am looking for something that only sends rendered content (and generic event hooks) down to the client.

Also, regarding widgets/controls, the framework can allow client-side code to handle fringe cases (new low-level widgets), but it must not require client-side implementation for typical application logic (templates and high-level widgets).


Solution

  • Vaadin seems to come pretty close to what you want. I have no experience with it myself, but from what I've read, it should allow you to write your entire application (including the UI logic) in server-side code (Java). The framework takes care of the inevitable client-side stuff (Ajax).

    References