Upgrade to Pro — share decks privately, control downloads, hide ads and more …

What We Learned from Building Edge Compute

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.

Kerim Satirli

May 11, 2023
Tweet

More Decks by Kerim Satirli

Other Decks in Technology

Transcript

  1. What We Learned From
    Building Edge Compute

    View full-size slide

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

    View full-size slide

  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:

    View full-size slide

  4. 01
    The Airport
    Over-engineering a thermostat

    View full-size slide

  5. "pnr": "RMT33W",

    "action": "boarding"

    View full-size slide

  6. Challenge:
    understand an area's pulse

    View full-size slide

  7. Solution:
    deploy wireless IoT network

    View full-size slide

  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

    View full-size slide

  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

    View full-size slide

  10. = 7.6 years
    !

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  13. Learning:
    go beyond the software

    View full-size slide

  14. 02
    The Grocer
    Orchestrating a DDoS from within

    View full-size slide

  15. 150 x
    hypermarkets
    63 x
    supermarkets
    1000 x
    minimarkets

    View full-size slide

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

    View full-size slide

  17. 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

    View full-size slide

  18. Challenge:
    don't DDoS ourselves

    View full-size slide

  19. Solution:
    build a local "cache"

    View full-size slide

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

    View full-size slide

  21. Learning:
    develop with constraints

    View full-size slide

  22. Learning:
    build for offline-first

    View full-size slide

  23. 03
    The Farm
    Feeding without the Frenzy

    View full-size slide

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

    View full-size slide

  25. Learning:
    optimize generously

    View full-size slide

  26. Learning:
    use boring hardware

    View full-size slide

  27. edge compute nodes 115
    containerized workloads 900
    data transfer / month 80 Terabytes
    combined memory 115 Gigabytes
    combined CPU 103 GHz
    Boring Hardware?

    View full-size slide

  28. Powerful Food
    arstechnica.com/science/2023/05/researchers-craft-a-fully-edible-battery

    View full-size slide

  29. Thank you
    speakerdeck.com/ksatirli

    View full-size slide