HEDGING (Software Development): Limiting software exposure to carbon by using cleanest energy globally available.
- Proxy: Rewriting the web for good.
- Reverse proxy bouncing traffic to data centers using cleanest energy.
- Store: Repairing data storage for good.
- Data storage that moves around the world using the cleanest energy.
- Track: Record and reduce for good.
- Record emissions providing actionable intelligance for reduction and offseting.
- Problem: API requests contribute to 83% of web carbon emissions
- Solution: Maximize amount of clean energy used to fulfill API requests
Resolution:
To this end our contribution to reducing web carbon begins with generating a periodical renewables report of regional grid intensity levels across the globe from the Green Software Foundation carbon aware api for the next 5 minutes. The generated renewable report is used to redirect API requests to data centers within regions that are using the lowest carbon intense power sources. The API requests are redirected based on reported intensity levels inside the renewable report. Rewriting the definition of a reverse proxy to include the advantage of maximizing clean energy use.
Reverse proxy:
An application that sits in front of back-end applications and forwards client requests to those applications. Reverse proxies help increase scalability, performance, resilience, security and clean energy use. The HEDGE reverse proxy url is below for both the prod and dev environments. Request to register services will be promoted to prod once tested on dev via pull requests.
Method | Endpoint | Environment |
---|---|---|
ANY | https://edge.hedge.earth/{service}/{proxy+} | Production |
ANY | https://hedgeedgex.druidcloud.dev/{service}/{proxy+} | Development |
Javascript Package:
For CORs compatible APIs and Websockets the HEDGE proxy can be bypassed opting to use the HEDGE JavaScript package instead.The HEDGE JavaScript package carries out the same operations as the API but without wasting a network trip. Custom services can also be used without registering them as part of pull requests.
Import HEDGE
import { hedge } from '@rollthecloudinc/hedge';
Climate friendly POST request for service.
const method = 'POST';
const body = { id: "b83f9717-ab11-4e0f-a058-872af9bbe3ed", title: "Test Add", price: 50 };
const h = await hedge({ service: 'emissionless' });
const res = await h.bounce('/rollthecloudinc/classifieds/shapeshifter/ads/b83f9717-ab11-4e0f-a058-872af9bbe3ed', { method, body })
Hedge.bounce() has the same interface as fetch except the protocol (https://) and domain name are omitted.
The region that was used to make the request and comparisions between other regions carbon intensity levels can also be made.
const { region } = await h.region();
const { regionDocument } = await region.document();
console.log('region used', regionDocument.region);
const { difference } = await region.compare({ region: 'useast' })
console.log('difference in carbon intensity between region useast and the region used to carry out request.', difference)
The complete HEDGE Javascript API has been documented in our demo repository. The HEDGE javaScript API source code can be found under /lib/hedge.
Impact
HEDGE has HUGE potential reach and potential CO2 reduction impact, with over 90% of Developers using APIs and emitting 16 million tonnes of CO2 generated each year. HEDGE could be very simply incorporated by hundreds of thousands of APIs to reduce their emissions, aggregating into a large global reduction.
Future Features
- Advertise & Promote Amount of carbon being saved
- Electricity usage and carbon emission tracking and monitoring.
- Website to submit servcies, track and monitor emissions globally, per org, per servce, region, etc.
- Postman plugin (50 million APIs)
- Serverless Framework plugin to incorporate into AWS API Gateway provisioning
- Nginx and HaProxy extension
- Other configuration as code platforms
- Problem: Traditional data storage has limited access to clean energy.
- Solution: Provide data store that moves around the world using the cleanest energy.
Resolution:
Repair data storage for good providing REST APIs that move around world between cleanest energy grids to store data. Data is stored on Github using repositories rather than individual databases. Transactions are wrapped in electricity and carbon emissions scope 1,2,3 tracking/monitoring providing complete picture of emissions. Our REST API is distributed across all the regions below delegating cpu processing to the one with the lowest grid intensity.
Location | Domain | Mapping |
---|---|---|
Montreal | https://ca-central-1.octostore.earth | canadacentral |
Ashburn VA | https://us-east-1.octostore.earth | eastus |
San Fransisco | https://us-west-1.octostore.earth | westus |
Dublin | https://eu-west-1.octostore.earth | ukwest |
London | https://eu-west-2.octostore.earth | uknorth |
Frankfurt | https://eu-central-1.octostore.earth | germanywestcentral |
Stockholm | https://eu-north-1.octostore.earth | northeurope/swedencentral |
Store JSON using the cleanest energy resources.
The emissionless API is the first carbon aware API being bounced to low intensity data centers using HEDGE.earth. You can follow in our footsteps by submitting a pull requests for your service to our HEDGE objects dev repo. Once you have tested, verified HEDGE.earth works with your API submit a pull request to HEDGE objects prod repo. See our emissionless.json service schema for reference and _schema.json for json schema defination of a HEDGE service. Valid regions can be found in the regions json file.
The POST body can be any valid JSON with an id property. The id property is used to distinguish unique json documents within the same provided path. The id of the parameter should match the id inside the json document body.
{
"id": "6f39a72a-6af3-4348-9158-7f111a6d0352"
"title": "My first document"
}
JSON Documents comitted via the shapshifter API will have the user id added automatically of the authenticated user that made the change.
Example Response:
{
"id": "6f39a72a-6af3-4348-9158-7f111a6d0352"
"title": "My first document",
"userId": "cc149bd7-83ef-47c5-a397-eb0eb0068e0d"
}
View use cases for more specific examples.
Future Features:
- Validation
- Repository owners will be able to provide JSON schema files that are used to validate entities before commiting. Entities that fail validation will not be comitted producing error messaging instead.
- Search
- JSON documents become searchable using Open Search API and dashboards. Climate Warrior App installers will have access to both Open Search API and their own dashboards.
- Index schemas will also be customizable including defining the schema documents will use for indexing.
- Notifications
- Clients will be able to subscribe to various push notifications during the flow of saving data.
- Webhooks
- Developers will be able to alter incoming and outgoing data using their own custom webhooks. Including implementing their own validation strategy when JSON Schema doesn't fit the bill.
Store Media and other files under 100MB using cleanest energy resources.
Store Media and other files over 100MB using cleanest energy resources.
- Problem: No real time monitoring for SCI that adjusts based on grid intensity of serverless AWS lambdas exists.
- Solution: Build real time monitoring for SCI backed by powerful search and intelligance engine.
Resolution:
Lambda created as AWS log subscriber that runs after each execution of lambdas within an account. The lambda collects key info and metrics of each lambda run including electricity usage and carbon production. Carbon production is calculated based on the Cloud Jewels algorithm but adjusted for real time grid intensity which region the Lambda is being executed. The info is stored inside AWS Open Search where we than apply analysys using machine learning and AI to lower the overall carbon output.
Roll the Cloud INC. is a registered 501(c)3 nonprofit US charity with the mission to exhile carbon from the web.