Mais conteúdo relacionado Semelhante a IoTCraft - Chennai - meetup - ZettaJS - IoT Intro (20) IoTCraft - Chennai - meetup - ZettaJS - IoT Intro7. ©2015 Apigee Corp. All Rights Reserved.
IoTCraft Swags… Send 5 Tweets
@Apigee
@zettajs
@IoTCraft
19. ©2015 Apigee Corp. All Rights Reserved.
Tomorrow
app app app appapp app app
One experience
One big app
(Powered by APIs)
21. ©2015 Apigee Corp. All Rights Reserved.
What is NodeJS and who uses it?
• Cross-platform runtime environment for developing server-side
Web applications
• Built on Google Chrome's JavaScript V8 Engine
• Open source, completely free
• Event driven architecture and asynchronous I/O
• Operates on a single thread, using non-blocking I/O calls
• Package manager - npm
• Used by LinkedIn, IBM, Paypal, Netflix
22. ©2015 Apigee Corp. All Rights Reserved.
Node.JS First Class HTTP Server
• No need of maintaining separate threads for each open connection
• Create REST APIs very easily
• Asynchronous I/O
23. ©2015 Apigee Corp. All Rights Reserved.
Realtime apps and Async. Programming
Real time applications need non blocking I/O. This can be achieved by
Asynchronous programming which is commonly used in event based systems.
Async. Programming involves :
● Callbacks
● Promises
● Generators / yeilds (ES6)
● Async/ await (ES7)
24. ©2015 Apigee Corp. All Rights Reserved.
Example
//Synchronous
var result = database.query("SELECT * FROM hugetable");
console.log("query finished");
console.log("Next line");
//Asynchronous
database.query("SELECT * FROM hugetable", function(result) {
console.log("query finished");
});
console.log("Next line");
26. ©2015 Apigee Corp. All Rights Reserved.
Zetta Combines..
• Reactive Programming
• Web Sockets
• Rest APIs
26
28. ©2015 Apigee Corp. All Rights Reserved.
Zetta Server
• Highest Level Of Abstraction in Zetta
• Runs on Hardware such as Intel Edison, Raspberry PI etc..
• Generates APIs
• Coordinates Interaction
28
29. ©2015 Apigee Corp. All Rights Reserved.
Zetta Drivers..
• State Machine Representation of Devices
• Models Devices & Facilitates Interaction
• Device Models - APIs
29
Off On
turn-off
turn-on
30. ©2015 Apigee Corp. All Rights Reserved.
Zetta Scouts..
30
• Discovery Mechanism
• Search for Devices
• Report Backs
31. ©2015 Apigee Corp. All Rights Reserved.
Zetta Apps
31
• Written in Javascript
• Interact with Multiple Devices
• Interaction based on Sensor Streams
32. ©2015 Apigee Corp. All Rights Reserved.
Zetta Server Extensions
32
• Pluggable Models
• Node Modules
• For Example
– Adding Additional APIs
– Adding Security to APIs
33. ©2015 Apigee Corp. All Rights Reserved.
Zetta Registry
33
• Small Database
• Information about Devices
• Information about Server Itself
35. ©2015 Apigee Corp. All Rights Reserved.
Zetta Linking..
35
Linking establishes a secure connection between two
Zetta servers. It uses the Z2Z protocol to efficiently proxy
API requests, and streaming data between servers.
Z1Z2
F
i
r
e
w
a
l
l
HTTP Proxy
36. ©2015 Apigee Corp. All Rights Reserved.
Zetta APIs
36
• Query Devices
• Sensor Data Streams
• Interact with Devices
• Links between Servers
39. ©2015 Apigee Corp. All Rights Reserved.
Interested to drive IoTCraft – Chennai ?
39
Send a message – Meetup Group
Notas do Editor V8 - V8 compiles JavaScript to native machine code Single thread - Can’t scale vertically without using an additional module (use cluster, pm2 or strongloop pm)