Evaluating Databases for the Internet of Things David Gogrichiani - - PowerPoint PPT Presentation

evaluating databases for the internet of things
SMART_READER_LITE
LIVE PREVIEW

Evaluating Databases for the Internet of Things David Gogrichiani - - PowerPoint PPT Presentation

Evaluating Databases for the Internet of Things David Gogrichiani Advisor(s): Stefan Liebald, Marc-Oliver Pahl Supervisor: Prof. Dr.-Ing. Georg Carle Technical University of Munich (TUM) Department of Informatics Chair of Network Architectures


slide-1
SLIDE 1

1/21 David Gogrichiani | Evaluating Databases for the Internet of Things

Evaluating Databases for the Internet of Things

David Gogrichiani Advisor(s): Stefan Liebald, Marc-Oliver Pahl Supervisor: Prof. Dr.-Ing. Georg Carle Technical University of Munich (TUM) Department of Informatics Chair of Network Architectures and Services Garching, 10. Januar 2018

slide-2
SLIDE 2

2/21 David Gogrichiani | Evaluating Databases for the Internet of Things

Overview

Introduction/Problem Statement

  • Virtual State Layer

Key Findings of Analysis/Related Work Design/Implementation

  • MongoDB
  • OrientDB
  • Benchmark

Evaluation Conclusion/Future Work

  • Artifacts
slide-3
SLIDE 3

3/21 David Gogrichiani | Evaluating Databases for the Internet of Things

Introduction

Virtual State Layer

  • Is a part of DS2OS
  • Is a middleware
  • Manages access control, communication and persistence
  • Consists of Knowledge Agents

Knowledge Agents

  • Store virtual representations of IoT devices (Context Nodes)
  • Manage these representations

○ Communicate with each other ○ Provide information for DS2OS services Database backend

  • Each Knowledge Agents has its own persistent storage
  • Currently relational database HSQLDB is used
slide-4
SLIDE 4

4/21 David Gogrichiani | Evaluating Databases for the Internet of Things

Structure of VSL Context Tree

Context Tree

  • Represents real world object
  • Information represented in a tree-like structure
  • Parts of an object are viewed as sub-trees

Lamp1 Lightbulb1 Lightbulb2 SwitchButton1

slide-5
SLIDE 5

5/21 David Gogrichiani | Evaluating Databases for the Internet of Things

Questions to answer:

  • What is a suitable database architecture for DS2OS?

○ How to represent tree-structure context nodes within the database? ○ How to keep versioning/archive of context nodes?

  • How to evaluate performance of chosen databases in regard to VSL?

Research questions

slide-6
SLIDE 6

6/21 David Gogrichiani | Evaluating Databases for the Internet of Things

Key findings of Analysis/Related Work

Chosen databases, based on related studies [1,2,3,4,5,6]:

  • MongoDB as document-oriented database
  • OrientDB as multi-model/graph based solution

Database type Flexibility Complex queries Native tree handling Consistency Speed Examples Relational + +++

  • ++

++ HyperSQL, PostgreSQL Key-value +

  • +++

Redis, Riak KV Document-oriented ++ ++

  • ++

MongoDB Graph-based + + ++ + + Neo4j Multi-model ++ ++ + + + OrientDB, ArangoDB

slide-7
SLIDE 7

7/21 David Gogrichiani | Evaluating Databases for the Internet of Things

MongoDB

{ "_id" : ObjectId("5a4fd4262263da1815efad17"), "address" : "/agent1/system/config/korSync", "ancestors" : [ "/agent1/system/config", "/agent1/system", "/agent1", "/" ], "types" : [ "/basic/number" ], "readerIDs" : [ "system/config", "system" ], "writerIDs" : [ "system/config", "system" ], "version" : NumberLong(0), "value" : "60000", "timestamp" : ISODate("2018-01-05T19:38:15.065Z") }

  • Data stored as

documents

  • Documents stored

in collections

slide-8
SLIDE 8

8/21 David Gogrichiani | Evaluating Databases for the Internet of Things

OrientDB

  • Data stored in records
  • Records can be either documents, BLOB, Vertex/Edge depending on operating mode
  • Records are divided into clusters

{ "rid" : 6, "address" : "/agent1/system/config/korSync", "types" : [ "/basic/number" ], "readerIDs" : [ "system/config", "system" ], "writerIDs" : [ "system/config", "system" ], "version" : NumberLong(0), "value" : "60000", "timestamp" : ISODate("2018-01-05T19:38:15.065Z") } rid:0 rid:1 rid:2 rid:4 rid:5 rid:7 rid:3 rid:6

slide-9
SLIDE 9

9/21 David Gogrichiani | Evaluating Databases for the Internet of Things

Design

How to represent tree-structure context nodes within the database?

  • Nested document
  • Materialized path
  • References to direct Parent or Children
  • Array of Ancestors
slide-10
SLIDE 10

10/21 David Gogrichiani | Evaluating Databases for the Internet of Things

