How it helps your business
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.
How we deploy this for you
Security Hardened
Firewalls, SSL, and hardened kernels out of the box.
Performance Tuned
Optimized for speed with cache and DB fine-tuning.
Automated Backups
Daily off-site backups so you never lose your data.
Private Cloud
You own the server and the data. No middleman.
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.
Includes Security & performance standards
Best place to host AFFiNE
We recommend Hostinger for its reliability and low cost. It's the perfect home for your new apps, featuring easy setup and 24/7 support.
Get Started on HostingerCompare Similar Tools
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.