36
ROME 27-28 march 2015 Fully Reactive From Data to UI with OrientDB + Node.js + Socket.io Director of Consulting Orient Technologies LTD The company behind OrientDB Twitter: @ldellaquila Luigi Dell’Aquila

Fully Reactive - from Data to UI with OrientDB + Node.js + Socket.io - Luigi Dell'Aquila - Codemotion Rome 2015

Embed Size (px)

Citation preview

Page 1: Fully Reactive - from Data to UI with OrientDB + Node.js + Socket.io - Luigi Dell'Aquila - Codemotion Rome 2015

ROME 27-28 march 2015

Fully Reactive

From Data to UI with OrientDB + Node.js + Socket.io

Director of Consulting Orient Technologies LTDThe company behind OrientDB

Twitter: @ldellaquila

Luigi Dell’Aquila

Page 2: Fully Reactive - from Data to UI with OrientDB + Node.js + Socket.io - Luigi Dell'Aquila - Codemotion Rome 2015

ROME 27-28 march 2015 - Luigi Dell’Aquila

From Wikipedia

reactive programming is a programming paradigm oriented

around data flows and the propagation of change

Page 3: Fully Reactive - from Data to UI with OrientDB + Node.js + Socket.io - Luigi Dell'Aquila - Codemotion Rome 2015

ROME 27-28 march 2015 - Luigi Dell’Aquila

Propagation of change

A = 1B = 3C = A + B // C == 4

Page 4: Fully Reactive - from Data to UI with OrientDB + Node.js + Socket.io - Luigi Dell'Aquila - Codemotion Rome 2015

ROME 27-28 march 2015 - Luigi Dell’Aquila

Propagation of change

A = 1B = 3C = A + B // C == 4

A = 2

Page 5: Fully Reactive - from Data to UI with OrientDB + Node.js + Socket.io - Luigi Dell'Aquila - Codemotion Rome 2015

ROME 27-28 march 2015 - Luigi Dell’Aquila

Propagation of change

A = 1B = 3C = A + B // C == 4

A = 2

C == ?

Page 6: Fully Reactive - from Data to UI with OrientDB + Node.js + Socket.io - Luigi Dell'Aquila - Codemotion Rome 2015

ROME 27-28 march 2015 - Luigi Dell’Aquila

So it’s about Programming

Isn’t it…?

Page 7: Fully Reactive - from Data to UI with OrientDB + Node.js + Socket.io - Luigi Dell'Aquila - Codemotion Rome 2015

ROME 27-28 march 2015 - Luigi Dell’Aquila

From Reactive ManifestoReactive systems are:

Page 8: Fully Reactive - from Data to UI with OrientDB + Node.js + Socket.io - Luigi Dell'Aquila - Codemotion Rome 2015

ROME 27-28 march 2015 - Luigi Dell’Aquila

From Reactive ManifestoReactive systems are:

UX

Page 9: Fully Reactive - from Data to UI with OrientDB + Node.js + Socket.io - Luigi Dell'Aquila - Codemotion Rome 2015

ROME 27-28 march 2015 - Luigi Dell’Aquila

From Reactive ManifestoReactive systems are:

Infrastructure

Page 10: Fully Reactive - from Data to UI with OrientDB + Node.js + Socket.io - Luigi Dell'Aquila - Codemotion Rome 2015

ROME 27-28 march 2015 - Luigi Dell’Aquila

From Reactive ManifestoReactive systems are:

Programming paradigm?

Page 11: Fully Reactive - from Data to UI with OrientDB + Node.js + Socket.io - Luigi Dell'Aquila - Codemotion Rome 2015

ROME 27-28 march 2015 - Luigi Dell’Aquila

So it’s about Systems!

Page 12: Fully Reactive - from Data to UI with OrientDB + Node.js + Socket.io - Luigi Dell'Aquila - Codemotion Rome 2015

ROME 27-28 march 2015 - Luigi Dell’Aquila

Application

Page 13: Fully Reactive - from Data to UI with OrientDB + Node.js + Socket.io - Luigi Dell'Aquila - Codemotion Rome 2015

ROME 27-28 march 2015 - Luigi Dell’Aquila

UI/UX

Application

Page 14: Fully Reactive - from Data to UI with OrientDB + Node.js + Socket.io - Luigi Dell'Aquila - Codemotion Rome 2015

ROME 27-28 march 2015 - Luigi Dell’Aquila

UI/UX

Application

Data(base)

Page 15: Fully Reactive - from Data to UI with OrientDB + Node.js + Socket.io - Luigi Dell'Aquila - Codemotion Rome 2015

ROME 27-28 march 2015 - Luigi Dell’Aquila

UI/UX

Application

Data(base)

Page 16: Fully Reactive - from Data to UI with OrientDB + Node.js + Socket.io - Luigi Dell'Aquila - Codemotion Rome 2015

ROME 27-28 march 2015 - Luigi Dell’Aquila

UI/UX

Application

Data(base)

UI/UX

Application

Data(base)

UI/UX

Application

Data(base)

Page 17: Fully Reactive - from Data to UI with OrientDB + Node.js + Socket.io - Luigi Dell'Aquila - Codemotion Rome 2015

ROME 27-28 march 2015 - Luigi Dell’Aquila

Time toCode

Page 18: Fully Reactive - from Data to UI with OrientDB + Node.js + Socket.io - Luigi Dell'Aquila - Codemotion Rome 2015

ROME 27-28 march 2015 - Luigi Dell’Aquila

