Modern Web Applications

2014-12-27

Jitesh Doshi

Modern Web Applications

Architecture overview of modern web applications with SPA, REST API, JavaScript MVC, and token-based authentication.

The way we architect web applications today (circa 2014) is very different from how we architected them only a couple of years back.

Characteristics of Modern Web Applications:

  1. All dynamic templating is done on the client instead of the server

    • JavaScript MVC frameworks on the client side (Angular, KnockOut, Ember)
    • UI is completely static, therefore highly cacheable
  2. The only dynamic bytes are data, usually from a database, formatted in JSON

    • JSON over HTTP for client-server communication
    • Every server-side language stack has good implementation options
  3. JavaScript plays a large role on the browser in not just UI interaction, but also server communication (AJAX)

  4. Third-party services are used for analytics, ad-serving, mapping, payment processing, transactional-emails etc.

  5. Token based authentication - OAuth, JWT, API keys for server-to-server

Benefits:

  • Faster apps - user gets responsiveness of a desktop app in the browser
  • Faster development on server - exposing Java objects as JSON over REST requires zero lines of code in JAX-RS
  • Faster development on client - consuming REST services in AngularJS requires very few lines of code
  • Automation & Integration for free - same REST API used by browser can be used for integration
  • Mobile on the cheap - same REST APIs from mobile-web/mobile-native