Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
40만명이 쓰는 Django channels 채팅서버, 우리는 어떻게 만들었나?
Search
Eunju Amy Sohn
August 17, 2018
Programming
1
2.5k
40만명이 쓰는 Django channels 채팅서버, 우리는 어떻게 만들었나?
2018 Pycon. @EJSohn
Eunju Amy Sohn
August 17, 2018
Tweet
Share
More Decks by Eunju Amy Sohn
See All by Eunju Amy Sohn
내가 커뮤니티 스피킹을 하는 이유
ejsohn
1
410
Cloud Deep Learning for everyone
ejsohn
0
150
Microservice with go and gRPC
ejsohn
1
610
Spot Utilization for GPU Instance Cost Efficiency
ejsohn
0
110
Implementing Reactive Programming with ReSwift
ejsohn
0
210
Other Decks in Programming
See All in Programming
SODA - FACT BOOK(JP)
sodainc
1
9.1k
開発組織の戦略的な役割と 設計スキル向上の効果
masuda220
PRO
10
2k
Designing Repeatable Edits: The Architecture of . in Vim
satorunooshie
0
200
Blazing Fast UI Development with Compose Hot Reload (Bangladesh KUG, October 2025)
zsmb
2
440
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
650
Webサーバーサイド言語としてのRustについて
kouyuume
1
5k
マンガアプリViewerの大画面対応を考える
kk__777
0
430
はじめてのDSPy - 言語モデルを『プロンプト』ではなく『プログラミング』するための仕組み
masahiro_nishimi
4
17k
AIと人間の共創開発!OSSで試行錯誤した開発スタイル
mae616
2
840
TransformerからMCPまで(現代AIを理解するための羅針盤)
mickey_kubo
7
5.8k
SwiftDataを使って10万件のデータを読み書きする
akidon0000
0
250
CSC509 Lecture 08
javiergs
PRO
0
270
Featured
See All Featured
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
191
56k
Thoughts on Productivity
jonyablonski
72
4.9k
How to Ace a Technical Interview
jacobian
280
24k
Become a Pro
speakerdeck
PRO
29
5.6k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.7k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.3k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
2
210
Context Engineering - Making Every Token Count
addyosmani
8
330
GraphQLの誤解/rethinking-graphql
sonatard
73
11k
Documentation Writing (for coders)
carmenintech
76
5.1k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
285
14k
Navigating Team Friction
lara
190
15k
Transcript
40만명이 쓰는 Django channels 채팅서버, 우리는 어떻게 만들었나? Pycon Korea
2018 Eunju Sohn (Amy)
Name: 손은주 Nickname: Amy Who: Devops Engineer @Mathpresso Comment: I
love The magical moment! github: http://github.com/EJSohn email:
[email protected]
Contents 1. Why? 1. background explanation 2. introduce Django channels
2. How? 1. server-client communication protocol 2. coding 3. testing 4. deployment & maintenance
Why? Slack – Java Facebook Messenger – Erlang Line –
Java, C++, Erlang Kakaotalk – C++ Snapchat – Java * 구글링 첫 페이지에 나온 정보들입니다. 신뢰도가 그리 높지 않습니다 ㅠ
Why? – background explanation Mathpresso Dev Team
Why? – background explanation Main language: Python + deeply use
Django ORM + fast action and output required + but all thing has to be maintainable and scalable Had to make Reliable app Faster, with existing technical stack
Why? – background explanation
Why? – Django channels
Why? – Django channels • ASGI • Asynchronous webserver •
Consumer • Daphne • Channel layer
Why? – Django channels ASGI? = Asynchronous Server Gateway Interface
Spiritual successor of wsgi. Extend not only support HTTP-style request/response but also websocket and others.
Why? – Django channels myapp/myapp/asgi.py
Why? – Django channels
Why? – Django channels Daphne HTTP request websocket request mysite.urls
mysite.routing
How? – server-client communication protocol
How? – server-client communication protocol Requirement User – Bot 1:1
chatting with multiple templates User – User 1:1 chatting User group chatting
How? – server-client communication protocol Had to build communication protocol
& • Communicating text, byte-data based pre-defined json. • Serializing& deserializing into object.
How? – coding
How? – coding Store chat data in NoSQL
How? – coding async/await Remove all I/O bottleneck • Network
I/O • Database I/O
How? – coding aiohttp
How? – coding database_sync_to_async
Why? – testing pytest-asyncio HTTPCommunicator WebsocketCommuniator
Why? – testing Chat-client https://github.com/websocket-client/websocket-client
How? – deployment & maintenance machine daphne nginx Load balancer
80 endpoint1:80 endpoint2:80
Why? – conclusion 소수의 인원으로 빠르게 관리하기 편한 채팅 서버를
만들 수 있었습니다. + 채팅 서버의 성능에 대해 관심 있으신 분들과 이야기를 나누고 싶습니다!