Serverless: Beyond the Backendless Future

Exploring a True Server-Free Architecture

The concept of serverless typically evokes the idea of offloading server management to a third-party provider. Yet, imagine a scenario where serverless is taken literally—no backend servers at all. A traditional web app running entirely without backend infrastructure seems improbable. Nonetheless, let's delve into a ServerFree™ architecture where this notion is a reality.

The Birth of the ServerFree™ Architecture

At its core, the ServerFree™ architecture is a radical deviation from traditional web application structures. It eliminates the need for backend servers, containers, and virtual machines, leaning solely on the client side to handle all operations, including those normally reserved for a server.

The Classic Architecture Approach: A Starting Point

The initial foray into the application's design utilizes classic architecture with subZero libraries, focusing on creating a robust database schema and a user-friendly layout. The MVP V1 includes custom components for an "Opportunities" page, a rich dashboard experience, and even a detour with Turso DB—a means to package the classic architecture for production deployment.

Steps Toward a Simplified Design

  • Database Schema Generation: Using npx @subzerocloud/scaffold@latest new for schema creation.
  • Server Configuration: Setting up server.ts to route requests.
  • Layout Adjustments: Making the sidebar more efficient by moving it to the top.
  • Enhanced Dashboard: Featuring open opportunities and average application progress.
  • Turso DB Integration: A SQLite based solution allowing deployment without data loss.

The Journey to ServerFree™ Architecture

Here begins the challenging yet innovative transition to a server-free environment. The future is visualized with SQLite, now compiled into WebAssembly, so that everything runs locally in the browser.

Constructing a WebAssembly-Based Application

  • SQLite with WebAssembly: Stores data using the Origin-Private FileSystem (OPFS), a new browser capability.
  • Web Worker Implementation: Back-end code is executed in a web worker to utilize SQLite with OPFS effectively.
  • Service Worker Role: Initially considered for running the entire backend, it instead intercepts UI requests due to OPFS limitations.
  • Main Thread Adaptation: The UI no longer handles authentication since the system operates on locally authenticated user files.

The Exhilarating Struggle

The path to the ServerFree™ concept started with a straightforward job application tracker. However, privacy concerns shifted the focus towards a complex exploration of web workers, service workers, and other browser technologies. This unexpected journey resulted in the unintentional birth of a potential new architectural paradigm.

Revolutionary Advantages and Potential Use Cases

The proposed ServerFree™ architecture promises several alluring benefits, particularly its no-backend-servers approach, heightened privacy due to local data handling, robust security by nature of direct computer authentication, and potential efficiency gains by offloading work usually done by a backend.

Conclusion

In this exciting proposal, we witness a hypothetical shift in web application development—a paradigm where servers are truly redundant, and local browser capabilities reign supreme. The ServerFree™ architecture champions privacy and efficiency, setting the stage for novel applications and a future where boundaries between the web and local computing blur into one.


#serverless #webassembly #architecture #applicationdevelopment

https://subzero.cloud/blog/serverfree-architecture/