SlideShare a Scribd company logo
Build, deploy and scale:
Django, GraphQL and SPA
@dhilipsiva
@dhilipsiva
●
Optimistic Nihilist
●
Democratic Socialist
●
I code for fun & profit
●
I love Science, Python, FOSS & தமிழ்
●
Dad of 2. Environmentalist. Story Teller.
Gamer.
●
Jack of all trades & Master of none
●
A volunteer for progressives
I have no idea what I am talking about 🤪
Credentials
●
11+ years of professional experience in
python
●
Built over 20 different products using
django alone
●
Scaled more than 5 products to serve
millions of requests per second
●
Built a Device Farm (iOS and Android)
●
Involved in building a Bitcoin mining
farm with Rpi + ASIC (aws for miners)
Profession
VP of Engineering @ Reckonsys
Hitoshīkage @ Nitimis
Why GraphQL?
●
Much more standardized than the
fragmented RESTful implementations
●
Out-of-box live & browsable
documentation
●
No back-and-forth communication
between API developer and SPA
developer
●
Precise queries
Let’s look at our (buggy ) demo app
😬
https://stackopenflow.space
It is a very silly StackOverflow
clone
Stack
●
Python
●
Django
●
Graphene
●
Django-graphql-jwt
●
Django-rules
●
postgres
●
JavaScript
●
React
●
Relay
●
easy-peasy
Graphene
●
Custom field defs
●
Syncronous
●
Mature
●
Status Quo
●
Fantastic Django
integration
Strawberry.rocks
●
Dataclasses
●
Asyncronous
●
Not-so-mature
●
Future (maybe)
●
Very minimal
Django integration
Per-object perms
●
Choose a rule based framework (like django-
rules) over a DB-based framework (guardian)
●
Less DB calls = less latency
●
No unnecessary migrations gue to change in
logic
●
Easier to maintain
Why React?
●
Plays really well with GraphQL (Facebook being
a big proponent of both React and GraphQL)
●
Can build native applications with react-
native. So a front-end engineer can easily
scale-up as a mobile application developer.
●
Second only to vue.js in terms of
community/popularity
Why Relay?
●
Relay’s APIs are cleaner compared to
Apollo
●
Hooks are 1st
class citizens
●
Out of box caching support
●
Backed by Facebook (just like GraphQL and
React) so React has excellent
integration.
●
Relay-compiler is fantastic at catching
errors
Why easy-peasy?
●
Hooks are 1st
class citizens
●
Less boilerplate
●
Pleasant APIs
●
Ease of use
Project Layout
●
All other django apps are placed
under the django root
“stackopenflow” app (the module that
contains settings.py, urls.py,
wsgi.py, etc)
●
Therefore, all imports are
namespaced with “stackopenflow”
Typical Modules
●
admin.py
●
apps.py
●
models.py
●
tests.py
●
views.py
Our Modules
●
admin.py
●
apps.py
●
behaviours.py
●
choices.py
●
inputs.py
●
models.py
●
mutations.py
●
queries.py
●
tests.py
●
types.py
Let’s walk through the source code
Django & React
https://github.com/djconeu2021/stackopenflow-api
https://github.com/djconeu2021/stackopenflow-app
bigga
●
https://github.com/djconeu2021/bigga
●
A docker-compose based deployment
●
Can be configured to be used to
docker-swarm with minimal changes
●
Handy for local development too
●
Suitable for cheap, non-production
workloads
●
Code walk through
AWS copilot
●
https://aws.github.io/copilot-cli
●
ECS on AWS Fargate (serverless containers)
●
Very reliable & scaleable, but vendor dependent
●
Easy auto scaling configuration
●
Cheaper & faster than Lambda (serverless functions)
●
But be sure set-up along with tools like Terraform
SPA Deployment
●
S3 + CloudFront + ACM
●
Cheaper than alternatives like Netlify
●
Less latency
●
Manual Setup:
https://github.com/reckonsys/bigga/blob/community/S3_FRONTEND_DEPLOYMENT.md
●
Pyinvoke Script:
https://github.com/reckonsys/bigga/blob/community/tasks.py
Thank You
@dhilipsiva
dhilipsiva@pm.me
https://dhilipsiva.com
https://t.me/dhilipsiva

