SlideShare a Scribd company logo
1 of 47
Download to read offline
GUILLOTINA
An Async REST Resource DB to manage millions of objects
CoFounder/CTO Onna - SF/BCN
Connect and search all knowledge

inside an enterprise with ML
Ramon Navarro Bosch
Plone Software Foundation & FWT Member
Web Framework Engineer 😱 !!
BACKGROUND
“Organizing data is where we spend more time and its boring.”
Data Scientist Sysadmin / Engineers
Tables / CSV Docs / Unstructured data
NOSQLSQL
WEB FRAMEWORKS
• Angular/React : Server rendering frameworks are
dead
• Most sources of data comes from the web/api
• Lots of experience on storing, distributing,
managing resources
Web Framework

Communities
Data Scientist

Communities
Connect live data web framework with data scientist framework
Long time ago … 18 years … Zope and ZODB was created
object oriented DB and web application server
Then 16 years ago … Plone was created
layer on top of Z stack to provide CMS
Then 7 years ago … Pyramid was created
merge pylons + repoze.bfg (zope fork)
Then 2 years ago … Plone REST API was created
Abstraction layer for creating resources on top of Plone 5
300 python packages
Then 1 years ago … plone.server was created
Rewrite from scratch of minimum Plone backend with py 3.6 and asyncio
TRANSACTION
All operations are managed to
be durable and confirmed,
conflict resolution policies
TREE
Information is

organized in

