enterprise-architectures-and-patterns icon indicating copy to clipboard operation
enterprise-architectures-and-patterns copied to clipboard

Collection of Enterprise Architectures & Patterns built with Spin and WebAssembly

Enterprise Architectures & Patterns

This repository contains a collection of enterprise architectures and patterns, to illustrate the potential of Spin and WebAssembly (Wasm) for building real-world applications.

Each folder contains a self-contained example, including a high-level explanation of the pattern/architecture and instructions on how to build and run the particular Spin App(s).

Getting Started with Spin

If you haven't used Spin before, we highly recommend exploring the Fermyon Developer Home to get started. There you'll find everything from installing Spin on your local machine, over language-specific guides, to advanced techniques when building serverless Wasm applications.

Architectures & Patterns in this Repository

CRUD APIs

  • Go CRUD API with persistence in SQLite
  • JavaScript CRUD API with persistence in PostgreSQL
  • JavaScript CRUD API with persistence in SQLite
  • Rust CRUD API with persistence in MySQL

Command and Query Responsibility Segregation (CQRS)

  • Command and Query Responsibility Segregation (CQRS) in Go
  • Command and Query Responsibility Segregation (CQRS) in Rust
  • Command and Query Responsibility Segregation (CQRS) using Spin Service Chaining in Rust and Go

Patterns for building HTTP APIs

  • Content Negotiation
  • Cross-Origin Resource Sharing (CORS)
  • Long Running Jobs over HTTP
  • Transparent Caching

Application Variables (aka Configuration Data)

  • Using the Azure Key Vault Application Variable Provider
  • Using the Vault Application Variable Provider

Webhooks

  • Signed Webhooks using WebAssembly Component Model

Distributed Application Patterns

  • Polyglot Aggregate Pattern implementation
  • Polyglot Publish-Subscribe

Testing

  • How to load test Spin Apps with Grafana k6

Are you looking for a particular pattern or architecture

We do our best to keep the list of enterprise architectures and patterns continuously growing. If you're missing a particular architecture or pattern, create an issue and let us know.