Frequently Asked Questions¶
Common questions and answers about Amebo usage, deployment, and troubleshooting.
General Questions¶
What is Amebo?¶
Amebo is an HTTP Event Notifications Server that acts as a schema registry and event broadcast runtime. It enables applications to communicate through events without being tightly coupled to specific messaging systems like Kafka, RabbitMQ, or SQS.
How is Amebo different from Kafka or RabbitMQ?¶
Feature | Amebo | Kafka | RabbitMQ |
---|---|---|---|
Protocol | HTTP/REST | Binary/TCP | AMQP/Binary |
Schema Registry | Built-in | Separate service | Plugin required |
Delivery | HTTP webhooks | Pull-based | Push/Pull |
Setup Complexity | Simple | Complex | Moderate |
Language Support | Any HTTP client | Client libraries | Client libraries |
When should I use Amebo?¶
Amebo is ideal for:
- Microservices that need loose coupling
- Event-driven architectures with HTTP-based services
- Webhook delivery systems
- Schema validation requirements
- Simple deployment needs
- Multi-language environments
What are the performance characteristics?¶
- Latency: Sub-10ms response times
- Throughput: 1000+ events/second per instance
- Scalability: Horizontal scaling with load balancer
- Reliability: ACID transactions with automatic retries
Installation & Setup¶
What are the system requirements?¶
Minimum: - 1 CPU core, 512MB RAM - Python 3.8+ or Docker - 1GB storage
Recommended: - 2+ CPU cores, 2GB+ RAM - PostgreSQL database - 10GB+ SSD storage
Can I use SQLite in production?¶
SQLite is suitable for: - Development environments - Small deployments (< 100 events/day) - Single instance setups
For production, use PostgreSQL for: - High availability clustering - Better performance at scale - ACID compliance across instances
How do I migrate from SQLite to PostgreSQL?¶
# 1. Export data from SQLite
sqlite3 amebo.db .dump > amebo_backup.sql
# 2. Convert to PostgreSQL format
# (Manual conversion or use migration tools)
# 3. Import to PostgreSQL
psql -U amebo -d amebo -f amebo_backup_pg.sql
# 4. Update configuration
# Change AMEBO_DSN to PostgreSQL connection string
Configuration¶
How do I configure clustering?¶
Use the Docker cluster setup:
# Clone repository
git clone https://github.com/rayattack/amebo.git
cd amebo
# Start 3-instance cluster
./start-cluster.sh
Or manually configure multiple instances with shared database.
What environment variables are available?¶
Variable | Description | Default |
---|---|---|
AMEBO_SECRET | JWT signing secret | Required |
AMEBO_DSN | Database connection string | Required |
AMEBO_PORT | Server port | 3310 |
AMEBO_USERNAME | Admin username | admin |
AMEBO_PASSWORD | Admin password | Required |
AMEBO_ENVELOPE | Batch size | 256 |
AMEBO_IDLES | Idle sleep time (seconds) | 5 |
AMEBO_REST_WHEN | Rest threshold | 0 |
How do I secure Amebo in production?¶
- Change default credentials
- Use strong secrets (32+ characters)
- Enable HTTPS with SSL certificates
- Configure firewall rules
- Use environment variables for secrets
- Enable authentication for all endpoints
- Regular security updates
API Usage¶
How do I authenticate API requests?¶
# 1. Get JWT token
curl -X POST http://localhost/v1/tokens \
-H "Content-Type: application/json" \
-d '{"username": "admin", "password": "your-password"}'
# 2. Use token in requests
curl -H "Authorization: Bearer YOUR_TOKEN" \
http://localhost/v1/applications
What's the difference between actions and events?¶
- Actions are event type definitions with schemas
- Events are actual instances of actions with data
Think of actions as "classes" and events as "instances" in programming terms.
How do I handle webhook failures?¶
Amebo automatically retries failed webhooks with exponential backoff:
- Immediate retry
- 2 seconds delay
- 4 seconds delay
- 8 seconds delay
- 16 seconds delay
After max retries, events go to dead letter queue.
Can I replay events?¶
Yes, use the replay endpoint:
# Replay specific event
curl -X POST http://localhost/v1/regists/event-123
# Get events for manual replay
curl "http://localhost/v1/events?from=2024-12-01&action=user.created"
Schema Management¶
How do I version schemas?¶
Use semantic versioning in action names:
# Version 1
"action": "user.created.v1"
# Version 2 (breaking changes)
"action": "user.created.v2"
# Or use namespacing
"action": "v2.user.created"
What JSON Schema features are supported?¶
Amebo supports JSON Schema Draft 7:
- Types: string, number, integer, boolean, array, object, null
- Formats: email, date-time, uri, uuid, etc.
- Validation: required, minimum, maximum, pattern, etc.
- Composition: allOf, anyOf, oneOf, not
- References: $ref (within same schema)
How do I handle schema evolution?¶
- Additive changes: Add optional fields
- Breaking changes: Create new action version
- Deprecation: Mark old actions as deprecated
- Migration: Provide migration tools/scripts
Troubleshooting¶
Events are not being delivered¶
Check these common issues:
- Webhook endpoint is accessible
- Subscription is correctly configured
- Application is registered
- Network connectivity between Amebo and target
- Webhook handler returns 200-299 status
High memory usage¶
Optimize configuration:
# Reduce batch size
AMEBO_ENVELOPE=128
# Increase idle time
AMEBO_IDLES=10
# Adjust rest threshold
AMEBO_REST_WHEN=5
Database connection errors¶
For PostgreSQL:
# Check service status
sudo systemctl status postgresql
# Test connection
psql -h localhost -U amebo -d amebo
# Check connection limits
SELECT * FROM pg_stat_activity;
Slow response times¶
Performance tuning:
- Database indexing: Ensure proper indexes
- Connection pooling: Configure pool size
- Batch processing: Optimize envelope size
- Resource allocation: Increase CPU/RAM
- Load balancing: Add more instances
Monitoring & Operations¶
What metrics should I monitor?¶
Key metrics:
- Response time: < 10ms average
- Error rate: < 1%
- Event throughput: Events/second
- Webhook delivery rate: Success percentage
- Database connections: Pool utilization
- Memory usage: < 80%
- CPU usage: < 80%
How do I set up monitoring?¶
Use the included monitoring stack:
# Start monitoring
docker-compose -f docker-compose.monitoring.yml up -d
# Access Grafana
open http://localhost:3000
How do I backup data?¶
# PostgreSQL backup
docker exec amebo-postgres pg_dump -U amebo amebo > backup.sql
# Automated backup script
cat > backup.sh << 'EOF'
#!/bin/bash
BACKUP_DIR="/opt/amebo/backups"
mkdir -p $BACKUP_DIR
docker exec amebo-postgres pg_dump -U amebo amebo > $BACKUP_DIR/amebo-$(date +%Y%m%d).sql
find $BACKUP_DIR -name "*.sql" -mtime +7 -delete
EOF
chmod +x backup.sh
echo "0 2 * * * /path/to/backup.sh" | crontab -
Integration¶
How do I integrate with existing systems?¶
Common integration patterns:
- API Gateway: Route events through gateway
- Message Queues: Bridge to existing queues
- Databases: Trigger events on data changes
- Monitoring: Send events to monitoring systems
- Analytics: Stream events to analytics platforms
Can I use Amebo with Kubernetes?¶
Yes, see the Kubernetes deployment example:
apiVersion: apps/v1
kind: Deployment
metadata:
name: amebo
spec:
replicas: 3
selector:
matchLabels:
app: amebo
template:
metadata:
labels:
app: amebo
spec:
containers:
- name: amebo
image: rayattack/amebo:latest
ports:
- containerPort: 3310
env:
- name: AMEBO_SECRET
valueFrom:
secretKeyRef:
name: amebo-secret
key: secret
How do I migrate from other event systems?¶
Migration strategies:
- Parallel running: Run both systems simultaneously
- Gradual migration: Move services one by one
- Event bridging: Forward events between systems
- Schema mapping: Convert existing schemas
- Testing: Validate event delivery
Getting Help¶
Where can I get support?¶
- Documentation: This comprehensive guide
- GitHub Issues: Report bugs
- Discussions: Ask questions
- Community: Join the community forums
How do I report a bug?¶
- Check existing issues first
- Provide minimal reproduction case
- Include logs and error messages
- Specify version and environment
- Use issue template if available
How do I contribute?¶
See the Contributing Guide for:
- Code contributions
- Documentation improvements
- Bug reports
- Feature requests
- Community support