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
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
120
Implementing Reactive Programming with ReSwift
ejsohn
0
230
Other Decks in Programming
See All in Programming
代数的データ型って何が嬉しいの? #frontend_phpcon_do
kajitack
8
3.8k
JavaDoc 再入門
nagise
1
420
Lessons from Spec-Driven Development
simas
PRO
0
220
ランチタイムLT会3周年!ランチタイムLT会を3年間続けられたお話
y0hgi
1
110
Performance Engineering for Everyone
elenatanasoiu
0
230
エージェンティックRAGにAWSで入門しよう!
har1101
9
1.8k
「AIで開発し、AIを届ける」をEvalでつなぐ 〜AIネイティブに始めるプロダクト開発の実践〜 / Connecting "Develop with AI, deliver AI" with Eval
rkaga
4
5.4k
ADKを使って簡単にAIエージェントを作ってみよう
k1mu21
0
280
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
8
3.3k
Mujeres en SEO Summit 2026 - Greatest Disaster Hits en Web Performance
guaca
0
200
フロントエンドとバックエンドで「1文字」を揃えよう
youkidearitai
PRO
0
750
Contextとはなにか
chiroruxx
1
380
Featured
See All Featured
Amusing Abliteration
ianozsvald
1
210
First, design no harm
axbom
PRO
2
1.2k
Git: the NoSQL Database
bkeepers
PRO
432
67k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.7k
The SEO identity crisis: Don't let AI make you average
varn
0
500
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.1k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.4k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
290
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
400
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Facilitating Awesome Meetings
lara
57
7k
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 소수의 인원으로 빠르게 관리하기 편한 채팅 서버를
만들 수 있었습니다. + 채팅 서버의 성능에 대해 관심 있으신 분들과 이야기를 나누고 싶습니다!