1 of 24

Cloud Integration with node.js

From enterprise integration to micro-services and iPaaS

Alboaie Sînică

CEO Axiologic, http://www.axiologic.ro

2 of 24

What is Integration. Why?

  • business aspects
  • security aspects
  • different
    • vendors
    • teams
    • products
  • modularity/ product quality
  • timing, new requests

3 of 24

Point to Point, Files, Databases

  • Real Time Integration
    • Point to Point
      • custom code, exploding complexity, fragility
    • Bus (ESB, MOM)
  • Scheduled Integration
    • export/import of files
    • shared databases
    • ETL scripts (Extract/Transform/Load)

4 of 24

What is a Bus ?

    • informational street
    • all integration points learn how to “drive”

5 of 24

Integration with Bus like systems

ESB : Enterprise Service BUS

MOM: Message Oriented Middleware

EIP: Enterprise Integration Patterns

  • Benefits:
    • can easily add or remove integration points later
    • fewer custom configs and simpler deployments (one point of integration for everybody)
    • bring all integration points to a common platform and protocol

6 of 24

EIP concepts and concerns

  • messages / events
  • message channel (PUB/SUB, Point to Point)
  • message endpoint
  • pipes and filters, routing, translator
  • guaranteed delivery (duplicates)
  • load balancing/load distribution
  • logging
  • monitoring, throttler, SLA, etc

7 of 24

Related Java/C technologies

  • JMS (Java Massages Services) - MOM
  • Apache ActiveMQ
  • Apache Camel (EIP)
  • Apache Service Mix (ESB)
  • ZeroMQ!
  • commercial (SAP, Oracle, Microsoft...)

8 of 24

iPaaS

Integration Platform as a Service

Many categories of iPaaS vendors

  • e-commerce and B2B integration: simple and limited solution
  • Enterprise Service Bus (ESB) for hybrid (cloud and on premise)
  • Service Oriented Architecture (SOA) infrastructure

9 of 24

BPM, SOA

Service Oriented Architecture

  • Orchestration
    • Business Process Management
      • long living processes
      • BPEL (standards)
    • service composition
    • intra-organisation
  • Choreography
    • WS-CDL
    • inter-organisation
  • SOA v1 (orchestrated services centrally
  • SOA v2 (event driven SOA)

10 of 24

Concurrency model: Actors

  • actors (Carl Hewitt)
    • message queue
    • addresses
  • send asynchronous messages
  • behaviour
    • set the behaviour for the next message
    • create new actors
    • learn other address
  • mobility, locality
  • intuitive, naive messages
  • inspired OOP

11 of 24

Formal models for asynchronisms

pi-calculus, CSP, etc

12 of 24

Node.js Technologies

  • asynchronous
  • no threading
  • cluster (processes): vertical scalability
  • service routing, external balancer

13 of 24

SwarmESB - node.js

  • micro-services
  • integration
  • easily change complex process
  • form of choreography?

14 of 24

Swarm communication model

Inverted perspective on the actor model

  • messages have behaviour
  • mobile code nod actors
  • decisions in messages not in actors
  • distributed in a network (horizontal scalability)
  • Active messages

15 of 24

Concepts

  • adapters
  • swarm description
  • phases
  • variables
  • swarm primitives
  • swarms at runtime

16 of 24

Concepts

  • swarms at runtime
    • kind of message
    • more a set of related messages
    • have behaviours attached
    • have a current phase
    • can exist in multiple nodes
    • can have a single identity for all messages
    • clone itself and visit adapters

17 of 24

Concepts

  • adapters
    • somehow like actors: target for messages
    • adapt external APIs or micro-services
    • basically: a collection of functions

18 of 24

Concepts

  • swarm description
    • script that describe the choreography
    • a set of phases (functions) that should be executed
    • also contains
      • ctors (constructors)
      • swarm variables

19 of 24

Concepts

  • phases
    • hints about what type of adapter (node) can be execute it
    • contains a function (imperative code)
    • can call adapter’s APIs and swarm, home, broadcast primitives
    • modify swarm variables

statusCheck:{

node:"*",

code : function (){

this.status = currentAPI_status(); //set swarm variable

if( this.status == “OK”){ //use swarm variable

this.home("okStatusLogger");

} else {

this.swarm("errorStatusLogger");

}

}

}

20 of 24

Concepts

  • swarm variables
    • variables with a type
    • initialisation

  • meta variables (swarm status, control)

var: {

hello:”Hello World”

}

21 of 24

Concepts

  • swarm primitives
    • swarm: send a clone of the current swarm in another phase (another adapter)
    • home: send a clone to the client that started the swarm
    • broadcast: send multiple clones in all adapters of a specified type

22 of 24

Example hello world

23 of 24

Exemple

24 of 24

Example