trees of objects
RESOURCES
Objects are resources with
schema attributes, annotations,
OO inheritance and static/
dynamic behaviors.
RESOURCE
SCHEMA
JSON/
PYTHON
Direct mapping of JSON
schemas and python schemas
SECURITY
Full definition of permissions /
roles / principals with global
and local inheritance of
permissions on the tree.Allow,
Deny, Unset,AllowSingle (no
inheritance)
CRUD
DynamicTraversal CRUD
HTTP verbs mapping for each
content type
Custom endpoints for specific
operations
GET
HEAD
POST
PUTPATCH
ASYNCIO
All based on asyncio for
network integrations with
external indexers, db, services
Based aioHTTP
CORS
Cors configured globally and
enabled by default
WEBSOCKET
Websocket connection to
apply operations throw
frames. Mapping of REST API
on aTCP async channel.
TUS
Binary resumable file upload
EVENT
Event based system to trigger
operations in code
REGISTRY
Configuration registry x main
container
QUEUE
Operational queue and after
response tasks
MULTI DB
Mount multiple DBs and
partition objects pickles based
onTree position
POSTGRESQL
COCKROACH
FILE CLOUD
Support for S3/GCloud
storage.
***local distributed FS
soon***
INDEX
Elasticsearch indexing
DIST CACHE
Redis backend
SWAGGER
Automatic API documentation
generation
CONTAINERS
Docker / K8s / Nomad out
the box
EXPLICIT PY
All configuration is defined on
the code using decorators
@configure.service()
guillotina(x) = argmin Zope/Plone(x)
* zope.interface still used
Traversal
/DB/MAIN_CONTAINER/OBJ1/OBJ2
• Only >= Python 3.5
• Designed to host millions of objects
• Memory optimizations
• Apply operations to contained objects in async
• Authentication & authorization extensions (oauth2
flow supported)
• Reusable UI JS components from Plone (Widgets/
SPA)
TRY IT !
{
"databases": [{
"db": {
"storage": "postgresql",
"transaction_strategy": "resolve",
"dsn": {
"scheme": "postgres",
"dbname": "guillotina",
"user": "postgres",
"host": "localhost",
"password": "",
"port": 5432
},
"pool_size": 40,
"read_only": false
}
}],
"host": "127.0.0.1",
"port": 8080,
"static": [
{"favicon.ico": "static/favicon.ico"}
],
"root_user": {
"password": "root"
},
"cors": {
"allow_origin": ["*"],
"allow_methods": ["GET", "POST", "DELETE", "HEAD", "PATCH"],
"allow_headers": ["*"],
"expose_headers": ["*"],
"allow_credentials": true,
"max_age": 3660
},
"utilities": []
}
docker run -p 5432:5432 -d postgres
psql -h localhost -U postgres << EOF
CREATE DATABASE guillotina;
EOF
pip install guillotina
guillotina -c config.json
curl -X GET http://localhost:8080
curl -u root:root http://localhost:8080
curl -X POST -u root:root -H "Content-Type: application/json" 
-d '{"@type":"Container","id":"mycontainer","title":"My Lovely Container"}' 
http://localhost:8080/db/ | jq .
curl -X POST -u root:root -H "Content-Type: application/json" 
-d '{"@type":"Folder","id":"myfolder"}' http://localhost:8080/db/mycontainer | jq .
curl -X POST -u root:root -H "Content-Type: application/json" 
-d '{"@type":"Folder"}' http://localhost:8080/db/mycontainer | jq .
curl -X POST -u root:root -H "Content-Type: application/json" 
-d '{"@type":"Item","id":"myitem"}' http://localhost:8080/db/mycontainer/myfolder | jq .
curl -X PATCH -u root:root -H "Content-Type: application/json" 
-d '{"title": "My new title"}' http://localhost:8080/db/mycontainer/myfolder/myitem | jq .
curl -X GET -u root:root -H "Content-Type: application/json" 
-d '{"title": "My new title"}' http://localhost:8080/db/mycontainer/myfolder/myitem | jq .
curl -X DELETE -u root:root -H "Content-Type: application/json" 
http://localhost:8080/db/mycontainer | jq .
DATA MODEL
Resource &
Container
Interface
Schema fields
Static
Behaviors
Dynamic
Behaviors
from guillotina import configure
from guillotina.content import Item
from guillotina.interfaces import IItem
from guillotina import schema
class ICustomType(IItem):
foo = schema.Text()
@configure.contenttype(
type_name="CustomType",
schema=ICustomType,
behaviors=[
"guillotina.behaviors.dublincore.IDublinCore",
"example.behaviors.ICustomBehavior",
])
class CustomType(Item):
pass
@configure.subscriber(for_=(ICustomType, IObjectAddedEvent))
async def created_userfolder(obj, evnt):
...
@configure.service(
context=ICustomType, name='@myEndpoint', method='GET',
permission='guillotina.AccessContent')
class MyEndpoint(Service):
async def __call__(self):
...
WIP
WIP : DISTRIBUTED HIVE
Execute an operation to all objects in distributed execution
Based on etcd
Dynamic workers that are going to compute a task
No aggregation callback
Batch mass modification of the model
guillotina_hive
(thanks @vangheezy)
from guillotina.traversal import traverse
async def my_task(task_info, root, request):
data = task_info.data
path = data['path']
ob, end_path = await traverse(request, root, path.lstrip('/').split('/'))
assert len(end_path) == 0
from guillotina.component import getUtility
from guillotina_hive.interfaces import IHiveUtility
hive = getUtility(IHiveUtility)
task_info = TaskInfo('my_task', {'foo': 'bar'})
await hive.push_task(task_info)
WIP : INFERENCE
Right now using tf serving
Storing models as resources on the api
TF loader adapter to get the model with cache
Manages tf serving service provisioning on k8s
guillotina_tf
URI_RESOURCE/@applyModel?model=URI_MODEL
Use event system on create/update apply model
WIP : DISTRIBUTEDTRAINING
Right now using tf distributed
Storing models as resources on the api
Start workers and parameters servers with k8s
Offer the tf operation to add guillotina REST API as source
Reinforcement learning support
ML architecture definition on guillotina with RestrictedPython
guillotina_tflearn
send_to_learn(FEED,ARCHITECTURE, MODEL_URL)
Websocket feedback
“Why gRPC has no asyncio support?”
“Made in Barcelona, looking for contributions”
l
October 16 22 2017
Come to the Digital Experience Conference
2017.ploneconf.org
PREGUNTES ?
GRÀCIES !
ramon@plone.org
CORE : https://github.com/plone/guillotina
DOCS : http://guillotina.readthedocs.io/en/latest/
PYPI : https://pypi.python.org/pypi/guillotina
MODULES : https://github.com/guillotinaweb

More Related Content

What's hot

The magic behind your Lyft ride prices: A case study on machine learning and ...
The magic behind your Lyft ride prices: A case study on machine learning and ...The magic behind your Lyft ride prices: A case study on machine learning and ...
The magic behind your Lyft ride prices: A case study on machine learning and ...Karthik Murugesan
 
Kafka Streams - From the Ground Up to the Cloud
Kafka Streams - From the Ground Up to the CloudKafka Streams - From the Ground Up to the Cloud
Kafka Streams - From the Ground Up to the CloudVMware Tanzu
 
Apache Kafka as Message Queue for your microservices and other occasions
Apache Kafka as Message Queue for your microservices and other occasionsApache Kafka as Message Queue for your microservices and other occasions
Apache Kafka as Message Queue for your microservices and other occasionsMichael Reinsch
 
