77
ternet of Things & RES Alexandra Bowen @AlexandraABowen

Internet of Things (IoT) and REST APIs

Embed Size (px)

Citation preview

Page 1: Internet of Things (IoT) and REST APIs

The Internet of Things & REST APIsAlexandra Bowen

@AlexandraABowen

Page 2: Internet of Things (IoT) and REST APIs

I’m Alex.

Community and Developer Relations Manager at DreamFactory

IoT Enthusiast

@AlexandraABowen #Defragcon

Page 3: Internet of Things (IoT) and REST APIs

@AlexandraABowen #Defragcon

Page 4: Internet of Things (IoT) and REST APIs

• Part 1: Current state of IoT• Part 2: Future of IoT• Part 3: Developer perspective• Part 4: APIs and REST• Part 5: Open Source Services

Agenda

@AlexandraABowen #Defragcon

Page 5: Internet of Things (IoT) and REST APIs

@AlexandraABowen #Defragcon

Page 6: Internet of Things (IoT) and REST APIs

• Part 1: Current state of IoT• Part 2: Future of IoT• Part 3: Developer perspective• Part 4: APIs and REST• Part 5: Open Source Services

Current state of IoT

@AlexandraABowen #Defragcon

Page 7: Internet of Things (IoT) and REST APIs

@AlexandraABowen #Defragcon

Page 8: Internet of Things (IoT) and REST APIs

@AlexandraABowen #Defrag

Page 9: Internet of Things (IoT) and REST APIs

IoT connects people to physical objects via applications.

This relationship has inherently changed to the way we engage and interact with objects.

IDC predicts that the worldwide IoT market will grow to $7.1 trillion by 2020, so it’s not going away anytime soon.

Current State

@AlexandraABowen #Defrag

Page 10: Internet of Things (IoT) and REST APIs

IoT connects people to physical objects via applications.

This relationship has inherently changed to the way we engage and interact with objects.

IDC predicts that the worldwide IoT market will grow to $7.1 trillion by 2020, so it’s not going away anytime soon.

Current State

@AlexandraABowen #Defragcon

Page 11: Internet of Things (IoT) and REST APIs

@AlexandraABowen #Defragcon

Page 12: Internet of Things (IoT) and REST APIs

The Internet of Things is driven by a combination of:

Page 13: Internet of Things (IoT) and REST APIs

These services are already connected and available on the market today as popular devices.

Page 14: Internet of Things (IoT) and REST APIs

Diverse Applications.

Page 15: Internet of Things (IoT) and REST APIs

The Internet of Things is driven by a combination of:

Page 16: Internet of Things (IoT) and REST APIs
Page 17: Internet of Things (IoT) and REST APIs

@AlexandraABowen #Defragcon

Page 18: Internet of Things (IoT) and REST APIs

@AlexandraABowen #Defragcon

Page 19: Internet of Things (IoT) and REST APIs

@AlexandraABowen #Defragcon

Page 20: Internet of Things (IoT) and REST APIs

@AlexandraABowen #Defragcon

Page 21: Internet of Things (IoT) and REST APIs

Lord Kelvin

“If you can’t measure it you can’t improve it.”

@AlexandraABowen #Defragcon

Page 22: Internet of Things (IoT) and REST APIs

1. Hardware is becoming extremely cheap. 2. Connectivity.3. Development is becoming easier .

Why now?

@AlexandraABowen #Defragcon

Page 23: Internet of Things (IoT) and REST APIs

@AlexandraABowen #Defragcon

Page 24: Internet of Things (IoT) and REST APIs

Everything should talk to everything else.

@AlexandraABowen #Defragcon

Page 25: Internet of Things (IoT) and REST APIs

Daily data generation 2020 @AlexandraABowen #Defragcon

Page 26: Internet of Things (IoT) and REST APIs

Internet of useless things.

@AlexandraABowen #Defragcon

Page 27: Internet of Things (IoT) and REST APIs

• Part 1: Current state of IoT• Part 2: Future of IoT• Part 3: Developer perspective• Part 4: APIs and REST• Part 5: Open Source Services

Future of IoT

@AlexandraABowen #Defragcon

Page 28: Internet of Things (IoT) and REST APIs

The IoT has the greatest potential to advance society since the Industrial Revolution: a world where all kinds of things are interconnected, smart, communicating, and improving our quality of life.

Future State

@AlexandraABowen #Defragcon

Page 29: Internet of Things (IoT) and REST APIs

Interoperability & InterconnectednessInteroperability is the ability of different information technology systems and

software applications to communicate, exchange data, and use the information that has been exchanged.

Interconnectedness is part of the terminology of a worldview which sees a oneness in all things.

@AlexandraABowen #Defragcon

Page 30: Internet of Things (IoT) and REST APIs

