今日已更新 412 条资讯 | 累计 19972 条内容
关于我们

How I Built a Hotel AI Platform in Go (And Every Honest Technical Debt We're Carrying)

Prince Raj 2026年06月04日 20:57 4 次阅读 来源:Dev.to

Building Stayzr meant solving real problems: PMS integration, high-throughput webhook handling, and AI that actually knows your property. Here's how we architected it. The Stack (What's Running in Production) Backend: Go 1.23 with Fiber framework, pgx/v5 connection pooling, Bun ORM over PostgreSQL, Redis for caching/sessions, OpenTelemetry for tracing AI Agents Service: Python 3.11 + FastAPI (Uvicorn), LangChain primitives, Qdrant for knowledge base, ChromaDB for conversation memory Frontend: Next.js 15 / React admin UI + marketing site 3rd-party Integrations: Mews (PMS), WhatsApp Business/Meta, Resend + Postmark (email), Azure Blob Storage (files), Gemini + OpenAI (LLM + embeddings), Infisical (secrets), SigNoz + Oneuptime (observability) It's a polyglot monorepo: Go where throughput and concurrency matter (API, dispatch, sync), Python where the LLM/RAG ecosystem lives. Why Go Over Python/Node/Java? For the parts handling concurrent I/O — PMS sync workers, email dispatch worker, webhook fan-in — Go's goroutines + channels let us run in-process worker pools without pulling in a broker or heavyweight async runtime. The dispatch worker is a for{ select } loop over a ticker and wake channel — simple and effective for our use case. We kept Python only for the agents service because that's where LangChain, Gemini/OpenAI SDKs, and vector-store clients live. The honest answer: Go for systems work, Python where AI tooling requires it. Multi-Tenancy: Row-Level Isolation Shared database, shared schema, row-level isolation by organizationId . Every tenant-scoped table carries an organizationId , with a TenantDB wrapper in the data layer that auto-appends organization_id = $N to queries. Middleware ( MultiTenantContext / RequireTenant ) resolves the org from the X-Organization-ID header, query param, cookie, or JWT claim. Below org we scope further by propertyId (a hotel can have multiple properties). The AI memory store enforces the same boundary differently — every guest's co

本文内容来源于互联网,版权归原作者所有
查看原文