Configuration
To run Edge Server, you need a configuration file in YAML format. This can be configured in two ways: Small Peers Only mode or Server Sync mode.Small Peers Only
Small Peers Only mode is a connection configuration type that restricts the Edge Server to only synchronize with other small peers (SDK instances) in the mesh network over LAN, BLE, and other local transport protocols. The HTTP API is still accessible in this mode. See HTTP Server Configuration If you are using the Edge Server in a small peer only mode, you can use the following configuration:Cloud Sync
The Edge Server can authenticate with the cloud platform (either Ditto-operated Cloud or your own) using your own authentication webhook provider. You will need to provide the appropriate credentials in your configuration file.Field | Example | Description |
---|---|---|
db_id | a673b537-c02d-48da... | Also known as “AppID” |
access_token | f72cbeb1-3735-59ef... | Your app’s unique access token |
provider | __playgroundProvider | The provider name. If using Online Playground mode, use __playgroundProvider as your provider. |
auth_url | https://i38a.dittolive.app | The URL for the Ditto authentication service |
Authentication & Permissions
When using Small Peer Only mode or Playground mode, all reads and writes are permitted. If you need more granular control over permissions, you can use Ditto’s authentication webhook provider system, which is configurable in the Ditto Portal. Edge server is compatible with these webhook providers. Youcan configure connections to your webhook provider by providing the applicable token and provider name in the edge server configuration file. To learn more about custom authentication, see the Authentication Guide.
Best Practices
- Use UUIDs for db_id: Always use valid UUIDv4 format for database IDs
- Descriptive device names: Choose meaningful names for easier debugging
- Limit subscriptions: Only sync data you need to minimize bandwidth and storage
- Secure credentials: Use environment variables or secrets management for tokens
- Plan persistence: Choose appropriate storage locations with sufficient space
- Test connectivity: Verify network paths before deploying to production
Troubleshooting
Database Won’t Start
Check:db_id
is valid UUIDv4 format- Authentication credentials are correct
- Persistence directory has write permissions
- No other process is using the same database files
Peers Not Syncing
Verify:- Both peers have the same
db_id
- Authentication modes are compatible
- Network connectivity exists between peers
- Firewall rules allow Ditto traffic
High Disk Usage
Review:- Subscription queries aren’t too broad
- Log level isn’t set to
verbose
- Old log files are being rotated/cleaned