Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Services, Architecture and Channels

Services, Architecture and Channels

A talk I gave at DjangoCon Europe 2017 in Florence, Italy

Andrew Godwin

April 03, 2017
Tweet

More Decks by Andrew Godwin

Other Decks in Programming

Transcript

  1. Andrew Godwin Hi, I'm Django core developer Senior Software Engineer

    at Apparently now does software architecture
  2. The Monolith Only one version of any dependency Everything can

    import everything Deployed all at once No separation Side-effects from other code
  3. Services Code split up by purpose/team Defined cross-boundary API Deployed

    separately Can use different versions of dependencies Isolated from each other
  4. Channel Layer Interface Server Worker Server Process 1 ASGI ASGI

    Asynchronous socket handling Synchronous Django project Interface Server Worker Server ASGI ASGI Worker Server ASGI Process 2 Process 3 Process 4
  5. At-most-once delivery ASGI's Tradeoffs You have to design for potential

    loss Low-latency but non-persistent Good for protocols, bad for important task queues Capacity, Backpressure and FIFO Informs producers quickly about pileups in the queue