Law and Order. Coming up:• Nielen’s Law• Moore’s Law• Metcalfe’s Law

@AlexandraABowen #Defragcon

Page 31: Internet of Things (IoT) and REST APIs

Nielen’s LawUsers' bandwidth grows by 50% per year

@AlexandraABowen #Defragcon

Page 32: Internet of Things (IoT) and REST APIs

Moore’s LawComputers double in capabilities every 18 months: this corresponds

to about 60% annual growth

@AlexandraABowen #Defragcon

Page 33: Internet of Things (IoT) and REST APIs

Comparing the two Laws shows that: Bandwidth grows slower than computer power.

@AlexandraABowen #Defragcon

Page 34: Internet of Things (IoT) and REST APIs

“The value of a network is proportional to the square of the number of connected users of the system.” -Robert Metcalfe

@AlexandraABowen #Defragcon

Page 35: Internet of Things (IoT) and REST APIs

Connected ≠ SmartBy 2020, Cisco predicts there will be 37 billion “intelligent” things.

@AlexandraABowen #Defragcon

Page 36: Internet of Things (IoT) and REST APIs

Connected things 2020 @AlexandraABowen #Defragcon

Page 37: Internet of Things (IoT) and REST APIs

Doug Fisher, Intel@AlexandraABowen #Defragcon

Page 38: Internet of Things (IoT) and REST APIs

Value of Interconnectedness/InteroperabilityTotal economic value to be generated by the IoT in 2025 is $11.1 Trillion. 47%

of the value — $5.2 Trillion — will be unlocked by Interoperability.

McKinsey 2015 IoT study @AlexandraABowen #Defragcon

Page 39: Internet of Things (IoT) and REST APIs

The Zettabyte EraWe are nearly in the Zettabyte Era. Global IP traffic will reach the Zettabyte

threshold in 2016. 1 Zettabyte (ZB) = 1024 Exabytes (EB). Wherein 1 Exabyte = 1 million Terabytes (TB) of data.

@AlexandraABowen #Defragcon

Page 40: Internet of Things (IoT) and REST APIs
Page 41: Internet of Things (IoT) and REST APIs

Humans turning Data into Wisdom.

Page 42: Internet of Things (IoT) and REST APIs

Every minute…• 72 hours of videos are uploaded to Youtube• 204 million emails are sent• Google receives over 4 million search queries• Facebook users share close to 2.5 million pieces of content• Over 300,000 photos are being shared through whatsapp• Tinder users swipe more than 416,667 times

@AlexandraABowen #Defragcon

Page 43: Internet of Things (IoT) and REST APIs

Thresholds reached by 2020• Global IP traffic has increased five fold over the past 5 years and will and

will reach 2.3 ZB per year• The number of devices connected to IP networks will be more than three

times the global population• There will be 3.4 networked devices per capita by 2020. Smartphone

traffic will exceed PC traffic

@AlexandraABowen #Defragcon

Page 44: Internet of Things (IoT) and REST APIs

Fog computing involves pushing intelligence and processing capabilities down closer to where the data originates, from pumps, motors, sensors, relays…

Page 45: Internet of Things (IoT) and REST APIs

Fog computingFog computing is an extension of cloud computing that is:• Adding process and memory resources to Edge devices• Pre-processing collected data at the Edge• Sending aggregated results to the cloud

@AlexandraABowen #Defragcon

Page 46: Internet of Things (IoT) and REST APIs

• Part 1: Current state of IoT• Part 2: Future of IoT• Part 3: Developer perspective• Part 4: APIs and REST• Part 5: Open Source Services

Dev Perspective

@AlexandraABowen #Defragcon

Page 47: Internet of Things (IoT) and REST APIs

Dev Perspective

Building blocks of IoT development• Devices, endpoints• Device management — collecting information, storing it and extracting it• Filtering — information filtered out, event handling and notifications• User management- Permissions — users, access, roles

@AlexandraABowen #Defragcon

Page 48: Internet of Things (IoT) and REST APIs

• Hold your data in unstructured schemas• Choose a device agnostic platform, don’t model for certain kind of

device.• Interoperability

• Aggregation is not done in silo. Be open.• Optimize for small packets in high volumes

• You may have constrained networks and resources. Offer ways to pass in information in a structured and minimalist way.

Do’s and don’ts when developing

@AlexandraABowen #Defragcon

Page 49: Internet of Things (IoT) and REST APIs

• Handle failure conditions• Make sure you have good testing and error handling.

• Documentation• Don’t neglect Documentation!

• Start small• Reduce TTFHW (time to first hello world).

Do’s and don’ts when developing

@AlexandraABowen #Defragcon

Page 50: Internet of Things (IoT) and REST APIs

Do’s and don’ts when developing• Security matters

