Eclipse IoT Eclipse Ditto

Digital Twins as part of an open IoT platform

The Things Network Virtual Conference



  1. Digital Twins
  2. Eclipse Ditto
  3. Ditto + TTN
  4. Hands-on
  5. Wrap up

Digital Twins

  • digital representation of real physical devices
  • act as broker for communicating with assets
  • also: representation of processes or services
  • applicable for both industrial and consumer-centric IoT scenarios

Eclipse Ditto

… where IoT devices and their Digital Twins get together

in context

Ditto in action

Ditto as
Digital Twin

turn device data into APIs

  "thingId": "",
  "policyId": "",
  "attributes": {
    "manufacturer": "Foo corp",
    "productionData": {
      "serialNo": 4711
  "features": {
    "temperature": {
      "properties": {
        "value": 23.42

JSON repr. of a Thing

GET/PUT/DELETE /api/2/things/


→ docs

persistence of device state

  • devices are not always connected to the net
  • applications always need to be able to access their data
  • twin vs. live access on API level
Ditto twin channel Ditto live channel


  • Ditto contains a built-in authorization mechanism (Policies)
  • every API call is authorized
    "policyId": "",
    "entries": {
      "owner": {
        "subjects": {
          "nginx:admin": {
            "type": "nginx basic auth user"
        "resources": {
          "thing:/": {
            "grant": ["READ","WRITE"],
            "revoke": []
          "thing:/features/firmware": {
            "grant": [],
            "revoke": ["WRITE"]
          "policy:/": {
            "grant": ["READ","WRITE"],
            "revoke": []
→ docs


Meme Dino
  • you must not
  • Ditto has you covered
GET /api/2/search/things
GET /api/2/search/things
  • search for arbitrary data with RQL query
  • Ditto again ensures authorization
  • apply field projection over the results
  • don't worry about indexing
→ docs

get notified about changes

  • notification via various channels: WebSocket, SSE, MQTT, AMQP, Kafka, HTTP hook
  • server side filtering via RQL (same as in search)
var ws = new WebSocket("ws://ditto:ditto@localhost:80/ws/2");
ws.onopen = function(w) {
ws.onmessage = function(msg) {
  console.log('received: ' +;

example of WebSocket browser API

→ docs

payload normalization

  • devices send data in various formats
  • Ditto provides structured APIs of things (attributes, features)
  • devices don't need to be aware of Ditto
JavaScript logo
  • incoming and outgoing data can be transformed


Ditto context overview
  • modular architecture of Ditto services
  • horizontal scalability of each Ditto service
  • runtime dependency to MongoDB
  • included monitoring (JVM metrics, roundtrips, MongoDB)
  • codebase written in: Java

Eclipse Ditto +

The Things Network logo

benefit from each other

  • TTN solving low cost, wide range connectivity of devices
  • Eclipse Ditto providing APIs for IoT (backend-, web-, mobile-) applications
  • both provide free/community variants
  • both provide commercial services

integration variants

using TTN's HTTP integration

TTN via Hono to Ditto

using TTN's MQTT broker

TTN via MQTT to Ditto

* used now for the hands-on part

hands-on time!

Step-by-step blogpost

Wrap up

  • Digital Twins as pattern for simplifying IoT solution development
  • Mission: provide Device-as-a-Service
  • Eclipse Ditto as OpenSource framework for Digital Twins

thanks to The Things Network for organising this virtual conference