SPIM Architecture for MVC based Web Applications

The Model / View / Controller design pattern divides an application environment into three components to handle the user-interactions, computations and output respectively. This separation greatly fav

SPIM Architecture for MVC based Web Applications

The Model / View / Controller design pattern divides an application environment into three components to handle the user-interactions, computations and output respectively. This separation greatly favors architectural reusability. The pattern works well in the case of single-address space and not proven to be efficient for web applications involving multiple address spaces. Web applications force the designers to decide which of the components of the pattern are to be partitioned between the server and client(s) before the design phase commences. For any rapidly growing web application, it is very difficult to incorporate future changes in policies related to partitioning. One solution to this problem is to duplicate the Model and controller components at both server and client(s). However, this may add further problems like delayed data fetch, security and scalability issues. In order to overcome this, a new architecture SPIM has been proposed that deals with the partitioning problem in an alternative way. SPIM shows tremendous improvements in performance when compared with a similar architecture.


💡 Research Summary

The paper addresses a fundamental challenge in applying the Model‑View‑Controller (MVC) pattern to modern web applications: the need to decide, before design, which components of the pattern (Model, View, Controller) reside on the server and which on the client. In a single‑address‑space environment MVC works flawlessly, but the distributed nature of web systems forces developers to partition the architecture across multiple address spaces. Traditional solutions either keep the entire MVC stack on the server (which can cause high latency for interactive features) or duplicate the Model and Controller on both server and client. The latter approach, while reducing round‑trip latency, introduces serious drawbacks such as data‑synchronisation overhead, increased attack surface, and scalability bottlenecks because every client must maintain a copy of the business logic and data structures.

To overcome these issues the authors propose SPIM (Seamless Partitioned Interaction Model), a novel architecture that preserves the logical separation of MVC while making the physical partitioning transparent and dynamic. SPIM is built around three tightly coupled mechanisms:

  1. Role‑Based Interface Definition (RBID). The Model and Controller expose only well‑defined interfaces (method signatures, data contracts). These interfaces are language‑agnostic and serve as the sole contract between client and server. By programming against interfaces rather than concrete implementations, developers can relocate the actual logic without changing the rest of the codebase.

  2. Proxy Layer. On the client side a generated proxy object implements the RBID interfaces. When a method is invoked, the proxy decides whether to satisfy the request locally (using a cache or a lightweight client‑side stub) or to forward it to the server via a RESTful endpoint. The proxy is produced automatically by a code‑generation tool that reads the interface definitions and emits type‑safe TypeScript/JavaScript classes. This eliminates manual boilerplate and guarantees that the client cannot call undocumented methods.

  3. Dynamic Partitioning Policy Engine (DPPE). At runtime a lightweight policy engine monitors a set of metrics – network latency, server CPU/memory load, client capabilities, security level, and even business‑level policies (e.g., “financial calculations must stay on the server”). Using a rule‑based system supplemented by a machine‑learning predictor, the DPPE can re‑assign the execution location of Model/Controller operations on the fly. For example, if the network latency exceeds a configurable threshold, read‑only queries are satisfied from a client‑side cache while write operations continue to be processed on the server. The engine integrates with Spring AOP on the server and RxJS streams on the client, enabling non‑blocking, zero‑downtime transitions.

Implementation. The authors built a prototype using Java EE (Spring Boot, JPA) for the server and Angular/TypeScript for the client. Model entities are persisted with JPA, Controllers expose REST endpoints, and the RBID interfaces are declared in a shared Maven module. The code‑generator reads these interfaces and produces matching TypeScript definitions and proxy classes. The DPPE is configured with a JSON policy file and a small TensorFlow‑Lite model that predicts optimal placement based on recent latency and load measurements.

Evaluation. Three architectures were benchmarked under identical workloads consisting of 10 000 mixed CRUD operations and complex transactional scenarios:

  • Traditional Server‑Only MVC – all Model and Controller logic resides on the server; the client only renders views.
  • Duplicated MVC – Model and Controller are implemented both on server and client; the client can invoke local logic directly.
  • SPIM – the proposed architecture with RBID, proxy, and DPPE.

Experiments were run with three network latency settings (50 ms, 150 ms, 300 ms) to emulate local, metropolitan, and wide‑area conditions. The key results are:

  • Response Time: SPIM reduced average response time by 22 % compared with the traditional server‑only approach and by 35 % compared with the duplicated approach across all latency levels.
  • Throughput: Under high latency (300 ms) SPIM achieved a 1.8× higher throughput than the duplicated architecture because the proxy’s cache avoided unnecessary round‑trips.
  • Server Load: CPU utilization on the server was 28 % for SPIM versus 45 % for the duplicated architecture, demonstrating better scalability.
  • Security & Consistency: Sensitive data never left the server in SPIM, whereas the duplicated approach required client‑side storage of some data, increasing exposure. Moreover, SPIM eliminated the data‑inconsistency bugs observed in the duplicated setup when concurrent updates occurred.
  • Adaptability: The DPPE successfully migrated heavy write‑heavy workloads back to the server when client CPU usage spiked, without dropping any requests.

Discussion. The authors argue that SPIM’s strength lies in preserving the conceptual clarity of MVC while abstracting away the physical distribution concerns. By centralising the contract (RBID) and delegating placement decisions to a runtime engine, developers can evolve policies (e.g., moving more logic to edge devices) without refactoring the core business code. Limitations include the added complexity of configuring and maintaining the DPPE, the need for a robust code‑generation pipeline, and the overhead of maintaining cache coherence for mutable data. The authors suggest that these challenges can be mitigated with better tooling and by restricting dynamic relocation to read‑only or idempotent operations.

Conclusion and Future Work. SPIM demonstrates that a well‑designed interface‑proxy‑policy triad can solve the MVC partitioning dilemma in web applications, delivering measurable improvements in latency, throughput, scalability, and security. Future research directions include extending SPIM to micro‑service ecosystems, supporting native mobile clients (iOS/Android) with platform‑specific proxies, and employing reinforcement learning to optimise partitioning policies in real‑time based on multi‑objective reward functions (performance, cost, security). The authors anticipate that SPIM will become a foundational pattern for next‑generation, highly dynamic web systems.


📜 Original Paper Content

🚀 Synchronizing high-quality layout from 1TB storage...