• Provide transport layer encryption, provide a permissions model for you to secure access and allow you to encrypt messages with public private keys.

• Context matters• Don’t think that only one person, or device will be consuming. Keep in mind

that devices have different form factors and computational power.• State matters

• Decide whether a Pull or Push state makes more sense for your project.• REST (polling) works for most developers and if you have low(er) time

sensitivity. Keep in mind, it can be as low as milliseconds.@AlexandraABowen #Defragcon

Page 51: Internet of Things (IoT) and REST APIs

Standards and collaboration are required to enable this massively smart and interconnected world.

@AlexandraABowen #Defragcon

Page 52: Internet of Things (IoT) and REST APIs

Standards will unlock the massive opportunity in the IoT market, accelerate industry innovation and help developers and companies create solutions

that map to a single open specification.

@AlexandraABowen #Defragcon

Page 53: Internet of Things (IoT) and REST APIs

What will it look like?• Open• Royalty free• Seamless• Technology agnostic• Fair and accessible• Cross industry• More secure• Structured @AlexandraABowen #Defragcon

Page 54: Internet of Things (IoT) and REST APIs

Standards and collaboration drive adoption.• Wifi: $90 B in annual economic value in the US• OSS 31 billion lines of code. 3.8 million OS contributors• Mobile 2015 4 billion unique subs. Contributing $3.7 to global GOP• Web: 1995 <1% of the world connected. 2016 — over 40% connected

@AlexandraABowen #Defragcon

Page 55: Internet of Things (IoT) and REST APIs

• Part 1: Current state of IoT• Part 2: Future of IoT• Part 3: Developer perspective• Part 4: APIs and REST• Part 5: Open Source Services

API’s and REST

@AlexandraABowen #Defragcon

Page 56: Internet of Things (IoT) and REST APIs
Page 57: Internet of Things (IoT) and REST APIs

“Software is eating the world.” And it’s not just any software that’s eating the world, it’s API-driven

and Javascript in particular.

@AlexandraABowen #Defragcon

Page 58: Internet of Things (IoT) and REST APIs

RESTREST is the architecture of the web, and if you’re going to be building applications

on the web — shouldn’t you work with the architecture not against it?

@AlexandraABowen #Defragcon

Page 59: Internet of Things (IoT) and REST APIs

REST Addresses• Performance• Scalability• Simplicity of interfaces• Modifiability• Visibility• Portability• Reliability

@AlexandraABowen #Defragcon

Page 60: Internet of Things (IoT) and REST APIs

Why APIs matter to IoT

• APIs provide the ability to glue and integrate services• APIs allow developers to build context based applications• APIs are a set of routines, protocols, and tools for building software

applications

@AlexandraABowen #Defragcon

Page 61: Internet of Things (IoT) and REST APIs

• Part 1: Current state of IoT• Part 2: Future of IoT• Part 3: Developer perspective• Part 4: APIs and REST• Part 5: Open Source Services

Open Source

@AlexandraABowen #Defragcon

Page 62: Internet of Things (IoT) and REST APIs

Open Source Resources: Hardware

• Arduino — Electronics platform based on easy-to-use hardware and software. It’s intended for anyone making interactive projects.

• BeagleBoard — Low-power open-source hardware single-board computer produced by Texas Instruments in association with Digi-Key and Newark element14.

• Microduino — Powerful, small, stackable electronic hardware to makers, designers, engineers, students and curious tinkerers of all ages. Build open-source projects or create innovative new ones.

• Node MCU (ESP 8266) — IoT platform. It uses the Lua scripting language. It is based on the eLua project, and built on the ESP8266 SDK 0.9.5.

• OLinuXino — Software and Hardware low cost (EUR 30) Linux Industrial grade single board computer with GPIOs capable of operating from -25°C to +85°C.

• Raspberry Pi — Low cost, credit-card sized computer that plugs into a computer monitor or TV, and uses a standard keyboard and mouse. It’s capable of doing everything you’d expect a desktop computer to do.

• Tessel — Community-driven IoT and robotics development platform. It encompasses development boards, hardware module add-ons, and the software that runs on them.

@AlexandraABowen #Defragcon

Page 63: Internet of Things (IoT) and REST APIs

Open Source Resources: Software, operating systems• Contiki — Operating system for the Internet of Things. Contiki connects tiny

low-cost, low-power microcontrollers to the Internet.• OpenWrt — Operating system (in particular, an embedded operating system)

based on the Linux kernel, primarily used on embedded devices to route network traffic. The main components are the Linux kernel, util-linux, uClibc or musl, and BusyBox. All components have been optimized for size, to be small enough for fitting into the limited storage and memory available in home routers.

• Tiny OS — Operating system designed for low-power wireless devices, such as those used in sensor networks, ubiquitous computing, personal area networks, smart buildings, and smart meters.

