Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Add2paper printing system using Django-channels


Published on

(KOR) Django-channels을 적용한 애드투페이퍼 출력 시스템

Published in: Software
  • Be the first to comment

Add2paper printing system using Django-channels

  1. 1. A2P Printing System using Django-Channels Sin-Woo Bang at Add2paper
  2. 2. Add2paper - providing a free-printing service. - used by 700k college students. - In detail :
  3. 3. User flow - A user login and try to print on PC.
  4. 4. User flow - Then the user go to a printing machine, - pay for printing and complete it.
  5. 5. It is easy
  6. 6. An architecture in detail
  7. 7. When a user try to print Send spool files info to EC2 Save spool files in local
  8. 8. Payment Request a payment
  9. 9. Printing Send a printing signal via WebSocket
  10. 10. Printing Deliver spool files
  11. 11. Summary (1) Send a spool file info to a server (2) Request a payment to the server (3) When the server detect payment completed, sends a printing signal (4) PC delivers spool files to a printing machine.
  12. 12. As you know in Python - Famous web frameworks had not done support WebSocket. - like Flask, Django. - So we had to consider gevent, Twisted to use that.
  13. 13. But in 2016
  14. 14. Now Django/Channels in 2018 - Updated to 2.x version. - Activated open source activities. - A lot of pull requests are opened and merged now. - Fine to use in production.
  15. 15. We chose it - since our backend applications are written in Python. - to send a printing signal when a payment is finished.
  16. 16. It was very easy - Just add some settings if you want to add it. - Settings for - ASGI - Channel-Layers (for using In-memory DB like Redis) - Routing for asynchronous requests
  17. 17. Developed quickly
  18. 18. Write a business logic - awesome productivity - could take strength of Django as it is
  19. 19. But, when it comes to deployment
  20. 20. Deployment - Daphne which is a protocol server for ASGI does not support graceful reload. - had to use blue-green way by adjusting a load balancer.
  21. 21. Now - The service works fine. - Since it is scalable, our team could add additional servers. - If you consider to use it - Recommending - if you should keep a deadline. - if a project is not too much big. - But - Please remember Daphne does not support graceful reload.
  22. 22. Thank you - Q&A : or