erocci, a scalable model-driven rest framework

27
November 5th, 2014 erocci - Jean Parpaillon 1 erocci A scalable model-driven REST framework Jean Parpaillon <[email protected]>

Upload: jean-parpaillon

Post on 07-Jul-2015

416 views

Category:

Technology


1 download

DESCRIPTION

While REST architecture has been widely adopted for web services, the lack of standard formalism for their description prevents from implementations interoperability. The erocci framework, based on erlang/OTP platform, implements the OCCI specification for building interoperable, self-documented web services. Building a scalable web service is as simple as describing your application model in an XML document and choosing amongst existing data backend. It can be extended in various ways to adapt to data sources (database, 3rd party web services, DBUS APIs, etc.), protocols (HTTP, XMPP, etc.), authentication mechanisms, etc.

TRANSCRIPT

Page 1: erocci, a scalable model-driven REST framework

November 5th, 2014 erocci - Jean Parpaillon 1

erocci

A scalable model-driven REST framework

Jean Parpaillon <[email protected]>

Page 2: erocci, a scalable model-driven REST framework

November 5th, 2014 erocci - Jean Parpaillon 2

REST API : a user point of view 

Page 3: erocci, a scalable model-driven REST framework

November 5th, 2014 erocci - Jean Parpaillon 3

REST API : a user point of view 

Data formatJSON formatXML formatScalar data types (string, integer, float, etc)

Data access protocolFilteringSortingPaginationAuthnz (tokens, etc), return codes, etc.

Finally...Application level : data types (structures, relations, etc) 

Page 4: erocci, a scalable model-driven REST framework

November 5th, 2014 erocci - Jean Parpaillon 4

REST API : a user point of view 

Data formatJSON formatXML formatScalar data types (string, integer, float, etc)

Data access protocolFilteringSortingPaginationAuthnz (tokens, etc), return codes, etc.

Finally...Application level : data types (structures, relations, etc) 

Schémas ? 

One to rule them all ? 

A single meta-model ? 

Page 5: erocci, a scalable model-driven REST framework

November 5th, 2014 erocci - Jean Parpaillon 5

Let's speak about a standard ? 

Page 6: erocci, a scalable model-driven REST framework

November 5th, 2014 erocci - Jean Parpaillon 6

Let's speak about a standard for REST

A standardIs not a catalog of schemasIs not a constraint for developersMust be implemented (implementable)

A good standardShould allow to concentrate on the design, not the implementation detailsAllow to build an ecosystemAllow to accelerate the development, not the contrary

Page 7: erocci, a scalable model-driven REST framework

November 5th, 2014 erocci - Jean Parpaillon 7

The Open Cloud Computing Interface

OCCI is typedA ressource is an instance of a kindA kind is a named list of typed attributes and actions

e.g. : compute : # cores (integer), RAM (float), etc   Attribute : name, type, default value, mutability, etc. Action : an invocable operation on a ressource Kinds are inheritable

Page 8: erocci, a scalable model-driven REST framework

November 5th, 2014 erocci - Jean Parpaillon 8

The Open Cloud Computing Interface

OCCI is extensibleResource can be associated with mixinsMixin: a named set of additional attributes and actions

e.g. : IPNetworkInterface adds IP, netmask, etc to a  network interface

User Mixin : aka « tags »     e.g. : http://example.com/occi/mixins#my_project1 

Page 9: erocci, a scalable model-driven REST framework

November 5th, 2014 erocci - Jean Parpaillon 9

The Open Cloud Computing Interface

OCCI is relationalLinks are ressources with additional attributes

occi.core.source : resource URI occi.core.target : URI 

A bounded collection is a list of ressources of the same kind/mixin : 

e.g. : GET /collections/compute/ An unbounded collection is a list of ressources with same prefx : 

e.g. : GET /myresources/ 

Page 10: erocci, a scalable model-driven REST framework

November 5th, 2014 erocci - Jean Parpaillon 10

The Open Cloud Computing Interface

OCCI is self-describedGET /-/ (capabilities)

List of supported kindsList of supported mixins

Capabilities returns collection's URLhttp://schemas.ogf.org/occi/infrastructure#compute → /collections/compute/

Page 11: erocci, a scalable model-driven REST framework

November 5th, 2014 erocci - Jean Parpaillon 11

The Open Cloud Computing Interface

OCCI is meta-model basedModel consistency checkingAutomatic model implementationRendering independant

text/plain, application/json, …Transport independant

HTTP, ...

Page 12: erocci, a scalable model-driven REST framework

November 5th, 2014 erocci - Jean Parpaillon 12

OCCI Ecosystem

Framework

