Installation
The
ddp package is typically included by default in Meteor applications. It combines ddp-client and ddp-server.Overview
DDP is a protocol that enables:- Remote Procedure Calls (Methods): Call server functions from the client
- Publications and Subscriptions: Real-time data synchronization
- Latency Compensation: Optimistic UI updates with automatic rollback
- Automatic Reconnection: Resilient connection handling
- Collection Synchronization: Keep client and server data in sync
Package Information
- Version: 1.4.2
- Summary: Meteor’s latency-compensated distributed data framework
- Components:
ddp-client- Client-side DDP implementationddp-server- Server-side DDP implementationddp-common- Shared utilitiesddp-rate-limiter- Rate limiting for security
Architecture
DDP operates over WebSocket connections with automatic fallback:Exports
DDP- Client and serverDDPServer- Server only
Connecting to DDP Servers
Default Connection
Meteor apps automatically connect to their own server:Additional Connections
Connect to other DDP servers:The URL of the DDP server to connect to
Connection options
Connection Options
Connection Status
Reactive Status
Manual Connection Control
Methods (RPC)
Defining Methods
Calling Methods
Method Context
Inside a method,this provides:
Publications and Subscriptions
Publishing Data
Subscribing to Data
Subscription Callbacks
Latency Compensation
DDP implements optimistic UI updates:Disabling Simulation
DDP Message Format
DDP uses JSON messages over WebSocket:Method Call
Method Result
Subscribe
Data Added
Data Changed
Data Removed
Rate Limiting
Protect methods and publications from abuse:Connection Hooks
Related Packages
ddp-rate-limiter
Rate limiting for DDP methods and subscriptions
mongo
MongoDB integration with DDP
accounts-base
User accounts over DDP
webapp
HTTP server for DDP