Kafka and Kafka Streams in the Global Schibsted Data Platform
Kafka and Kafka Streams in the Global Schibsted Data PlatformKafka and Kafka Streams in the Global Schibsted Data Platform
Kafka and Kafka Streams in the Global Schibsted Data PlatformFredrik Vraalsen
 
2020 07-30 elastic agent + ingest management
2020 07-30 elastic agent + ingest management2020 07-30 elastic agent + ingest management
2020 07-30 elastic agent + ingest managementDaliya Spasova
 
The Past, Present, and Future of Apache Flink®
The Past, Present, and Future of Apache Flink®The Past, Present, and Future of Apache Flink®
The Past, Present, and Future of Apache Flink®Aljoscha Krettek
 
Kafka Summit NYC 2017 - Every Message Counts: Kafka as a Foundation for Highl...
Kafka Summit NYC 2017 - Every Message Counts: Kafka as a Foundation for Highl...Kafka Summit NYC 2017 - Every Message Counts: Kafka as a Foundation for Highl...
Kafka Summit NYC 2017 - Every Message Counts: Kafka as a Foundation for Highl...confluent
 
Distributed Kafka Architecture Taboola Scale
Distributed Kafka Architecture Taboola ScaleDistributed Kafka Architecture Taboola Scale
Distributed Kafka Architecture Taboola ScaleApache Kafka TLV
 
A Walkthrough of InfluxCloud 2.0 by Tim Hall
A Walkthrough of InfluxCloud 2.0 by Tim HallA Walkthrough of InfluxCloud 2.0 by Tim Hall
A Walkthrough of InfluxCloud 2.0 by Tim HallInfluxData
 
Experience with C++11 in ArangoDB
Experience with C++11 in ArangoDBExperience with C++11 in ArangoDB
Experience with C++11 in ArangoDBMax Neunhöffer
 
James Turner (Caplin) - Enterprise HTML5 Patterns
James Turner (Caplin) - Enterprise HTML5 PatternsJames Turner (Caplin) - Enterprise HTML5 Patterns
James Turner (Caplin) - Enterprise HTML5 Patternsakqaanoraks
 
Streaming your Lyft Ride Prices - Flink Forward SF 2019
Streaming your Lyft Ride Prices - Flink Forward SF 2019Streaming your Lyft Ride Prices - Flink Forward SF 2019
Streaming your Lyft Ride Prices - Flink Forward SF 2019Thomas Weise
 
Distributed Tracing with OpenTracing, ZipKin and Kubernetes
Distributed Tracing with OpenTracing, ZipKin and KubernetesDistributed Tracing with OpenTracing, ZipKin and Kubernetes
Distributed Tracing with OpenTracing, ZipKin and KubernetesContainer Solutions
 
Microservice-based software architecture
Microservice-based software architectureMicroservice-based software architecture
Microservice-based software architectureArangoDB Database
 
The journey of Moving from AWS ELK to GCP Data Pipeline
The journey of Moving from AWS ELK to GCP Data PipelineThe journey of Moving from AWS ELK to GCP Data Pipeline
The journey of Moving from AWS ELK to GCP Data PipelineRandy Huang
 
Introducing Arc: A Common Intermediate Language for Unified Batch and Stream...
Introducing Arc:  A Common Intermediate Language for Unified Batch and Stream...Introducing Arc:  A Common Intermediate Language for Unified Batch and Stream...
Introducing Arc: A Common Intermediate Language for Unified Batch and Stream...Flink Forward
 
WebAPI::DBIC - Automated RESTful API's
WebAPI::DBIC - Automated RESTful API'sWebAPI::DBIC - Automated RESTful API's
WebAPI::DBIC - Automated RESTful API'sMichael Francis
 
Change Data Capture - Scale by the Bay 2019
Change Data Capture - Scale by the Bay 2019Change Data Capture - Scale by the Bay 2019
Change Data Capture - Scale by the Bay 2019Petr Zapletal
 
Flink September 2015 Community Update
Flink September 2015 Community UpdateFlink September 2015 Community Update
Flink September 2015 Community UpdateRobert Metzger
 

What's hot (20)

The magic behind your Lyft ride prices: A case study on machine learning and ...
The magic behind your Lyft ride prices: A case study on machine learning and ...The magic behind your Lyft ride prices: A case study on machine learning and ...
The magic behind your Lyft ride prices: A case study on machine learning and ...
 
Kafka Streams - From the Ground Up to the Cloud
Kafka Streams - From the Ground Up to the CloudKafka Streams - From the Ground Up to the Cloud
Kafka Streams - From the Ground Up to the Cloud
 
