Usage & Enterprise Capabilities
Key Benefits
- Multi-Modal Design: One page, three views (Paper, Whiteboard, Database).
- Privacy First: You own the database, the server, and every byte of data.
- Offline First: Work at lightning speed locally, sync whenever you're ready.
- Collaboration Power: Real-time editing for teams without proprietary lock-in.
- Extreme Portability: Export your work as standard Markdown or JSON at any time.
Production Architecture Overview
- AFFiNE Server: The Node.js application backend.
- PostgreSQL: The primary database for metadata and workspace organization.
- Redis: Used for real-time synchronization and session management.
- S3 / MinIO: Used for persistent storage of user-uploaded files and attachments.
- NGINX / Caddy: A reverse proxy for SSL/TLS and load balancing.
Implementation Blueprint
Implementation Blueprint
Prerequisites
sudo apt update && sudo apt upgrade -y
sudo apt install docker.io docker-compose -y
sudo systemctl enable docker
sudo systemctl start dockerDocker Compose Production Setup
version: '3'
services:
affine:
image: ghcr.io/toeverything/affine-graphql:latest
ports:
- "8080:8080"
environment:
- AFFINE_CONFIG_PATH=/root/.affine/config
- DATABASE_URL=postgres://affine:password@db:5432/affine
- REDIS_URL=redis://redis:6379
depends_on:
- db
- redis
volumes:
- affine_data:/root/.affine
restart: always
db:
image: postgres:15-alpine
environment:
- POSTGRES_USER=affine
- POSTGRES_PASSWORD=password
- POSTGRES_DB=affine
volumes:
- pg_data:/var/lib/postgresql/data
restart: always
redis:
image: redis:7-alpine
restart: always
volumes:
affine_data:
pg_data:Kubernetes Production Deployment (Recommended)
# Deploy using a standard Deployment and Service
kubectl create deployment affine --image=ghcr.io/toeverything/affine-graphql:latest
kubectl expose deployment affine --port=8080- Elastic Scalability: Scale your application pods as your team grows and your document count increases.
- Reliable Persistence: Use Kubernetes PersistentVolumeClaims for your workspace data and S3 for attachments.
- Zero-Downtime Updates: Deploy the latest AFFiNE features without interrupting your team's workflow.
Scaling Strategy
- Object Storage: Always use a dedicated S3-compatible provider for file attachments in production environments.
- Database Tuning: Regularly optimize your PostgreSQL instance for high-frequency metadata queries.
- Caching: Leverage Redis for high-performance real-time synchronization states.
- CDN Strategy: Serve AFFiNE's static frontend assets via a global CDN to improve loading times.
Backup & Safety
- Database Dumps: Automate daily PostgreSQL backups and store them offsite securely.
- Volume Snapshots: Regularly snapshot the persistent volumes containing your workspace data.
- HTTPS Enforcement: Always run AFFiNE behind a secure reverse proxy to encrypt team collaboration.
- Private Network: Keep your AFFiNE instance accessible only via your corporate VPN or a zero-trust network.
Recommended Hosting for AFFiNE
For systems like AFFiNE, we recommend high-performance VPS hosting. Hostinger offers dedicated setups for open-source tools with one-click installer scripts and 24/7 priority support.
Get Started on HostingerExplore Alternative Tools Infrastructure
Kubernetes
Kubernetes is a production-grade, open-source platform for automating deployment, scaling, and operations of application containers.
Supabase
Supabase is the leading open-source alternative to Firebase. It provides a full backend-as-a-service (BaaS) powered by PostgreSQL, including authentication, real-time subscriptions, and storage.