Page 19: Fully Reactive - from Data to UI with OrientDB + Node.js + Socket.io - Luigi Dell'Aquila - Codemotion Rome 2015

ROME 27-28 march 2015 - Luigi Dell’Aquila

Socket.IO enables real-time bidirectional event-based communication.

It works on every platform, browser or device, focusing equally on reliability and speed.

Page 20: Fully Reactive - from Data to UI with OrientDB + Node.js + Socket.io - Luigi Dell'Aquila - Codemotion Rome 2015

ROME 27-28 march 2015 - Luigi Dell’Aquila

Node.js® is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications.

Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications

that run across distributed devices.

Page 21: Fully Reactive - from Data to UI with OrientDB + Node.js + Socket.io - Luigi Dell'Aquila - Codemotion Rome 2015

ROME 27-28 march 2015 - Luigi Dell’Aquila

OrientDB is a 2nd Generation Distributed Graph Database with the flexibility of Documents in one product

and an Open Source commercial friendly license (Apache 2)

Page 22: Fully Reactive - from Data to UI with OrientDB + Node.js + Socket.io - Luigi Dell'Aquila - Codemotion Rome 2015

ROME 27-28 march 2015 - Luigi Dell’Aquila

Let’s Start

(Fully reactive chat in 30 LOC)

Page 23: Fully Reactive - from Data to UI with OrientDB + Node.js + Socket.io - Luigi Dell'Aquila - Codemotion Rome 2015

ROME 27-28 march 2015 - Luigi Dell’Aquila

package.json

{ "name": "codemotion", "version": "1.0.0", "description": "Here we are", "dependencies": { }}

Page 24: Fully Reactive - from Data to UI with OrientDB + Node.js + Socket.io - Luigi Dell'Aquila - Codemotion Rome 2015

ROME 27-28 march 2015 - Luigi Dell’Aquila

> npm install --save [email protected]

> npm install --save socket.io

Page 25: Fully Reactive - from Data to UI with OrientDB + Node.js + Socket.io - Luigi Dell'Aquila - Codemotion Rome 2015

ROME 27-28 march 2015 - Luigi Dell’Aquila

Page 26: Fully Reactive - from Data to UI with OrientDB + Node.js + Socket.io - Luigi Dell'Aquila - Codemotion Rome 2015

ROME 27-28 march 2015 - Luigi Dell’Aquila

Page 27: Fully Reactive - from Data to UI with OrientDB + Node.js + Socket.io - Luigi Dell'Aquila - Codemotion Rome 2015

ROME 27-28 march 2015 - Luigi Dell’Aquila

Live…

Page 28: Fully Reactive - from Data to UI with OrientDB + Node.js + Socket.io - Luigi Dell'Aquila - Codemotion Rome 2015

ROME 27-28 march 2015 - Luigi Dell’Aquila

Install OrientDB

(experimental branch, will be released soon)

https://github.com/orientechnologies/orientdb/tree/livequery

> ant clean install

Page 29: Fully Reactive - from Data to UI with OrientDB + Node.js + Socket.io - Luigi Dell'Aquila - Codemotion Rome 2015

ROME 27-28 march 2015 - Luigi Dell’Aquila

Install Oriento (OrientDB driver for Node.js)

> npm install git://github.com/luigidellaquila/oriento#livequery

(will be)> npm install oriento

Please, have a little patience, it’s still bleeding edge ;-)

Page 30: Fully Reactive - from Data to UI with OrientDB + Node.js + Socket.io - Luigi Dell'Aquila - Codemotion Rome 2015

ROME 27-28 march 2015 - Luigi Dell’Aquila

Page 31: Fully Reactive - from Data to UI with OrientDB + Node.js + Socket.io - Luigi Dell'Aquila - Codemotion Rome 2015

ROME 27-28 march 2015 - Luigi Dell’Aquila

And… elastic, resilient…Do you remember?

Page 32: Fully Reactive - from Data to UI with OrientDB + Node.js + Socket.io - Luigi Dell'Aquila - Codemotion Rome 2015

ROME 27-28 march 2015 - Luigi Dell’Aquila

HAZELCASTHAZELCAST HAZELCASTHAZELCAST

HAZELCASTHAZELCAST

Multi Master

Page 33: Fully Reactive - from Data to UI with OrientDB + Node.js + Socket.io - Luigi Dell'Aquila - Codemotion Rome 2015

ROME 27-28 march 2015 - Luigi Dell’Aquila

HAZELCASTHAZELCAST HAZELCASTHAZELCAST

AsyncAsync

Async

Async

Async

Async

Page 34: Fully Reactive - from Data to UI with OrientDB + Node.js + Socket.io - Luigi Dell'Aquila - Codemotion Rome 2015

ROME 27-28 march 2015 - Luigi Dell’Aquila

References

Official Websitehttp://www.orientechnologies.com

Public Repositoryhttp://github.com/orientechnologies/orientdb

Free on-line traininghttp://www.orientechnologies.com/training/

Page 35: Fully Reactive - from Data to UI with OrientDB + Node.js + Socket.io - Luigi Dell'Aquila - Codemotion Rome 2015

ROME 27-28 march 2015 - Luigi Dell’Aquila

Questions?

Page 36: Fully Reactive - from Data to UI with OrientDB + Node.js + Socket.io - Luigi Dell'Aquila - Codemotion Rome 2015

ROME 27-28 march 2015 - Luigi Dell’Aquila

Leave your feedback on Joind.in!https://joind.in/event/view/3347