Design

How to represent tree-structure context nodes within the database?

  • Nested document
  • Materialized path
  • References to direct Parent or Children
  • Array of Ancestors

MongoDB

  • All ancestors as separate field in a document

OrientDB

  • Handled natively by the database
slide-11
SLIDE 11

11/21 David Gogrichiani | Evaluating Databases for the Internet of Things

Design

How to handle versioning/archive of context nodes?

  • New document with incremented version for each new state
  • New document with “current” field
  • Previous states embedded in a document
  • Previous states in separate collection
slide-12
SLIDE 12

12/21 David Gogrichiani | Evaluating Databases for the Internet of Things

Design

How to handle versioning/archive of context nodes?

  • New document with incremented version for each new state
  • New document with “current” field
  • Previous states embedded in a document
  • Previous states in separate collection

MongoDB

  • Previous states of a node in separate collection

OrientDB

  • Previous states of a node as a map object inside of document
slide-13
SLIDE 13

13/21 David Gogrichiani | Evaluating Databases for the Internet of Things

Testing approach:

  • Simulate interaction between a service and Knowledge Agent

○ Close to real-world scenario ○ Takes into account differences in database implementation for VSL

Evaluation

DS2OS Service VSL Knowledge Agent Database

slide-14
SLIDE 14

14/21 David Gogrichiani | Evaluating Databases for the Internet of Things

Performance evaluation:

  • Create a context tree, for testing purposes
  • Issue 110, 1100, 11000 either get/set operations

Evaluation

n1 n10 n1 n10 n1 n10 n1 n10 n2 rn

Root Node of the service

slide-15
SLIDE 15

15/21 David Gogrichiani | Evaluating Databases for the Internet of Things

Evaluation

Expected results:

  • Implemented databases perform on the same level with existing solution
  • MongoDB is expected to perform better in write-intensive environment
  • OrientDB is expected to handle graph structures efficiently
slide-16
SLIDE 16

16/21 David Gogrichiani | Evaluating Databases for the Internet of Things

Evaluation

slide-17
SLIDE 17

17/21 David Gogrichiani | Evaluating Databases for the Internet of Things

Evaluation

slide-18
SLIDE 18

18/21 David Gogrichiani | Evaluating Databases for the Internet of Things

Evaluation

Results:

  • MongoDB performs slightly better than current solution

○ Difference more pronounced during read-intensive operations

  • OrientDB performs significantly worse than other solutions

○ Does not match expectations ○ Need to be examined further

slide-19
SLIDE 19

19/21 David Gogrichiani | Evaluating Databases for the Internet of Things

Conclusion/Future Work

Conclusion:

  • MongoDB performs slightly better than current solution
  • OrientDB performs significantly worse than other solutions

Artifacts:

  • Implemented interface for MongoDB
  • Implemented interface for OrientDB
  • Simple benchmark DS2OS service

Future work:

  • Implement other types of databases for VSL
  • Expand database benchmark
  • Investigate OrientDB further
slide-20
SLIDE 20

20/21 David Gogrichiani | Evaluating Databases for the Internet of Things

Questions?

slide-21
SLIDE 21

21/21 David Gogrichiani | Evaluating Databases for the Internet of Things

Sources

[1]: J. S. van der Veen, B. van der Waaij and R. J. Meijer, "Sensor Data Storage Performance: SQL or NoSQL, Physical or Virtual," 2012 IEEE Fifth International Conference

  • n Cloud Computing, Honolulu, HI, 2012, pp. 431-438.

[2]: Y. Li and S. Manoharan, "A performance comparison of SQL and NoSQL databases," 2013 IEEE Pacific Rim Conference on Communications, Computers and Signal Processing (PACRIM), Victoria, BC, 2013, pp. 15-19. [3]: T. A. M. Phan, J. K. Nurminen and M. Di Francesco, "Cloud Databases for Internet-of-Things Data," 2014 IEEE International Conference on Internet of Things (iThings), and IEEE Green Computing and Communications (GreenCom) and IEEE Cyber, Physical and Social Computing (CPSCom), Taipei, 2014, pp. 117-124. [4]: M. G. Jung, S. A. Youn, J. Bae and Y. L. Choi, "A Study on Data Input and Output Performance Comparison of MongoDB and PostgreSQL in the Big Data Environment," 2015 8th International Conference on Database Theory and Application (DTA), Jeju, 2015, pp. 14-17. [5]: H. Fatima and K. Wasnik, "Comparison of SQL, NoSQL and NewSQL databases for internet of things," 2016 IEEE Bombay Section Symposium (IBSS), Baramati, 2016, pp. 1-6. [6]: D. Jayathilake, C. Sooriaarachchi, T. Gunawardena, B. Kulasuriya and T. Dayaratne, "A study into the capabilities of NoSQL databases in handling a highly heterogeneous tree," 2012 IEEE 6th International Conference on Information and Automation for Sustainability, Beijing, 2012, pp. 106-111.