Apache Kafka as Message Queue for your microservices and other occasions
Apache Kafka as Message Queue for your microservices and other occasionsApache Kafka as Message Queue for your microservices and other occasions
Apache Kafka as Message Queue for your microservices and other occasions
 
Kafka and Kafka Streams in the Global Schibsted Data Platform
Kafka and Kafka Streams in the Global Schibsted Data PlatformKafka and Kafka Streams in the Global Schibsted Data Platform
Kafka and Kafka Streams in the Global Schibsted Data Platform
 
2020 07-30 elastic agent + ingest management
2020 07-30 elastic agent + ingest management2020 07-30 elastic agent + ingest management
2020 07-30 elastic agent + ingest management
 
The Past, Present, and Future of Apache Flink®
The Past, Present, and Future of Apache Flink®The Past, Present, and Future of Apache Flink®
The Past, Present, and Future of Apache Flink®
 
Kafka Summit NYC 2017 - Every Message Counts: Kafka as a Foundation for Highl...
Kafka Summit NYC 2017 - Every Message Counts: Kafka as a Foundation for Highl...Kafka Summit NYC 2017 - Every Message Counts: Kafka as a Foundation for Highl...
Kafka Summit NYC 2017 - Every Message Counts: Kafka as a Foundation for Highl...
 
Distributed Kafka Architecture Taboola Scale
Distributed Kafka Architecture Taboola ScaleDistributed Kafka Architecture Taboola Scale
Distributed Kafka Architecture Taboola Scale
 
A Walkthrough of InfluxCloud 2.0 by Tim Hall
A Walkthrough of InfluxCloud 2.0 by Tim HallA Walkthrough of InfluxCloud 2.0 by Tim Hall
A Walkthrough of InfluxCloud 2.0 by Tim Hall
 
Experience with C++11 in ArangoDB
Experience with C++11 in ArangoDBExperience with C++11 in ArangoDB
Experience with C++11 in ArangoDB
 
James Turner (Caplin) - Enterprise HTML5 Patterns
James Turner (Caplin) - Enterprise HTML5 PatternsJames Turner (Caplin) - Enterprise HTML5 Patterns
James Turner (Caplin) - Enterprise HTML5 Patterns
 
Streaming your Lyft Ride Prices - Flink Forward SF 2019
Streaming your Lyft Ride Prices - Flink Forward SF 2019Streaming your Lyft Ride Prices - Flink Forward SF 2019
Streaming your Lyft Ride Prices - Flink Forward SF 2019
 
Distributed Tracing with OpenTracing, ZipKin and Kubernetes
Distributed Tracing with OpenTracing, ZipKin and KubernetesDistributed Tracing with OpenTracing, ZipKin and Kubernetes
Distributed Tracing with OpenTracing, ZipKin and Kubernetes
 
Microservice-based software architecture
Microservice-based software architectureMicroservice-based software architecture
Microservice-based software architecture
 
The journey of Moving from AWS ELK to GCP Data Pipeline
The journey of Moving from AWS ELK to GCP Data PipelineThe journey of Moving from AWS ELK to GCP Data Pipeline
The journey of Moving from AWS ELK to GCP Data Pipeline
 
Introducing Arc: A Common Intermediate Language for Unified Batch and Stream...
Introducing Arc:  A Common Intermediate Language for Unified Batch and Stream...Introducing Arc:  A Common Intermediate Language for Unified Batch and Stream...
Introducing Arc: A Common Intermediate Language for Unified Batch and Stream...
 
WebAPI::DBIC - Automated RESTful API's
WebAPI::DBIC - Automated RESTful API'sWebAPI::DBIC - Automated RESTful API's
WebAPI::DBIC - Automated RESTful API's
 
Change Data Capture - Scale by the Bay 2019
Change Data Capture - Scale by the Bay 2019Change Data Capture - Scale by the Bay 2019
Change Data Capture - Scale by the Bay 2019
 
Asp.Net MVC
Asp.Net MVCAsp.Net MVC
Asp.Net MVC
 
Flink September 2015 Community Update
Flink September 2015 Community UpdateFlink September 2015 Community Update
Flink September 2015 Community Update
 

Similar to Guillotina

Guillotina: The Asyncio REST Resource API
Guillotina: The Asyncio REST Resource APIGuillotina: The Asyncio REST Resource API
Guillotina: The Asyncio REST Resource APINathan Van Gheem
 
OrientDB introduction - NoSQL
OrientDB introduction - NoSQLOrientDB introduction - NoSQL
OrientDB introduction - NoSQLLuca Garulli
 