rOCCI (ruby)

occi4java (not maintained)

Specifc implementations

CompatibleOne

PyOCNI

OpenStack, OpenNebula, etc

Limits

Models are language/extensions/lib dependant

See http://occi-wg/community/implementations/

Tools

DoYouSpeakOcci : tests 

Monitoring (Intel)

Page 13: erocci, a scalable model-driven REST framework

November 5th, 2014 erocci - Jean Parpaillon 13

Why erocci ? 

Generic : a framework to build OCCI applications Less code, more designSmall, tested, reliableEasy to deployScalable

Runs embedded in connected objects (IoT)Scales out to serve millions of users

Extensible

Page 14: erocci, a scalable model-driven REST framework

November 5th, 2014 erocci - Jean Parpaillon 14

Architecture

Page 15: erocci, a scalable model-driven REST framework

November 5th, 2014 erocci - Jean Parpaillon 15

Genericity

Only OCCI meta-model is hard-codedEverything is pluggable : 

Authentication mechanismTransport protocol (HTTP, XMPP, etc)Data sources (backends)

Allow composition of services by plugging data sources (backends) at runtime

Page 16: erocci, a scalable model-driven REST framework

November 5th, 2014 erocci - Jean Parpaillon 16

Less code, more design

A schema for ressources' categories (kinds, mixins)ACL-based authorizations

Page 17: erocci, a scalable model-driven REST framework

November 5th, 2014 erocci - Jean Parpaillon 17

Small, tested, reliable

SmallAround 12k lines

TestedContinuous integration

ReliableErlang cowboy web server (LeoFS, MongooseIM, etc)erlang/OTP platform provides fault toleranceProcess supervision

Page 18: erocci, a scalable model-driven REST framework

November 5th, 2014 erocci - Jean Parpaillon 18

Easy to deploy

All included erlang/OTP platformSelf contained : no web frontend Just try it ! 

Page 19: erocci, a scalable model-driven REST framework

November 5th, 2014 erocci - Jean Parpaillon 19

Scalable

Thanks to erlang/OTPRuns on RaspberryPI (~ 100 req/sec)Scales out to a full cluster

Page 20: erocci, a scalable model-driven REST framework

November 5th, 2014 erocci - Jean Parpaillon 20

Extensible

Pluggable mechanismsFor those who don't like erlang

D-Bus backend API (experimental)

Page 21: erocci, a scalable model-driven REST framework

November 5th, 2014 erocci - Jean Parpaillon 21

(1) use case : a REST backend for blog 

No need for ORM, web server, database, templating, etc.Design your model

Blog entry kindUser kindContribution kind (link between a user and an entry)

Choose a storage backendChoose a transport (HTTP?)Defnes ACLAnd that's all

Page 22: erocci, a scalable model-driven REST framework

November 5th, 2014 erocci - Jean Parpaillon 22

(2) use case : API adapter 

Backend API : write a new data source for your API Erlang APID-Bus API (any language)In any case, implements CRUD operations

Choose a transportEnjoy scalability, supervision, transports, ACL, etc.

Page 23: erocci, a scalable model-driven REST framework

November 5th, 2014 erocci - Jean Parpaillon 23

(3) use case : a protocol adapter 

You have a resource oriented protocol and want to expose it through HTTP/OCCIUse occi_store for storing your dataerocci deals with storage, rendering, scalability, ...

Page 24: erocci, a scalable model-driven REST framework

November 5th, 2014 erocci - Jean Parpaillon 24

Roadmap

Authn/authzx509 based authnoauth

occi_storeOptimizationsIntegrate authnz, pagination (wip)

XMPPEnable pubsub (notifcations)

New storage backendsRiak (wip)ODBC (SQL)…

TestingImprove functional testsImprove unit testing

Page 25: erocci, a scalable model-driven REST framework

November 5th, 2014 erocci - Jean Parpaillon 25

Eco-system : OCCIware 

(1) consortiumResearch, industry, standardization

(3) pillarsTheory : proven meta-model (OCCI) Design : Eclipse-based tools Runtime : erocci, … 

(*) use casesIaaS, PaaS, SaaS, IoT, ...Every RESTful services

Page 26: erocci, a scalable model-driven REST framework

November 5th, 2014 erocci - Jean Parpaillon 26

Resources

Website (WIP)http://erocci.ow2.org/

Source codehttp://github.com/erocci/erocci

Continuous integrationhttps://travis-ci.org/jeanparpaillon/erocci

Mailing [email protected] / [email protected]

Page 27: erocci, a scalable model-driven REST framework

November 5th, 2014 erocci - Jean Parpaillon 27

Thanks ! 

Questions ?