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
2.5k
1
Share
40만명이 쓰는 Django channels 채팅서버, 우리는 어떻게 만들었나?
2018 Pycon. @EJSohn
Eunju Amy Sohn
August 17, 2018
More Decks by Eunju Amy Sohn
See All by Eunju Amy Sohn
내가 커뮤니티 스피킹을 하는 이유
ejsohn
1
430
Cloud Deep Learning for everyone
ejsohn
0
160
Microservice with go and gRPC
ejsohn
1
640
Spot Utilization for GPU Instance Cost Efficiency
ejsohn
0
110
Implementing Reactive Programming with ReSwift
ejsohn
0
220
Other Decks in Programming
See All in Programming
PHPのバージョンアップ時にも役立ったAST(2026年版)
matsuo_atsushi
0
270
どんと来い、データベース信頼性エンジニアリング / Introduction to DBRE
nnaka2992
1
350
ネイティブアプリとWebフロントエンドのAPI通信ラッパーにおける共通化の勘所
suguruooki
0
230
コードレビューをしない選択 #でぃーぷらすトウキョウ
kajitack
3
1.2k
Smarter Angular mit Transformers.js & Prompt API
christianliebel
PRO
1
110
Ruby and LLM Ecosystem 2nd
koic
1
1.4k
Coding at the Speed of Thought: The New Era of Symfony Docker
dunglas
0
3.6k
Everything Claude Code OSS詳細 — 5層構造の中身と導入方法
targe
0
160
AI 開発合宿を通して得た学び
niftycorp
PRO
0
180
[PHPerKaigi 2026]PHPerKaigi2025の企画CodeGolfが最高すぎて社内で内製して半年運営して得た内製と運営の知見
ikezoemakoto
0
310
L’IA au service des devs : Anatomie d'un assistant de Code Review
toham
0
150
実践ハーネスエンジニアリング #MOSHTech
kajitack
7
5.1k
Featured
See All Featured
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
160
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
330
Navigating Team Friction
lara
192
16k
Paper Plane (Part 1)
katiecoart
PRO
0
6.2k
Chasing Engaging Ingredients in Design
codingconduct
0
150
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Designing Experiences People Love
moore
143
24k
Evolving SEO for Evolving Search Engines
ryanjones
0
170
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
170
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
120
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
780
Making the Leap to Tech Lead
cromwellryan
135
9.8k
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 소수의 인원으로 빠르게 관리하기 편한 채팅 서버를
만들 수 있었습니다. + 채팅 서버의 성능에 대해 관심 있으신 분들과 이야기를 나누고 싶습니다!