Terrastore - A document database for developers
Terrastore - A document database for developersTerrastore - A document database for developers
Terrastore - A document database for developersSergio Bossa
 
Developing your first application using FIWARE
Developing your first application using FIWAREDeveloping your first application using FIWARE
Developing your first application using FIWAREFIWARE
 
Just one-shade-of-openstack
Just one-shade-of-openstackJust one-shade-of-openstack
Just one-shade-of-openstackRoberto Polli
 
Saving Time And Effort With QuickBase Api - Sergio Haro
Saving Time And Effort With QuickBase Api - Sergio HaroSaving Time And Effort With QuickBase Api - Sergio Haro
Saving Time And Effort With QuickBase Api - Sergio HaroQuickBase, Inc.
 
비동기 회고 발표자료
비동기 회고 발표자료비동기 회고 발표자료
비동기 회고 발표자료Benjamin Kim
 
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...SPTechCon
 
Icinga 2009 at OSMC
Icinga 2009 at OSMCIcinga 2009 at OSMC
Icinga 2009 at OSMCIcinga
 
Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2Hugo Hamon
 
Berlin Buzz Words - Apache Drill by Ted Dunning & Michael Hausenblas
Berlin Buzz Words - Apache Drill by Ted Dunning & Michael HausenblasBerlin Buzz Words - Apache Drill by Ted Dunning & Michael Hausenblas
Berlin Buzz Words - Apache Drill by Ted Dunning & Michael HausenblasMapR Technologies
 
High quality ap is with api platform
High quality ap is with api platformHigh quality ap is with api platform
High quality ap is with api platformNelson Kopliku
 
Big Data LDN 2017: Look Ma, No Code! Building Streaming Data Pipelines With A...
Big Data LDN 2017: Look Ma, No Code! Building Streaming Data Pipelines With A...Big Data LDN 2017: Look Ma, No Code! Building Streaming Data Pipelines With A...
Big Data LDN 2017: Look Ma, No Code! Building Streaming Data Pipelines With A...Matt Stubbs
 
iguazio - nuclio overview to CNCF (Sep 25th 2017)
iguazio - nuclio overview to CNCF (Sep 25th 2017)iguazio - nuclio overview to CNCF (Sep 25th 2017)
iguazio - nuclio overview to CNCF (Sep 25th 2017)Eran Duchan
 
nuclio Overview October 2017
nuclio Overview October 2017nuclio Overview October 2017
nuclio Overview October 2017iguazio
 
OSMC 2009 | Icinga by Icinga Team
OSMC 2009 | Icinga by Icinga TeamOSMC 2009 | Icinga by Icinga Team
OSMC 2009 | Icinga by Icinga TeamNETWAYS
 
HTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & socketsHTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & socketsRemy Sharp
 
Hammock, a Good Place to Rest
Hammock, a Good Place to RestHammock, a Good Place to Rest
Hammock, a Good Place to RestStratoscale
 

Similar to Guillotina (20)

Guillotina: The Asyncio REST Resource API
Guillotina: The Asyncio REST Resource APIGuillotina: The Asyncio REST Resource API
Guillotina: The Asyncio REST Resource API
 
OrientDB introduction - NoSQL
OrientDB introduction - NoSQLOrientDB introduction - NoSQL
OrientDB introduction - NoSQL
 
Terrastore - A document database for developers
Terrastore - A document database for developersTerrastore - A document database for developers
Terrastore - A document database for developers
 
Developing your first application using FIWARE
Developing your first application using FIWAREDeveloping your first application using FIWARE
Developing your first application using FIWARE
 
Just one-shade-of-openstack
Just one-shade-of-openstackJust one-shade-of-openstack
Just one-shade-of-openstack
 
Saving Time And Effort With QuickBase Api - Sergio Haro
Saving Time And Effort With QuickBase Api - Sergio HaroSaving Time And Effort With QuickBase Api - Sergio Haro
Saving Time And Effort With QuickBase Api - Sergio Haro
 
비동기 회고 발표자료
비동기 회고 발표자료비동기 회고 발표자료
비동기 회고 발표자료
 
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
 
Icinga 2009 at OSMC
Icinga 2009 at OSMCIcinga 2009 at OSMC
Icinga 2009 at OSMC
 
Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2
 
Arquitecturas de microservicios - Medianet Software
Arquitecturas de microservicios   -  Medianet SoftwareArquitecturas de microservicios   -  Medianet Software
Arquitecturas de microservicios - Medianet Software
 
REST easy with API Platform
REST easy with API PlatformREST easy with API Platform
REST easy with API Platform
 
