Aad Versteden | State-of-the-art web applications fuelled by Linked Data aware microservices

37
mu.semte.ch a journey from TenForce’s perspective

Transcript of Aad Versteden | State-of-the-art web applications fuelled by Linked Data aware microservices

mu.semte.ch

a journey fromTenForce’s perspective

In 60 secondsState-of-the-art web applications fuelled by Linked Data aware microservices

- User-facing microservices- Easy deployment using Docker- Single Page Apps using Ember.js- Well known requirements

=> [HTTP+JSON+SPARQL]

https://github.com/mu-semtech/https://mu.semte.ch

Some history

Personal projects lack time...

Most productive future framework?

Many applications. How do we share?

Microservices and a semantic model are key

Share code on personal projects

Rails is not über-productive

Stay light, choose later

Use microservices and semantic model

KISS

Keep It Super Simple

KISS- Most of us aren’t microservice experts- Most of us aren’t UI experts- We need to get stuff done

- Maximize freedom- Orthogonal features- Minimize requirements- Enforce simple mental model

Simple mental modeluser-facing http-services

Simple mental model

User-facing microservices

Limit base technologies:

- HTTP- JSON(API)- SPARQL (one graph)

Simple mental modelTenForce supports publishing of open data.

- Use DCAT standard

- EDCAT 2.0 released- mudCAT = back-end

- webCAT = front-end

- Custom configurations to matchspecific customer needs.

webCAT

Semantic modelsMany actors, telling parts of the same story

Semantic modelsServices read/write the part of the world they understand.

User Registration:

- There’s a new user => add it to the triplestore.

User Login:

- Check username/password => connect user to current session.

Semantic models

Registrationservice

Login service

Semantic models

Many implementations, one model

Same model for:

- Username/Password login- OAuth login- ECAS login

Semantic models

We use the ECAS login for ESCO-related projects.

ESCO is a taxonomy of all Skills Competences and Occupations in Europe.

The Dacota team finds and classifies content. Brains for hire!

http://dacota.one

DockerDeployment made easy

Docker Container =~ Lightweight Linux Virtual MachineDocker Compose =~ Topology of multi-container project

Each service runs in its own Docker Container

In short:

- Simple hosting on hub.docker.com

- Clean project description- Always works- Runs on the Big Data Europe Platform

Share using Docker

Share using DockerWe are part of Big Data Europe

Making Big Data:

- Easy to get started- Cheaper to maintain

… in any domain

- Now including Smart Big Data:=> Semantics + Big Data = <3

Reuse everything

Reuse everything- Templates: basics for a service

- Configurable services- mu-cl-resources

- Ember add-ons- Hierarchy service + add-on

- Login service + add-on

Base templates CatalogsIndexRoute = Ember.Route.extend ajax: Ember.inject.service() model: () -> @get('ajax').request('/hello')

Hello result: {{model.value}}

get '/hello/' do counter = query( "SELECT COUNT (*) as ?counter" + "WHERE {" + " ?s ?p ?o." + "}" ).first[:counter].to_i status 200 { value: counter }.to_jsonEnd

FROM semtech/mu-ruby-template:2.0.0-ruby2.3MAINTAINER Your Name <[email protected]>

demo: image: you/demo-service links: - db:databasedispatcher: … links: - demo:demo

match "/hello/*path" do Proxy.forward conn, path, "http://demo/hello/"end

[mu-ruby-template]

Base templates [mu-ruby-template]

Configurable services

(define-resource distribution () :class (s-prefix "dcat:Distribution") :properties ̀ ((:title :string ,(s-prefix "dct:title")) (:description :string ,(s-prefix "dct:description")) (:issued :string ,(s-prefix "dct:issued")) (:modified :string ,(s-prefix "dct:modified")) (:license :string ,(s-prefix "dct:license")) (:rights :string ,(s-prefix "dct:rights")) (:access-url :string ,(s-prefix "dcat:accessURL")) (:download-url :string ,(s-prefix "dcat:downloadURL"))) :has-one ̀ ((dataset :via ,(s-prefix "dcat:distribution") :inverse t :as "dataset") (format :via ,(s-prefix "dct:format") :as "format")) :resource-base (s-url "http://your-data-stories.eu/distributions/") :on-path "distributions")

[mu-cl-resources]Full JSONAPI from abstract description

Configurable services [mu-cl-resources]

Ember add-ons> ember install ember-async-expanding-tree

{{async-expanding-tree model=topNode config=customConfig}}

config: labelPropertyPath: 'label' getChildren: (model) -> children = Ember.ajax("/hierarchy/" + "#{@get('hierarchyId')}" + "/target/#{model.get('id')}") showMaxChildren: 50 includeLeafs: true

hierarchy: image: tf-esco/hierarchy:1.2.3 links: - db:databasedispatcher: … links: - hierarchy:hierarchy

match "/hierarchy/*path" do Proxy.forward conn, path, "http://hierarchy/"end

[hierarchy-service]

