Kerim Satirli
May 11, 2023
53

# What We Learned from Building Edge Compute

In this presentation, I explain what we have learned from building compute services at the edge by diving into three engineering different projects.

This version of the talk was given at the 2023 Edition of Open Source Summit North America as part of the "Cloud Open" track.

May 11, 2023

## Transcript

1. What We Learned From
Building Edge Compute

2. Sr. Developer Advocate at HashiCorp
he / him
@ksatirli
Kerim
Satirli

3. edge com·put·ing
noun
computing that takes place at or
near the physical location of the
producer or consumer of data.
point of presence mobile datacenter
Similar:

4. 01
The Airport
Over-engineering a thermostat

5. "pnr": "RMT33W",
"action": "boarding"

6. Challenge:
understand an area's pulse

7. Solution:
deploy wireless IoT network

8. var C // capacity (mAh)
var I // current when in sleep mode (mA)
var Imeas // current in measurement mode (mA)
var Irx // current in Rx mode (mA)
var Itx // current in Tx mode (mA)
var N // measurements (count)
var T // milliseconds per hour (3.6M)
var Tmeas // duration of measurement mode (ms)
var Trx // duration of Rx mode (ms)
var Ttx // duration of Tx mode (ms)
var U // usable capacity incl. self-discharge (percentage)
Projecting Battery Capacity

9. // active capacity usage / day
var cA = ((N * ((Ttx * Itx) + (Trx * Irx) + (Tmeas * Imeas))) / T)
// sleep capacity usage / day
var cS = I * (24 - ((Ttx + Trx + Tmeas) * N) / T)
// total capacity consumed / day
var cT = cA + cS
// projected battery life
var Bd = (cU / cT) / 24 // in days
var By = Bd / 365.25 // in years
Projecting Battery Capacity

10. = 7.6 years
!

11. Occupancy Sensor
0
20
40
60
80
100
Q4 2018 Q2 Q3 Q4 2019 2022 2023
"
#
\$
Graphing Battery Capacity

12. // assembled and decoded payload (via webhook)
// remaining battery capacity (0...254)
// remaining battery capacity (0...254)
var capacity_in_percent = (var.capacity / 254) * 100
// overwrite capacity value with percentage-based one
Calculating Battery Capacity

13. Learning:
go beyond the software

14. 02
The Grocer
Orchestrating a DDoS from within

15. 150 x
hypermarkets
63 x
supermarkets
1000 x
minimarkets

16. + 37 points

17. {
"id": "5d1caf08-4235-451d-9fac-4f8d56e89e2e",
"timestamp": "2023-01-01T05:01:57Z",
"card": "966255423827",
"amount": "37.26"
}
Customer Transaction Data

18. single transaction size 200 Bytes
envelopes and overages + 1.25 x
per-store transactions 2500
per-store transaction size 610 Kilobytes
total transaction size 723 Megabytes
total transaction count 3.032.500
Customer Transaction Data

19. Challenge:
don't DDoS ourselves

20. Solution:
build a local "cache"

21. SQLite packages the entire
database into a single,
cross-platform compatible file.
- SQLite documentation

22. Learning:
develop with constraints

23. Learning:
build for offline-first

24. 03
The Farm
Feeding without the Frenzy

25. 2 out of 3 farms use IIoT
but farmers aren't SW engs

26. Learning:
optimize generously

27. Learning:
use boring hardware

28. edge compute nodes 115