Berlin Buzz Words - Apache Drill by Ted Dunning & Michael Hausenblas
Berlin Buzz Words - Apache Drill by Ted Dunning & Michael HausenblasBerlin Buzz Words - Apache Drill by Ted Dunning & Michael Hausenblas
Berlin Buzz Words - Apache Drill by Ted Dunning & Michael Hausenblas
 
High quality ap is with api platform
High quality ap is with api platformHigh quality ap is with api platform
High quality ap is with api platform
 
Big Data LDN 2017: Look Ma, No Code! Building Streaming Data Pipelines With A...
Big Data LDN 2017: Look Ma, No Code! Building Streaming Data Pipelines With A...Big Data LDN 2017: Look Ma, No Code! Building Streaming Data Pipelines With A...
Big Data LDN 2017: Look Ma, No Code! Building Streaming Data Pipelines With A...
 
iguazio - nuclio overview to CNCF (Sep 25th 2017)
iguazio - nuclio overview to CNCF (Sep 25th 2017)iguazio - nuclio overview to CNCF (Sep 25th 2017)
iguazio - nuclio overview to CNCF (Sep 25th 2017)
 
nuclio Overview October 2017
nuclio Overview October 2017nuclio Overview October 2017
nuclio Overview October 2017
 
OSMC 2009 | Icinga by Icinga Team
OSMC 2009 | Icinga by Icinga TeamOSMC 2009 | Icinga by Icinga Team
OSMC 2009 | Icinga by Icinga Team
 
HTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & socketsHTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & sockets
 
Hammock, a Good Place to Rest
Hammock, a Good Place to RestHammock, a Good Place to Rest
Hammock, a Good Place to Rest
 

More from Ramon Navarro

How containers helped a SaaS startup be developed and go live
How containers helped a SaaS startup be developed and go liveHow containers helped a SaaS startup be developed and go live
How containers helped a SaaS startup be developed and go liveRamon Navarro
 
Plone 5 and machine learning
Plone 5 and machine learningPlone 5 and machine learning
Plone 5 and machine learningRamon Navarro
 
CI on large open source software : Plone & Plone 5 is here!
CI on large open source software : Plone & Plone 5 is here!CI on large open source software : Plone & Plone 5 is here!
CI on large open source software : Plone & Plone 5 is here!Ramon Navarro
 
Resource registries plone conf 2014
Resource registries plone conf 2014Resource registries plone conf 2014
Resource registries plone conf 2014Ramon Navarro
 
Multilingual sites in plone
Multilingual sites in ploneMultilingual sites in plone
Multilingual sites in ploneRamon Navarro
 
Presentacio meetup Python BCN
Presentacio meetup Python BCNPresentacio meetup Python BCN
Presentacio meetup Python BCNRamon Navarro
 
plone.app.multilingual
plone.app.multilingual plone.app.multilingual
plone.app.multilingual Ramon Navarro
 
WPD Barcelona 2008 Què és Plone ?
WPD Barcelona 2008 Què és Plone ?WPD Barcelona 2008 Què és Plone ?
WPD Barcelona 2008 Què és Plone ?Ramon Navarro
 

More from Ramon Navarro (11)

Plone server
Plone serverPlone server
Plone server
 
How containers helped a SaaS startup be developed and go live
How containers helped a SaaS startup be developed and go liveHow containers helped a SaaS startup be developed and go live
How containers helped a SaaS startup be developed and go live
 
Plone 5 and machine learning
Plone 5 and machine learningPlone 5 and machine learning
Plone 5 and machine learning
 
CI on large open source software : Plone & Plone 5 is here!
CI on large open source software : Plone & Plone 5 is here!CI on large open source software : Plone & Plone 5 is here!
CI on large open source software : Plone & Plone 5 is here!
 
Resource registries plone conf 2014
Resource registries plone conf 2014Resource registries plone conf 2014
Resource registries plone conf 2014
 
Pyramid
PyramidPyramid
Pyramid
 
Multilingual sites in plone
Multilingual sites in ploneMultilingual sites in plone
Multilingual sites in plone
 
Cafè amb web
Cafè amb webCafè amb web
Cafè amb web
 
Presentacio meetup Python BCN
Presentacio meetup Python BCNPresentacio meetup Python BCN
Presentacio meetup Python BCN
 
plone.app.multilingual
plone.app.multilingual plone.app.multilingual
plone.app.multilingual
 
WPD Barcelona 2008 Què és Plone ?
WPD Barcelona 2008 Què és Plone ?WPD Barcelona 2008 Què és Plone ?
WPD Barcelona 2008 Què és Plone ?
 

