DjangoCon Europe 2023 | Building and scaling a live event platform with django-channels

Building a scalable live event platform with Django Channels, covering real-time communication, high availability, sharding, and performance optimization techniques.

Key takeaways
  • Using Django Channels for real-time communication allows for scalability and flexibility.
  • For high availability, ensure that components are designed to fail individually, with redundancy in case of failures.
  • Channels’ concept of layers and groups can be used to implement sharding, distributing load across multiple machines.
  • When working with multiple protocols, use ASGI servers to handle different protocols (e.g. HTTP, WebSocket).
  • Consider using instrumentation tools like StatsD and Prometheus to measure performance and identify bottlenecks.
  • In addition to code instrumentation, use external tools like K6 for load testing to measure performance under realistic user behavior.
  • Use caching and memoization to reduce database queries and improve performance.
  • For real-time communication, consider using WebSockets over traditional HTTP or other protocols.
  • When handling high volumes of requests, consider using distributed architectures and load balancers.
  • When using channels, use the Groups feature to broadcast messages to specific users or groups of users.
  • Use decorators to simplify and reuse code.
  • In addition to channel-based communication, use service end events for additional features like video conferencing and live streaming.
  • When developing real-time communication systems, focus on scalability and flexibility, and plan for failures and unexpected behavior.