Green your Django Project
Technique
to get an idea of what to change
Tooling
you can use to start, and where to get help
Purpose
Why you might do this
Purpose
Why you might care
Winning too slowly is the same as losing now
Technique
how to work out what you might change
Your platform
Your providers
Your provisioning
Your platform
If you can see it, it's easier to talk about it
"We have a whiteboard"
"We have UML for that. We can generate it from the code"
Meet the C4 model
Not my model, but I like it.
https://c4model.com is the canonical source of info
“Agree on a simple set of abstractions that the whole team can use to communicate.”
“Draw a number of simple diagrams at different levels of abstraction”
Context
Container
Component
Code (or classes)
Context
Should be readable by non-technical users
Who are the users?
What does it do for its users?
What services does it talk to, to do this?
Containers
Aimed at technical audiences
What technologies are being used?
How do they talk to each other?
What does a deployment look like?
Components
Aimed at technical audiences
What libraries are in use?
Where are the boundaries between parts of a system?
Which bits of the codebase are ours?
Code (or classes)
Aimed at technical audiences
How is it implemented?
Which API methods are public?
Insert best practices for $LANG here
A real life example I've used before
Trying this out
(you probably won't have time, but you can start)
draw.io and c4
draw.io
Free. OSS. Extendable. Works with your tooling.
http://bit.ly/draw-io-c4
More on C4
https://c4model.com/
Finishing this will give you an inventory of stuff in your stack
Your providers
Who's running the infra in stack?
If it's you
- Where are your servers?
- How do you source your power?
- How do account for emissions from electicity?
It's getting easier to use green power
*Some* of AWS is green
If it's someone else
- Where are their servers?
- How do they source their power
- How do they account for emissions?
hook it to your CI system
carbon.txt
(like robots.txt, but for green IT infra. Please talk to me about implementing this after)
The new thing we're doing at The Green Web Foundation
Your provisioning
How well can you match capacity to usage?
Usage isn't constant
many workloads are spiky or drop to zero for extended periods… applications used in the workplace may only be active for 40 of the 168 hours in a week.
Adrian Cockroft
@adrianco: AWS, ex Netflix
Seeing your usage patterns
Physical servers
💸🔥 = 🌍🔥
Instances/containers
Scale in/out to match demand
Functions / serverless
Shift costs to coding / lock-in
Pricing | Bare Metal | Iaas / PaaS | FaaS |
---|---|---|---|
Compute | Entire Server | VPS, Dynos, Containers, etc. | Lambda |
Storage | Physical disks | Virtual Volumes | S3 |
Database | Your own Db Server | AWS Aurora RDS, Cloud SQL | AWS Aurora Serverless |
Applying this
twitter: @climateActTech
also join the slack!
Green your Django Project
By Chris Adams
Green your Django Project
- 1,227