Recently uploaded

Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncssuser2ae721
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catcherssdickerson1
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptMadan Karki
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating SystemRashmi Bhat
 
Research Methodology for Engineering pdf
Research Methodology for Engineering pdfResearch Methodology for Engineering pdf
Research Methodology for Engineering pdfCaalaaAbdulkerim
 
Transport layer issues and challenges - Guide
Transport layer issues and challenges - GuideTransport layer issues and challenges - Guide
Transport layer issues and challenges - GuideGOPINATHS437943
 
Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating SystemRashmi Bhat
 
welding defects observed during the welding
welding defects observed during the weldingwelding defects observed during the welding
welding defects observed during the weldingMuhammadUzairLiaqat
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
home automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasadhome automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasadaditya806802
 

Recently uploaded (20)

Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.ppt
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating System
 
Research Methodology for Engineering pdf
Research Methodology for Engineering pdfResearch Methodology for Engineering pdf
Research Methodology for Engineering pdf
 
Transport layer issues and challenges - Guide
Transport layer issues and challenges - GuideTransport layer issues and challenges - Guide
Transport layer issues and challenges - Guide
 
Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating System
 
welding defects observed during the welding
welding defects observed during the weldingwelding defects observed during the welding
welding defects observed during the welding
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
home automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasadhome automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasad
 

