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:
-
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
-
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
-
JavaScript plays a large role on the browser in not just UI interaction, but also server communication (AJAX)
-
Third-party services are used for analytics, ad-serving, mapping, payment processing, transactional-emails etc.
-
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