More Related Content

PDF
[WSO2Con USA 2018] Chipping Away at Technical Debt with WSO2
PDF
Meetup 24/3/2016 - Node.js User Group Belgium
PDF
Cmm #4
PDF
Contributing to Apache Projects and Making Profits
PDF
The working architecture of node js applications open tech week javascript ...
PPTX
IFG for SAP Integration, webinar on Automated Testing
PPTX
uPortal Q1 2018 Quarterly Briefing
PDF
How to sell drupal 8
[WSO2Con USA 2018] Chipping Away at Technical Debt with WSO2
Meetup 24/3/2016 - Node.js User Group Belgium
Cmm #4
Contributing to Apache Projects and Making Profits
The working architecture of node js applications open tech week javascript ...
IFG for SAP Integration, webinar on Automated Testing
uPortal Q1 2018 Quarterly Briefing
How to sell drupal 8

What's hot (19)

PDF
Nimble - iOS dependency management
PPT
Introduction to Grails
ODP
LibreTime: a web-based automation system for radio - presentation at Ohio Li...
PDF
So I Downloaded Qt, Now What?
PPTX
stageTEK5_2016_cisner_w
PDF
CI/CD: Lessons from LinkedIn and Mockito
PDF
Update on the open source browser space (16th GENIVI AMM)
PDF
Mule soft meetup__jaipur_december_2020_final
PDF
Mobile development with JBoss Tools
PPTX
Ivan Pashko ITEM 2018
PDF
Bootify Yyour App from Zero to Hero
PDF
J2EE6_DevelopWebApplications_00_Preample
PDF
MuleSoft London Community September 2020 - Project Vita
PDF
Mp25: Mobile dev with QT and Python for the Notorious N9
PDF
Parallel development of Web Apps | Codesushi - Gliwice 2017
PDF
Deploy Multinode GitLab Runner in openSUSE 15.1 Instances with Ansible Automa...
PDF
Laravel workshop
PDF
The Evolving Role of Build Engineering in Managing Open Source
PDF
Let's Go @ St. Louis CocoaHeads
Nimble - iOS dependency management
Introduction to Grails
LibreTime: a web-based automation system for radio - presentation at Ohio Li...
So I Downloaded Qt, Now What?
stageTEK5_2016_cisner_w
CI/CD: Lessons from LinkedIn and Mockito
Update on the open source browser space (16th GENIVI AMM)
Mule soft meetup__jaipur_december_2020_final
Mobile development with JBoss Tools
Ivan Pashko ITEM 2018
Bootify Yyour App from Zero to Hero
J2EE6_DevelopWebApplications_00_Preample
MuleSoft London Community September 2020 - Project Vita
Mp25: Mobile dev with QT and Python for the Notorious N9
Parallel development of Web Apps | Codesushi - Gliwice 2017
Deploy Multinode GitLab Runner in openSUSE 15.1 Instances with Ansible Automa...
Laravel workshop
The Evolving Role of Build Engineering in Managing Open Source
Let's Go @ St. Louis CocoaHeads
Ad

Similar to Build, deploy and scale: Django, GraphQL and SPA (DjangoCon EU 2021) (20)