Guillotina

  • 1. GUILLOTINA An Async REST Resource DB to manage millions of objects
  • 2. CoFounder/CTO Onna - SF/BCN Connect and search all knowledge
 inside an enterprise with ML Ramon Navarro Bosch Plone Software Foundation & FWT Member Web Framework Engineer 😱 !!
  • 4. “Organizing data is where we spend more time and its boring.” Data Scientist Sysadmin / Engineers
  • 5. Tables / CSV Docs / Unstructured data NOSQLSQL
  • 6. WEB FRAMEWORKS • Angular/React : Server rendering frameworks are dead • Most sources of data comes from the web/api • Lots of experience on storing, distributing, managing resources
  • 7. Web Framework
 Communities Data Scientist
 Communities Connect live data web framework with data scientist framework
  • 8. Long time ago … 18 years … Zope and ZODB was created object oriented DB and web application server Then 16 years ago … Plone was created layer on top of Z stack to provide CMS Then 7 years ago … Pyramid was created merge pylons + repoze.bfg (zope fork) Then 2 years ago … Plone REST API was created Abstraction layer for creating resources on top of Plone 5 300 python packages Then 1 years ago … plone.server was created Rewrite from scratch of minimum Plone backend with py 3.6 and asyncio
  • 9.
  • 10. TRANSACTION All operations are managed to be durable and confirmed, conflict resolution policies
  • 12. RESOURCES Objects are resources with schema attributes, annotations, OO inheritance and static/ dynamic behaviors. RESOURCE
  • 13. SCHEMA JSON/ PYTHON Direct mapping of JSON schemas and python schemas
  • 14. SECURITY Full definition of permissions / roles / principals with global and local inheritance of permissions on the tree.Allow, Deny, Unset,AllowSingle (no inheritance)
  • 15. CRUD DynamicTraversal CRUD HTTP verbs mapping for each content type Custom endpoints for specific operations GET HEAD POST PUTPATCH
  • 16. ASYNCIO All based on asyncio for network integrations with external indexers, db, services Based aioHTTP
  • 17. CORS Cors configured globally and enabled by default
  • 18. WEBSOCKET Websocket connection to apply operations throw frames. Mapping of REST API on aTCP async channel.
  • 20. EVENT Event based system to trigger operations in code
  • 22. QUEUE Operational queue and after response tasks
  • 23. MULTI DB Mount multiple DBs and partition objects pickles based onTree position POSTGRESQL COCKROACH
  • 24. FILE CLOUD Support for S3/GCloud storage. ***local distributed FS soon***
  • 28. CONTAINERS Docker / K8s / Nomad out the box
  • 29. EXPLICIT PY All configuration is defined on the code using decorators @configure.service()
  • 30. guillotina(x) = argmin Zope/Plone(x) * zope.interface still used
  • 32. • Only >= Python 3.5 • Designed to host millions of objects • Memory optimizations • Apply operations to contained objects in async • Authentication & authorization extensions (oauth2 flow supported) • Reusable UI JS components from Plone (Widgets/ SPA)
  • 34. { "databases": [{ "db": { "storage": "postgresql", "transaction_strategy": "resolve", "dsn": { "scheme": "postgres", "dbname": "guillotina", "user": "postgres", "host": "localhost", "password": "", "port": 5432 }, "pool_size": 40, "read_only": false } }], "host": "127.0.0.1", "port": 8080, "static": [ {"favicon.ico": "static/favicon.ico"} ], "root_user": { "password": "root" }, "cors": { "allow_origin": ["*"], "allow_methods": ["GET", "POST", "DELETE", "HEAD", "PATCH"], "allow_headers": ["*"], "expose_headers": ["*"], "allow_credentials": true, "max_age": 3660 }, "utilities": [] }
  • 35. docker run -p 5432:5432 -d postgres psql -h localhost -U postgres << EOF CREATE DATABASE guillotina; EOF pip install guillotina guillotina -c config.json curl -X GET http://localhost:8080 curl -u root:root http://localhost:8080 curl -X POST -u root:root -H "Content-Type: application/json" -d '{"@type":"Container","id":"mycontainer","title":"My Lovely Container"}' http://localhost:8080/db/ | jq . curl -X POST -u root:root -H "Content-Type: application/json" -d '{"@type":"Folder","id":"myfolder"}' http://localhost:8080/db/mycontainer | jq . curl -X POST -u root:root -H "Content-Type: application/json" -d '{"@type":"Folder"}' http://localhost:8080/db/mycontainer | jq . curl -X POST -u root:root -H "Content-Type: application/json" -d '{"@type":"Item","id":"myitem"}' http://localhost:8080/db/mycontainer/myfolder | jq . curl -X PATCH -u root:root -H "Content-Type: application/json" -d '{"title": "My new title"}' http://localhost:8080/db/mycontainer/myfolder/myitem | jq . curl -X GET -u root:root -H "Content-Type: application/json" -d '{"title": "My new title"}' http://localhost:8080/db/mycontainer/myfolder/myitem | jq . curl -X DELETE -u root:root -H "Content-Type: application/json" http://localhost:8080/db/mycontainer | jq .
  • 36. DATA MODEL Resource & Container Interface Schema fields Static Behaviors Dynamic Behaviors
  • 37. from guillotina import configure from guillotina.content import Item from guillotina.interfaces import IItem from guillotina import schema class ICustomType(IItem): foo = schema.Text() @configure.contenttype( type_name="CustomType", schema=ICustomType, behaviors=[ "guillotina.behaviors.dublincore.IDublinCore", "example.behaviors.ICustomBehavior", ]) class CustomType(Item): pass
  • 38. @configure.subscriber(for_=(ICustomType, IObjectAddedEvent)) async def created_userfolder(obj, evnt): ... @configure.service( context=ICustomType, name='@myEndpoint', method='GET', permission='guillotina.AccessContent') class MyEndpoint(Service): async def __call__(self): ...
  • 39. WIP
  • 40. WIP : DISTRIBUTED HIVE Execute an operation to all objects in distributed execution Based on etcd Dynamic workers that are going to compute a task No aggregation callback Batch mass modification of the model guillotina_hive (thanks @vangheezy)
  • 41. from guillotina.traversal import traverse async def my_task(task_info, root, request): data = task_info.data path = data['path'] ob, end_path = await traverse(request, root, path.lstrip('/').split('/')) assert len(end_path) == 0 from guillotina.component import getUtility from guillotina_hive.interfaces import IHiveUtility hive = getUtility(IHiveUtility) task_info = TaskInfo('my_task', {'foo': 'bar'}) await hive.push_task(task_info)
  • 42. WIP : INFERENCE Right now using tf serving Storing models as resources on the api TF loader adapter to get the model with cache Manages tf serving service provisioning on k8s guillotina_tf URI_RESOURCE/@applyModel?model=URI_MODEL Use event system on create/update apply model
  • 43. WIP : DISTRIBUTEDTRAINING Right now using tf distributed Storing models as resources on the api Start workers and parameters servers with k8s Offer the tf operation to add guillotina REST API as source Reinforcement learning support ML architecture definition on guillotina with RestrictedPython guillotina_tflearn send_to_learn(FEED,ARCHITECTURE, MODEL_URL) Websocket feedback
  • 44. “Why gRPC has no asyncio support?”
  • 45. “Made in Barcelona, looking for contributions”
  • 46. l October 16 22 2017 Come to the Digital Experience Conference 2017.ploneconf.org
  • 47. PREGUNTES ? GRÀCIES ! ramon@plone.org CORE : https://github.com/plone/guillotina DOCS : http://guillotina.readthedocs.io/en/latest/ PYPI : https://pypi.python.org/pypi/guillotina MODULES : https://github.com/guillotinaweb