Ember add-ons [hierarchy-service]

What we learned

What we learned- Extremely productive

- Code reuse

- Easy for juniors

- Customers like front-end

- Database performance is okayish

- Conscious playing with alternative solutions

About the future

Trigger microservices by changes insemantic model.

Example:

- Compute KPIs when a new dataset is added- Send email/tweet by writing it to the triplestore

Reactive programming

More performance- ember-fastboot:

Faster first page render

- mu-cache:Smart caching strategies in core microservices

- mu-cl-resources:Partial resource caching

More authorityDescribe authorization outside the microservices:

- Simplify mental model

- Help in sharing content

- Open gate to advancedapplications

search for Jonathan Langens if you want to know more

More interactivityPush cache updates to all visiting clients.

Almost no development time to create basic interactive applications

(eg: updating KPIs, chat applications, …)

More links

Lego Time Star Wars: https://www.flickr.com/photos/eurobricks-starwars/5223334274/in/photolist-8XyXiu-7BJ9Xp-c2btBw-davQBK- nAQJCC-9XVSZs-a3vVhy-vPZaHw-r6NB6c-4ajSXh-rX7ezA-BBhAWf-BiWDpc-rED79Q-rX7f8u-mtctqc-wtp245-fcNzVb-CgXNsA-D4Uxps-wKj5u9-rX7fVm- rUWnBU-uhC54v-rXeB4g-zVknPq-qxEqXx-8GSCNc-nzg79j-biFNa6-9fXjwV-biFMTa-a1kbsX-5HnKDa-dQCdnW-a54g8X-bm9TRN-8zJUzU-fbGRan-sdr4hw- e9DMFz-q3qQqf-aAZwyV- bm9Tsw-dQCdpb-sdpUWU-rkow4K-wazJmK-bz4Md8-pyU2QM Wendelstein 7X: http://www.sciencemag.org/news/2015/10/ bizarre-reactor-might-save- nuclear-fusion 300SL: https://www.flickr.com/photos/smfan/7181631212/in/photolist-bWBJKN-o52kEN- 5pCCRH-6NezBh-oF2nYm-gHtRrE-6KAHDv-cPKKj9-2aj2ur-s3A8ua-5pH14j-bQk48B-omejVV-q2tAx7-o8yCtS-nRauVz-5pCNWB-o525H4-o9dqig-sk2we8- o4EApo-N2NDc-o7jxQM-5pCG4c-81DnQh-exNBvp-kc9m4-exS223-cm2nm5-aPXHgc-7Tg5XD-6HQ5Q9-6w1JtR-5pCGWi-eb6dJe-pJYFdi-azFSaU-p5y4mb- 6GjCy2-q2kGp6-o52baX-9XtXDc-4GqX86-pJXbk1-8canak-q2tu1j-6HQ6eo-sjZQkD-dhaPyf-bBqucA http://www.quickmeme.com/meme/3stqet Big Data Europe: https://www.big-data-europe.eu/ Docker Logo: http://www.silicon.de/41608942/microsoft-optimiert-windows-server-2016-fuer-die- cloud/ webCAT: https://github.com/tenforce/webcat Banksy Van: http://artcentron.com/2016/06/22/banksy-graffiti-art-swat-van-sale/ #prettyPhoto Banksy Bananas: https://www.touchofmodern.com/sales/banksy-8a9ea26d-040f-4435-ada1-86e7a6b4a05c/pulp-fiction-bananas Your Data Stories platoform: http://platform.yourdatastories.eu/ Star Wars Clones box: https://www.flickr.com/photos/kalexanderson/ 5410769283/in/photolist-9f8Bcz-5SJTDj-55MnH2-4WEfzr-in3p6t-drf7fp-3b46gb-bKfRW4-3aYzBt-4xztdx-35E11y-9jVQVR-9wuv3f-9r3mWe-9hNTVz- 7JzMxg-7JYZFM-Hw1QSq-8FW8eh-nVj9Sc-8ytJvH-aPPKYz-dYyYWK-7fhBFE-7GgZYm-e5M9jV-bwm6S9-7fhyGd-e5SNkL-5LDPWB-e5SNdf-4MKWht-e5SLrb- 5zPWDw-74Yjyb-8xh5Vr-9Apdwp-4XUn5j-jSHfRS-9fAZ86-eueiqp-e5SPwu-e5MbcZ-9tJQdd- 5f4rJT-9HsoqF-9hud4U-e5MaQX-52mMrQ-e5M9WX/ GitHub Logo: https://blog.adafruit.com/2012/12/31/github-has-big-dreams-for- open-source-software-and-more/ Twitter Logo: https://en.wikipedia.org/wiki/File:Twitter_bird_logo_2012.svg mu-ruby-template: https://github.com/mu-semtech/mu-ruby-template mu-cl-resources: https://github.com/mu-semtech/mu-cl-resources mu-project: https://github.com/mu-semtech/mu-project

Resources used & interesting links

More questionsright now, or ask later