This coursework trains engineering teams migrating from slow, interpreted, memory-heavy environments (Python, Next.js, Node.js, Ruby on Rails) to Hanzo's high-performance native stack (Go, Rust, C++).
Category: Hanzo Ecosystem & Engineering Curriculum Level: Intermediate to Advanced Prerequisites: Familiarity with web services, basic understanding of concurrency. Related Skills: hanzo/hanzo-migrate-backend-to-go.md, hanzo/hanzo-base.md, hanzo/hanzo-cloud.md, hanzo/hanzo-tutorial-realtime-sse-backend.md, hanzo/hanzo-examples-native-cloud.md
This coursework trains engineering teams migrating from slow, interpreted, memory-heavy environments (Python, Next.js, Node.js, Ruby on Rails) to Hanzo's high-performance native stack (Go, Rust, C++).
┌─────────────────────────────────────────────────────────────────────────────┐
│ CURRICULUM: FULLSTACK CLOUD ENGINEERING WITH GO │
│ │
│ [MODULE 1] Architectural Foundations & Runtime Shift │
│ - Why native compiled code wins: Go, Rust & C++ │
│ - Benchmarking: 15ms cold starts vs 6s Next.js SSR │
│ │
│ [MODULE 2] Running Your Own Cloud Locally │
│ - Base and the open-source cloud, from a checkout │
│ - start commands: skill.md, On your own machine │
│ │
│ [MODULE 3] Realtime SSE Streaming & State Synchronization │
│ - Native Server-Sent Events (SSE) in Go │
│ - Zero-overhead streaming without Pusher / external SaaS │
│ │
│ [MODULE 4] Extending Hanzo Cloud with `/v1/*` Subsystems │
│ - Plugin host architecture & ZAP binary transport (HIP-0114) │
│ - Wiring routes in `manifest/apps.go` │
│ │
│ [MODULE 5] Production Observability, Storage & Deployment │
│ - Embedded SQLite + ClickHouse datastore hybrid │
│ - Zero-dependency static binary deployments (`CGO_ENABLED=0`) │
└─────────────────────────────────────────────────────────────────────────────┘
Interpreted runtimes impose hidden taxes in enterprise environments:
asyncio) suffer from event-loop starvation and heavy memory fragmentation.node_modules, cold start latencies (1.5s - 8s), high idle footprint (250MB+ per SSR container), and fragile build tooling.github.com/hanzoai/base, github.com/hanzoai/cloud):CGO_ENABLED=0).M:N runtime with non-blocking network pollers.hanzoai/engine, hanzoai/reth):Compare a basic Next.js / FastAPI endpoint against a Go Hanzo Base endpoint:
# Build Go binary statically
CGO_ENABLED=0 go build -ldflags="-s -w" -o ./bin/server ./main.go
# Inspect size and launch time
ls -lh ./bin/server
time ./bin/server --healthcheck
Expected Result: Binary size < 25MB, startup time < 15 milliseconds.
Base and the open-source cloud start from a checkout, with no account.
Never mock third-party cloud APIs. Run the actual Hanzo services in-process.
# Base, in a checkout of github.com/hanzoai/base
go run ./examples/base serve
curl -i http://127.0.0.1:8090/v1/health # from a second terminal
# the cloud, in a checkout of github.com/hanzoai/cloud
make build && CLOUD_DEV_UNENCRYPTED=1 CLOUD_LISTEN=127.0.0.1:8080 CLOUD_DATA_DIR=.dev/data ./cloud
curl -s http://127.0.0.1:8080/v1/openapi.json # from a second terminal
The cloud runs unencrypted this way, for local development only. Every part that runs locally, and what needs the hosted cloud, is in skill.md under On your own machine.
Last-Event-ID.A lock-free, concurrent SSE multiplexer:
package realtime
import (
"fmt"
"net/http"
"sync"
"time"
)
type Event struct {
ID string
Event string
Data []byte
}
type Hub struct {
mu sync.RWMutex
clients map[chan Event]struct{}
}
func NewHub() *Hub {
return &Hub{
clients: make(map[chan Event]struct{}),
}
}
func (h *Hub) Subscribe() chan Event {
ch := make(chan Event, 64)
h.mu.Lock()
h.clients[ch] = struct{}{}
h.mu.Unlock()
return ch
}
func (h *Hub) Unsubscribe(ch chan Event) {
h.mu.Lock()
delete(h.clients, ch)
close(ch)
h.mu.Unlock()
}
func (h *Hub) Broadcast(e Event) {
h.mu.RLock()
defer h.mu.RUnlock()
for ch := range h.clients {
select {
case ch <- e:
default:
// Client channel full; drop or handle slow consumer
}
}
}
func (h *Hub) Handler() http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
flusher, ok := w.(http.Flusher)
if !ok {
http.Error(w, "Streaming unsupported", http.StatusInternalServerError)
return
}
w.Header().Set("Content-Type", "text/event-stream")
w.Header().Set("Cache-Control", "no-cache")
w.Header().Set("Connection", "keep-alive")
w.Header().Set("X-Accel-Buffering", "no")
ch := h.Subscribe()
defer h.Unsubscribe(ch)
ticker := time.NewTicker(15 * time.Second)
defer ticker.Stop()
for {
select {
case <-r.Context().Done():
return
case <-ticker.C:
fmt.Fprintf(w, ": heartbeat\n\n")
flusher.Flush()
case e := <-ch:
if e.ID != "" {
fmt.Fprintf(w, "id: %s\n", e.ID)
}
if e.Event != "" {
fmt.Fprintf(w, "event: %s\n", e.Event)
}
fmt.Fprintf(w, "data: %s\n\n", e.Data)
flusher.Flush()
}
}
}
}
# Listen to live stream
curl -N http://localhost:8090/v1/events/stream
/v1/* SubsystemsHanzo Cloud (hanzoai/cloud) uses a host + plugin registry architecture connected via ZAP Transport (HIP-0114).
Every subsystem implements cloud.Plugin:
package custom
import (
"net/http"
"github.com/hanzoai/cloud"
)
func init() {
cloud.Register("analytics-custom", NewPlugin)
}
type Plugin struct{}
func NewPlugin(cfg *cloud.Config) (cloud.Plugin, error) {
return &Plugin{}, nil
}
func (p *Plugin) Mount(mux *http.ServeMux) {
mux.HandleFunc("POST /v1/custom/ingest", p.HandleIngest)
mux.HandleFunc("GET /v1/custom/stats", p.HandleStats)
}
func (p *Plugin) HandleIngest(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusAccepted)
w.Write([]byte(`{"status":"queued"}`))
}
func (p *Plugin) HandleStats(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
w.Write([]byte(`{"active_workers":16,"throughput_per_sec":124000}`))
}
modernc.org/sqlite) for single-binary zero-dependency nodes or PostgreSQL (pgx/v5).Every module must ship with automated tests proving correctness:
// hub_test.go
package realtime_test
import (
"context"
"net/http"
"net/http/httptest"
"testing"
"time"
"github.com/hanzoai/base/realtime"
)
func TestSSEHub(t *testing.T) {
hub := realtime.NewHub()
server := httptest.NewServer(hub.Handler())
defer server.Close()
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
defer cancel()
req, _ := http.NewRequestWithContext(ctx, "GET", server.URL, nil)
resp, err := http.DefaultClient.Do(req)
if err != nil {
t.Fatalf("Failed to connect to SSE stream: %v", err)
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
t.Errorf("Expected status 200, got %d", resp.StatusCode)
}
if ct := resp.Header.Get("Content-Type"); ct != "text/event-stream" {
t.Errorf("Expected Content-Type text/event-stream, got %s", ct)
}
}
By completing this coursework, your engineering team possesses the patterns, tooling, and architectural foundation to:
hanzo.ai and api.hanzo.ai).