• Linux @AlexandraABowen #Defragcon

Page 64: Internet of Things (IoT) and REST APIs

Open Source Resources: Frameworks• AllJoyn — Software framework that makes it easy for devices and apps to

discover and communicate with each other.• Countly IoT Analytics — General purpose analytics platform for mobile and

IoT devices, available as open source.• Iotivity — Software framework enabling seamless device-to-device connectivity

to address the emerging needs of the Internet of Things.• Kura — Java/OSGi-based container for M2M applications running in service

gateways. Kura provides or, when available, aggregates open source implementations for the most common services needed by M2M applications.

• OpenHAB — The openHAB runtime is a set of OSGi bundles deployed on an OSGi framework (Equinox). It is therefore a pure Java solution and needs a JVM to run.

@AlexandraABowen #Defragcon

Page 65: Internet of Things (IoT) and REST APIs

Open Source Resources: Middleware• Kaa — Middleware platform for rapid creation of IoT solutions.• Losant —Developer platform designed to help you quickly and securely build

complex connected solutions. Losant uses open communication standards like REST and MQTT to provide connectivity from one to millions of devices. Losant provides powerful data collection, aggregation, and visualization features to help understand and quantify vast amounts of sensor data. Losant’s drag-and-drop workflow editor allows you to trigger actions, notifications, and machine-to-machine communication without programming.

• DreamFactory — Free open source REST API Platform for mobile, web and IoT Applications.

@AlexandraABowen #Defragcon

Page 66: Internet of Things (IoT) and REST APIs

DreamFactory• An API Platform that allows you to build IoT Applications• Open Source• Automatically generates REST APIs• Low code platform, with custom scripting support• Automatically creates Documentation, through Swagger, for your APIs• Maximizes the reliability, scalability, and security

@AlexandraABowen #Defragcon

Page 67: Internet of Things (IoT) and REST APIs

DreamFactory Platform

Instant APIs• SQL, NoSQL, File Storage• External REST/SOAP

Instant Dev Environments• Automatic platform generation• Interactive documentation• Server-side scripting• Orchestration of 3rd party services• Custom API construction• Role-based access controls• SSO, AD, LDAP, OAuth• Multi-tenant sandboxes

Run on any server or cloud• JWT for massive scalability

@AlexandraABowen #Defragcon

Page 68: Internet of Things (IoT) and REST APIs

Let’s break it down (quickly)

@AlexandraABowen #Defragcon

Page 69: Internet of Things (IoT) and REST APIs

Install on any server

● Infrastructure as a Service (IaaS)● Platform as a Service (PaaS)● On Premises Data Center● Desktop Installer

@AlexandraABowen #Defragcon

Page 70: Internet of Things (IoT) and REST APIs

Connect to any database

● SQL● NoSQL● File Storage● External Web Services

@AlexandraABowen #Defragcon

Page 71: Internet of Things (IoT) and REST APIs

Develop for any device

● HTML5● Native Apps● Browser Websites● Internet of Things● Server to Server

@AlexandraABowen #Defragcon

Page 72: Internet of Things (IoT) and REST APIs

API Automation Approach• Reusable APIs for any new project• Customization for special cases• Focus on front-end app development• Decouple client-side from server-side• Flexible backend infrastructure• Flexible backend data sources• Automatically documented• Scalable, reliable, portable, secure

@AlexandraABowen #Defragcon

Page 73: Internet of Things (IoT) and REST APIs

DreamFactory IoT stack offers MQTT integration• Existing support for a variety of data sources• Developers are able to build end-to-end IoT applications that take advantage

of MQTT and REST• Using DreamFactory’s Server Side Scripts, developers can write rules

(Javascript, PHP, Python…)• We integrated Mosca, an open source MQTT broker, with DreamFactory to

complement the RESTful API.

@AlexandraABowen #Defragcon

Page 74: Internet of Things (IoT) and REST APIs

DreamFactory IoT Building Blocks

@AlexandraABowen #Defragcon

Page 75: Internet of Things (IoT) and REST APIs

Take Aways• IoT is already here, and we need developers to help us harmonize on data

models, on APIs, on device classes across industries.• Standards will help ensure secure interoperability for consumers, business,

and industry.• IoT is the next evolution of the internet.• IoT is changing the way we engage and interact with devices and people.• There are many hurdles in IoT before we start to see smart, connected

devices and interoperability.• IoT is a great opportunity, making things smart and connected only makes

sense if it’s useful and done well.• The premise is, that everything should talk to everything else. APIs and

standards help with this. @AlexandraABowen #Defragcon

Page 76: Internet of Things (IoT) and REST APIs

@AlexandraABowen #Defragcon

Page 77: Internet of Things (IoT) and REST APIs

Thank you!

@AlexandraABowen #Defragcon