PPTX
React django
PDF
PiterPy 2016: Parallelization, Aggregation and Validation of API in Python
PDF
Django vs React: Which is Better for Web Development? - Semiosis Software Pri...
PDF
How we realized SOA by Python at PyCon JP 2015
PDF
A Day in the Life of a Silicon Valley Startup
PDF
Django for Professionals Production websites with Python Django 4 0 William S...
PDF
Django at Scale
PPTX
PyCONKE meetup 2019: Microservices
PDF
Building RESTful APIs
PPTX
Build GraphQL APIs with Graphene (Big Mountain Data & Dev 2019)
PDF
GraphQL: Enabling a new generation of API developer tools
PDF
GraphQL With Relay Part Deux
PPTX
Realtime web2012
PDF
Lightweight Django 1st Edition Julia Elman
PDF
Advantages Of Using Django Framework To Build Scalable.pdf
PDF
PyCon Korea - Real World Graphene
PDF
Free django
PDF
貴圈真亂 React生態圈
PDF
Django Javascript Integration Ajax And Jquery 1st Edition Jonathan Hayward
PPTX
Relay: Seamless Syncing for React (VanJS)
React django
PiterPy 2016: Parallelization, Aggregation and Validation of API in Python
Django vs React: Which is Better for Web Development? - Semiosis Software Pri...
How we realized SOA by Python at PyCon JP 2015
A Day in the Life of a Silicon Valley Startup
Django for Professionals Production websites with Python Django 4 0 William S...
Django at Scale
PyCONKE meetup 2019: Microservices
Building RESTful APIs
Build GraphQL APIs with Graphene (Big Mountain Data & Dev 2019)
GraphQL: Enabling a new generation of API developer tools
GraphQL With Relay Part Deux
Realtime web2012
Lightweight Django 1st Edition Julia Elman
Advantages Of Using Django Framework To Build Scalable.pdf
PyCon Korea - Real World Graphene
Free django
貴圈真亂 React生態圈
Django Javascript Integration Ajax And Jquery 1st Edition Jonathan Hayward
Relay: Seamless Syncing for React (VanJS)
Ad

More from Dhilipsiva DS (12)

PDF
Introduction To DevOps Workshop @ New Horizon College
PDF
Deploy your Python code on Azure Functions
PDF
Garuda: Automagically Exposing Djagno ORM over gRPC for microservices written...
PDF
AWS LearnUp - Intro to AWS Services - Venturesity
PDF
Python Workshop Day - 2 (REVA University)
PDF
Full-Stack Development
PDF
BangML Meetup 1: The Path to Becoming an Machine Learning Expert
PDF
Architecture @ Appknox
PDF
Microservices with Swagger, Flask and Docker
PDF
Container (Docker) Orchestration Tools
PPT
PPT
Introduction To DevOps Workshop @ New Horizon College
Deploy your Python code on Azure Functions
Garuda: Automagically Exposing Djagno ORM over gRPC for microservices written...
AWS LearnUp - Intro to AWS Services - Venturesity
Python Workshop Day - 2 (REVA University)
Full-Stack Development
BangML Meetup 1: The Path to Becoming an Machine Learning Expert
Architecture @ Appknox
Microservices with Swagger, Flask and Docker
Container (Docker) Orchestration Tools

Recently uploaded (20)

PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PDF
Piense y hagase Rico - Napoleon Hill Ccesa007.pdf
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
PDF
From loneliness to social connection charting
PPTX
How to Manage Starshipit in Odoo 18 - Odoo Slides
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
Insiders guide to clinical Medicine.pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
COMPUTERS AS DATA ANALYSIS IN PRECLINICAL DEVELOPMENT.pptx
PPTX
Open Quiz Monsoon Mind Game Final Set.pptx
PDF
The Final Stretch: How to Release a Game and Not Die in the Process.
PPTX
Week 4 Term 3 Study Techniques revisited.pptx
PPTX
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
PSYCHOLOGY IN EDUCATION.pdf ( nice pdf ...)
PPTX
UNDER FIVE CLINICS OR WELL BABY CLINICS.pptx
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Anesthesia in Laparoscopic Surgery in India
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
Piense y hagase Rico - Napoleon Hill Ccesa007.pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
From loneliness to social connection charting
How to Manage Starshipit in Odoo 18 - Odoo Slides
Renaissance Architecture: A Journey from Faith to Humanism
Insiders guide to clinical Medicine.pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
COMPUTERS AS DATA ANALYSIS IN PRECLINICAL DEVELOPMENT.pptx
Open Quiz Monsoon Mind Game Final Set.pptx
The Final Stretch: How to Release a Game and Not Die in the Process.
Week 4 Term 3 Study Techniques revisited.pptx
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PSYCHOLOGY IN EDUCATION.pdf ( nice pdf ...)
UNDER FIVE CLINICS OR WELL BABY CLINICS.pptx

Build, deploy and scale: Django, GraphQL and SPA (DjangoCon EU 2021)