Date: 2025-11-24 Status: Ready to Deploy
You now have 3 options for deploying GraphDB staging environment:
| Option | Time | Effort | Flexibility | Recommended For |
|---|---|---|---|---|
| 1. Custom Image (Packer) | 5 min | Low | Medium | Production-like testing |
| 2. Manual Deployment | 2-3 hours | High | High | Learning, customization |
| 3. Docker (Marketplace) | 10 min | Low | Low | Quick testing |
- ⚡ Fastest: 5 minutes from nothing to running server
- 🔒 Consistent: Same configuration every time
- 📦 Pre-built: GraphDB binary already compiled
- 🚀 Scalable: Deploy multiple instances instantly
- ✅ Tested: Image verified before use
- Staging: $22/month (droplet $12 + volume $10)
- Weekly backups: $7/month (4 weekly snapshots)
- Image storage: $2.50/month (50GB snapshot)
- Total: $31.50/month
# 1. Build image (one-time, ~15 minutes)
cd /home/ddowney/Workspace/github.com/graphdb/packer
export DIGITALOCEAN_API_TOKEN="your-token"
packer build graphdb-staging.pkr.hcl
# 2. Deploy from image (~5 minutes)
doctl compute droplet create graphdb-staging \
--image <snapshot-id> \
--size s-1vcpu-2gb \
--region nyc1 \
--ssh-keys <your-key>
# 3. Attach volume
doctl compute volume create graphdb-data --region nyc1 --size 100GiB
doctl compute volume-action attach <volume-id> <droplet-id>
# 4. SSH and mount
ssh root@<droplet-ip>
mkfs.ext4 -F /dev/disk/by-id/scsi-0DO_Volume_graphdb-data
mount -o discard,defaults /dev/disk/by-id/scsi-0DO_Volume_graphdb-data /mnt/graphdb-data
echo '/dev/disk/by-id/scsi-0DO_Volume_graphdb-data /mnt/graphdb-data ext4 defaults,nofail,discard 0 2' >> /etc/fstab
mkdir -p /mnt/graphdb-data/{data,wal,audit,backups}
chown -R graphdb:graphdb /mnt/graphdb-data
# 5. Start GraphDB
systemctl start graphdb
curl http://localhost:8080/health
# Done! 🎉- Build guide:
/home/ddowney/Workspace/github.com/graphdb/packer/README-CUSTOM-IMAGE.md - Packer template:
/home/ddowney/Workspace/github.com/graphdb/packer/graphdb-staging.pkr.hcl
- 🎛️ Full control: Customize every step
- 📚 Educational: Learn how everything works
- 🔧 Flexible: Easy to modify on the fly
- 🐛 Debugging: Understand each component
- Staging: $22/month (droplet $12 + volume $10)
- Time investment: 2-3 hours first time, 30 min after practice
# Follow the comprehensive step-by-step guide
cat /home/ddowney/Workspace/github.com/graphdb/SYNTOPICA-STAGING-DEPLOYMENT.md- Full deployment guide:
/home/ddowney/Workspace/github.com/graphdb/SYNTOPICA-STAGING-DEPLOYMENT.md(1,020 lines) - Includes: Setup, configuration, monitoring, DR drill, troubleshooting
- 🐳 Containerized: Isolation and portability
- 🛒 One-click: From DigitalOcean Marketplace (future)
- 🔄 Easy updates: Pull new image
- 📦 Self-contained: All dependencies in container
- Staging: $22/month (droplet $12 + volume $10)
- Overhead: Docker uses ~200MB RAM extra
# 1. Build marketplace image
cd /home/ddowney/Workspace/github.com/graphdb/packer
packer build graphdb.pkr.hcl
# 2. Deploy and use Docker Compose
ssh root@<droplet-ip>
cd /var/lib/graphdb
docker compose up -d
# Done!- Marketplace template:
/home/ddowney/Workspace/github.com/graphdb/packer/graphdb.pkr.hcl - Docker Compose: Included in image at
/var/lib/graphdb/docker-compose.yml
| Feature | Custom Image | Manual | Docker |
|---|---|---|---|
| Deployment Time | 5 min | 2-3 hours | 10 min |
| Memory Overhead | None | None | 200MB |
| Performance | Native | Native | Container overhead |
| Flexibility | Medium | High | Low |
| Scalability | Excellent | Manual | Good |
| Updates | Rebuild image | Manual steps | Pull image |
| Complexity | Low | High | Low |
| Best For | Production-like | Learning | Quick tests |
Why:
-
Speed: After initial 15-min build, deploy in 5 minutes
- Perfect for 48-hour soak test iterations
- Disaster recovery: spin up replacement in 60 seconds
-
Consistency: Eliminates "works on my machine" issues
- Same image for staging and production
- Reproducible deployments
-
Cost-effective: $2.50/month for image storage
- Time saved: ~2-3 hours per deployment
- After 2nd deployment, ROI is positive
-
Scalability: Need more GraphDB instances?
- Multi-region: Deploy to NYC, SFO, AMS instantly
- Load balancing: Multiple instances behind Cloudflare
-
Production-ready: This is how production systems are deployed
- Netflix, Spotify, GitHub all use custom images
- Industry best practice
Workflow:
# Week 1: Build image once
packer build graphdb-staging.pkr.hcl # 15 minutes
# Weeks 2-52: Deploy instantly
doctl compute droplet create ... --image <snapshot-id> # 60 seconds
# + 4 minutes for volume mount and start
# Test failed? Need fresh environment?
doctl compute droplet delete graphdb-staging-01
doctl compute droplet create graphdb-staging-01 --image <snapshot-id>
# Fresh environment in 5 minutes! 🚀Do you need GraphDB staging NOW (< 30 min)?
├─ YES: Have you built custom image already?
│ ├─ YES → Use Custom Image (5 min)
│ └─ NO → Use Docker (10 min), build custom image later
└─ NO: Want to learn or customize heavily?
└─ YES → Use Manual Deployment (2-3 hours)
# 1. Install Packer
brew install packer # or download from packer.io
# 2. Install doctl
brew install doctl
# 3. Authenticate
doctl auth init # Enter your DO API token
export DIGITALOCEAN_API_TOKEN="your-token"
# 4. Build image
cd /home/ddowney/Workspace/github.com/graphdb/packer
packer validate graphdb-staging.pkr.hcl
packer build graphdb-staging.pkr.hcl
# Wait ~15 minutes...
# Output: Snapshot ID (save this!)# 1. Create droplet from snapshot
doctl compute droplet create graphdb-staging \
--image <snapshot-id> \
--size s-1vcpu-2gb \
--region nyc1 \
--ssh-keys <your-key-id> \
--enable-monitoring \
--wait
# 2. Create and attach volume
doctl compute volume create graphdb-data --region nyc1 --size 100GiB
doctl compute volume-action attach <volume-id> <droplet-id>
# 3. Mount volume
ssh root@<droplet-ip>
mkfs.ext4 -F /dev/disk/by-id/scsi-0DO_Volume_graphdb-data
mount -o discard,defaults /dev/disk/by-id/scsi-0DO_Volume_graphdb-data /mnt/graphdb-data
echo '/dev/disk/by-id/scsi-0DO_Volume_graphdb-data /mnt/graphdb-data ext4 defaults,nofail,discard 0 2' >> /etc/fstab
mkdir -p /mnt/graphdb-data/{data,wal,audit,backups}
chown -R graphdb:graphdb /mnt/graphdb-data
# 4. Start services
systemctl start graphdb
systemctl status graphdb
# 5. Test
curl http://localhost:8080/health
# {"status":"healthy","uptime_seconds":5}# 1. Authenticate
cloudflared tunnel login
# 2. Create tunnel
cloudflared tunnel create graphdb-staging
# 3. Configure
vim /etc/cloudflared/config.yaml
# Update tunnel ID and hostname
# 4. Route DNS
cloudflared tunnel route dns graphdb-staging graphdb-staging.yourdomain.com
# 5. Start
systemctl start cloudflared
systemctl enable cloudflared
# 6. Test
curl https://graphdb-staging.yourdomain.com/health# 1. Update Syntopica Workers
cd ~/Workspace/github.com/syntopica-v2/workers
npx wrangler secret put GRAPHDB_URL
# Enter: https://graphdb-staging.yourdomain.com
# 2. Deploy Workers
npx wrangler deploy --env staging
# 3. Sync data
curl -X POST https://staging.yourdomain.com/api/internal/sync/batch/all \
-H "Authorization: Bearer $ADMIN_API_KEY"
# 4. Verify
curl https://graphdb-staging.yourdomain.com/stats | jq '.'
# {"nodes": 5000, "edges": 18000, ...}Total time: 30 minutes (15 min build + 15 min deploy) Future deployments: 5 minutes (using existing image)
A: Yes! Just modify the Packer template:
- Change
sizefroms-1vcpu-2gbtos-2vcpu-4gb - Update
environmentvariable toproduction - Build new image:
packer build -var="environment=production" graphdb-staging.pkr.hcl
A: Rebuild the image:
cd ~/Workspace/github.com/graphdb
git pull # Get latest changes
cd packer
packer build graphdb-staging.pkr.hcl
# New snapshot created with latest codeA: Yes! Edit the Packer template:
- Modify configuration templates in
packer/config/ - Add provisioning steps in
graphdb-staging.pkr.hcl - Update scripts in
packer/scripts/
A: Update snapshot_regions in Packer template:
snapshot_regions = ["nyc1", "sfo3", "ams3", "lon1"]Rebuild image - snapshot replicated to all regions automatically.
A:
- Snapshot storage: $0.05/GB/month
- 50GB image = $2.50/month
- Each additional region snapshot = $2.50/month
- Build time: $0.03 (15 min of temporary droplet)
Total: ~$2.50/month for single-region, ~$10/month for 4 regions
- DEPLOYMENT-OPTIONS.md (this file) - Overview of all options
- SYNTOPICA-STAGING-DEPLOYMENT.md - Manual deployment guide (1,020 lines)
- packer/README-CUSTOM-IMAGE.md - Custom image guide
- packer/graphdb-staging.pkr.hcl - Staging image template
- packer/graphdb.pkr.hcl - Marketplace/Docker image template
- FUZZING-E2E-SUMMARY.md - Testing improvements summary
- GOCERT-VERIFICATION-REPORT.md - Formal verification findings
- GOCERT-FIX-SUMMARY.md - Critical bug fix summary
You're ready to deploy GraphDB staging!
Fastest path to running system:
- Build custom image: 15 minutes
- Deploy to DigitalOcean: 5 minutes
- Setup Cloudflare Tunnel: 5 minutes
- Integrate Syntopica: 5 minutes
- Total: 30 minutes to fully operational staging environment
Then:
- Run 48-hour soak test with real Syntopica workload
- Perform DR drill (backup/restore)
- Validate production readiness
Production readiness: 75% → 80%+ after soak test and DR drill ✅
Ready to start?
cd /home/ddowney/Workspace/github.com/graphdb/packer
cat README-CUSTOM-IMAGE.md # Read the guide
packer build graphdb-staging.pkr.hcl # Build the image!Author: Claude Code Last Updated: 2025-11-24 Status: Ready to Deploy 🚀