SlideShare a Scribd company logo
GUILLOTINA
Async REST Resource API to manage millions of objects
Full Stack Engineer Onna - BCN
Connect and search all knowledge

inside an enterprise with ML
Nathan Van Gheem
Plone Software Foundation,

FWT Member, 

UITEAM,

SecurityTeam
CoFounder/CTO Onna - SF/BCN
Connect and search all knowledge

inside an enterprise with ML
Ramon Navarro Bosch
Plone Software Foundation & FWT Member
BACKGROUND
WEB FRAMEWORKS
• Angular/React : Server rendering frameworks are
dying
• Most sources of data comes from the web/api
• Lots of experience on storing, distributing,
managing resources
LOVE
We love Plone but wanted to
be able to use it in high
performant situations with
modern web technologies
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
Guillotina: The Asyncio REST Resource API
EVOLUTION
The spirit of Plone lives
LESSONS
Taking lessons learned from
Plone, simplify and apply to an
AsyncIO context
INSPIRATION
Plone/Zope’s hierarchical data model
Pyramid’s decorator-based configuration
Django’s global application settings
ZCA pluggability
Plone/Zope’s security model
JSON Schema
FORKS
parts of zodb data model
plone.behavior
zope.security
zope.schema
zope.component/zope.configuration
zope.dublincore
zope.i18n
zope.lifecycleevent
zope.location
zope.event
WHAT IT IS
NOT
replacement for Plone
re-implementation of Plone
plone.restapi compatible API
guillotina_cms
FEATURES
TRANSACTION
All operations are managed to
be durable and confirmed,
conflict resolution policies
CONSCIENTIOUS
WRITER
Reduce conflict errors, better
performance
RELATIONAL
DATABASES
Use the best database
systems available
PostgreSQL
CockroachDB
TREE
Information is

organized in

trees of objects
RESOURCES
Objects are resources with
schema attributes, annotations,
OO inheritance and static/
dynamic behaviors.
RESOURCE
JSON
SCHEMA/
PYTHON
Serialization of python
interfaces to JSON Schema
and back again
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, caching,
services
Based on aioHTTP
SIMPLE
Easy to install,
Easy to develop
pip install guillotina
docker run guillotina/guillotina
CORS
Cors configured globally and
enabled by default
WEBSOCKET
Websocket connection to
apply operations through
frames. Mapping of REST API
on aTCP async channel.
MICRO-
SERVICES
Perfect for micro services
TUS
Binary resumable file upload
APPLICATIONS
Easily extendable with python packages
guillotina_swagger
guillotina_elasticsearch
guillotina_rediscache
guillotina_s3storage
guillotina_gcloudstorage
guillotina_dbusers
guillotina_mailer
guillotina_pgcatalog
EXTENSIBLE
Uses zope.interface and based
on zope.component



utilities and adapters!Yay!
COOKIE
CUTTER
Cookie cutter templates for
configuration and applications
QUEUE
Operational queue and after
response tasks
EVENT
Async event based system to
trigger operations in code



Async tasks
REGISTRY
Configuration registry for
each container
STATIC FILES
AND JS APPS
Support for serving JavaScript
applications
MULTI DB
Mount multiple DBs

Supports:
POSTGRESQL
COCKROACH
FILE CLOUD
Support for S3/GCloud
storage.
Database blob storage
otherwise
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.6
• Designed to host millions of objects
• Memory optimizations
• Apply operations to contained objects in async
• Authentication & authorization extensions
• 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')
async def my_service(context, request):
...
DATA SCIENCE
“Organizing data is where we spend more time and its boring.”
Data Scientist Sysadmin / Engineers
Tables / CSV Docs / Unstructured data
NOSQLSQL
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)
Try it, create issues, contribute
Go to the “Introduction to AsyncIO” talk!
PREGUNTES ?
GRÀCIES !
vangheem@gmail.com
ramon@plone.org
CORE : https://github.com/plone/guillotina
DOCS : http://guillotina.readthedocs.io/en/latest/
DOCKER: https://hub.docker.com/r/guillotina/guillotina/
MODULES : https://github.com/guillotinaweb
ONNA: https://github.com/onna
Ad

More Related Content

What's hot (20)

Generating Visual Studio Code Extensions for Xtext DSLs
Generating Visual Studio Code Extensions for Xtext DSLsGenerating Visual Studio Code Extensions for Xtext DSLs
Generating Visual Studio Code Extensions for Xtext DSLs
Karsten Thoms
 
Concurrent Ruby Application Servers
Concurrent Ruby Application ServersConcurrent Ruby Application Servers
Concurrent Ruby Application Servers
Lin Jen-Shin
 
PyCon UK - iCE: Interactive cloud experimentation
PyCon UK - iCE: Interactive cloud experimentationPyCon UK - iCE: Interactive cloud experimentation
PyCon UK - iCE: Interactive cloud experimentation
George Lestaris
 
Docker
DockerDocker
Docker
Kamil Grabowski
 
Dockerizing Symfony Applications - Symfony Live Berlin 2014
Dockerizing Symfony Applications - Symfony Live Berlin 2014Dockerizing Symfony Applications - Symfony Live Berlin 2014
Dockerizing Symfony Applications - Symfony Live Berlin 2014
D
 
Building GUI App with Electron and Lisp
Building GUI App with Electron and LispBuilding GUI App with Electron and Lisp
Building GUI App with Electron and Lisp
fukamachi
 
Puppet Camp Paris 2015: Continuous Integration of Puppet Code (Intermediate)
Puppet Camp Paris 2015: Continuous Integration of Puppet Code (Intermediate) Puppet Camp Paris 2015: Continuous Integration of Puppet Code (Intermediate)
Puppet Camp Paris 2015: Continuous Integration of Puppet Code (Intermediate)
Puppet
 
Detecting secrets in code committed to gitlab (in real time)
Detecting secrets in code committed to gitlab (in real time)Detecting secrets in code committed to gitlab (in real time)
Detecting secrets in code committed to gitlab (in real time)
Chandrapal Badshah
 
WTF is Twisted?
WTF is Twisted?WTF is Twisted?
WTF is Twisted?
hawkowl
 
Docker and Fluentd
Docker and FluentdDocker and Fluentd
Docker and Fluentd
SATOSHI TAGOMORI
 
Twisted: a quick introduction
Twisted: a quick introductionTwisted: a quick introduction
Twisted: a quick introduction
Robert Coup
 
Kafka Workshop
Kafka WorkshopKafka Workshop
Kafka Workshop
Alexandre André
 
Deploying Symfony2 app with Ansible
Deploying Symfony2 app with AnsibleDeploying Symfony2 app with Ansible
Deploying Symfony2 app with Ansible
Roman Rodomansky
 
Multi-threaded web crawler in Ruby
Multi-threaded web crawler in RubyMulti-threaded web crawler in Ruby
Multi-threaded web crawler in Ruby
Polcode
 
Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017
Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017
Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017
Codemotion
 
Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017
Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017
Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017
Codemotion
 
Asynchronous Python with Twisted
Asynchronous Python with TwistedAsynchronous Python with Twisted
Asynchronous Python with Twisted
Adam Englander
 
Testing Wi-Fi with OSS Tools
Testing Wi-Fi with OSS ToolsTesting Wi-Fi with OSS Tools
Testing Wi-Fi with OSS Tools
All Things Open
 
#vBrownBag OpenStack - Review & Kickoff for Phase 2
#vBrownBag OpenStack - Review & Kickoff for Phase 2#vBrownBag OpenStack - Review & Kickoff for Phase 2
#vBrownBag OpenStack - Review & Kickoff for Phase 2
ProfessionalVMware
 
Developing high-performance network servers in Lisp
Developing high-performance network servers in LispDeveloping high-performance network servers in Lisp
Developing high-performance network servers in Lisp
Vladimir Sedach
 
Generating Visual Studio Code Extensions for Xtext DSLs
Generating Visual Studio Code Extensions for Xtext DSLsGenerating Visual Studio Code Extensions for Xtext DSLs
Generating Visual Studio Code Extensions for Xtext DSLs
Karsten Thoms
 
Concurrent Ruby Application Servers
Concurrent Ruby Application ServersConcurrent Ruby Application Servers
Concurrent Ruby Application Servers
Lin Jen-Shin
 
PyCon UK - iCE: Interactive cloud experimentation
PyCon UK - iCE: Interactive cloud experimentationPyCon UK - iCE: Interactive cloud experimentation
PyCon UK - iCE: Interactive cloud experimentation
George Lestaris
 
Dockerizing Symfony Applications - Symfony Live Berlin 2014
Dockerizing Symfony Applications - Symfony Live Berlin 2014Dockerizing Symfony Applications - Symfony Live Berlin 2014
Dockerizing Symfony Applications - Symfony Live Berlin 2014
D
 
Building GUI App with Electron and Lisp
Building GUI App with Electron and LispBuilding GUI App with Electron and Lisp
Building GUI App with Electron and Lisp
fukamachi
 
Puppet Camp Paris 2015: Continuous Integration of Puppet Code (Intermediate)
Puppet Camp Paris 2015: Continuous Integration of Puppet Code (Intermediate) Puppet Camp Paris 2015: Continuous Integration of Puppet Code (Intermediate)
Puppet Camp Paris 2015: Continuous Integration of Puppet Code (Intermediate)
Puppet
 
Detecting secrets in code committed to gitlab (in real time)
Detecting secrets in code committed to gitlab (in real time)Detecting secrets in code committed to gitlab (in real time)
Detecting secrets in code committed to gitlab (in real time)
Chandrapal Badshah
 
WTF is Twisted?
WTF is Twisted?WTF is Twisted?
WTF is Twisted?
hawkowl
 
Twisted: a quick introduction
Twisted: a quick introductionTwisted: a quick introduction
Twisted: a quick introduction
Robert Coup
 
Deploying Symfony2 app with Ansible
Deploying Symfony2 app with AnsibleDeploying Symfony2 app with Ansible
Deploying Symfony2 app with Ansible
Roman Rodomansky
 
Multi-threaded web crawler in Ruby
Multi-threaded web crawler in RubyMulti-threaded web crawler in Ruby
Multi-threaded web crawler in Ruby
Polcode
 
Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017
Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017
Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017
Codemotion
 
Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017
Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017
Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017
Codemotion
 
Asynchronous Python with Twisted
Asynchronous Python with TwistedAsynchronous Python with Twisted
Asynchronous Python with Twisted
Adam Englander
 
Testing Wi-Fi with OSS Tools
Testing Wi-Fi with OSS ToolsTesting Wi-Fi with OSS Tools
Testing Wi-Fi with OSS Tools
All Things Open
 
#vBrownBag OpenStack - Review & Kickoff for Phase 2
#vBrownBag OpenStack - Review & Kickoff for Phase 2#vBrownBag OpenStack - Review & Kickoff for Phase 2
#vBrownBag OpenStack - Review & Kickoff for Phase 2
ProfessionalVMware
 
Developing high-performance network servers in Lisp
Developing high-performance network servers in LispDeveloping high-performance network servers in Lisp
Developing high-performance network servers in Lisp
Vladimir Sedach
 

Similar to Guillotina: The Asyncio REST Resource API (20)

Guillotina
GuillotinaGuillotina
Guillotina
Ramon Navarro
 
Web of things introduction
Web of things introductionWeb of things introduction
Web of things introduction
承翰 蔡
 
Designing a beautiful REST json api
Designing a beautiful REST json apiDesigning a beautiful REST json api
Designing a beautiful REST json api
0x07de
 
Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014
Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014
Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014
Puppet
 
OrientDB introduction - NoSQL
OrientDB introduction - NoSQLOrientDB introduction - NoSQL
OrientDB introduction - NoSQL
Luca Garulli
 
Learning the basics of Apache NiFi for iot OSS Europe 2020
Learning the basics of Apache NiFi for iot OSS Europe 2020Learning the basics of Apache NiFi for iot OSS Europe 2020
Learning the basics of Apache NiFi for iot OSS Europe 2020
Timothy Spann
 
PLNOG 18 - Piotr Wojciechowski - REST API czyli jak miękko wejść w programowa...
PLNOG 18 - Piotr Wojciechowski - REST API czyli jak miękko wejść w programowa...PLNOG 18 - Piotr Wojciechowski - REST API czyli jak miękko wejść w programowa...
PLNOG 18 - Piotr Wojciechowski - REST API czyli jak miękko wejść w programowa...
PROIDEA
 
Prototyping applications with heroku and elasticsearch
 Prototyping applications with heroku and elasticsearch Prototyping applications with heroku and elasticsearch
Prototyping applications with heroku and elasticsearch
protofy
 
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
Nelson Kopliku
 
Deep Dive: Strategic Importance of BaaS
Deep Dive: Strategic Importance of BaaSDeep Dive: Strategic Importance of BaaS
Deep Dive: Strategic Importance of BaaS
Apigee | Google Cloud
 
REST easy with API Platform
REST easy with API PlatformREST easy with API Platform
REST easy with API Platform
Antonio Peric-Mazar
 
Testing API platform with Behat BDD tests
Testing API platform with Behat BDD testsTesting API platform with Behat BDD tests
Testing API platform with Behat BDD tests
Stefan Adolf
 
Building APIs in an easy way using API Platform
Building APIs in an easy way using API PlatformBuilding APIs in an easy way using API Platform
Building APIs in an easy way using API Platform
Antonio Peric-Mazar
 
Semantic Web & TYPO3
Semantic Web & TYPO3Semantic Web & TYPO3
Semantic Web & TYPO3
André Wuttig
 
Design Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsDesign Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIs
Stormpath
 
Terrastore - A document database for developers
Terrastore - A document database for developersTerrastore - A document database for developers
Terrastore - A document database for developers
Sergio Bossa
 
CoC23_Utilizing Real-Time Transit Data for Travel Optimization
CoC23_Utilizing Real-Time Transit Data for Travel OptimizationCoC23_Utilizing Real-Time Transit Data for Travel Optimization
CoC23_Utilizing Real-Time Transit Data for Travel Optimization
Timothy Spann
 
HTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & socketsHTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & sockets
Remy Sharp
 
OSS EU: Deep Dive into Building Streaming Applications with Apache Pulsar
OSS EU:  Deep Dive into Building Streaming Applications with Apache PulsarOSS EU:  Deep Dive into Building Streaming Applications with Apache Pulsar
OSS EU: Deep Dive into Building Streaming Applications with Apache Pulsar
Timothy Spann
 
how to use openstack api
how to use openstack apihow to use openstack api
how to use openstack api
Liang Bo
 
Web of things introduction
Web of things introductionWeb of things introduction
Web of things introduction
承翰 蔡
 
Designing a beautiful REST json api
Designing a beautiful REST json apiDesigning a beautiful REST json api
Designing a beautiful REST json api
0x07de
 
Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014
Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014
Fully Automate Application Delivery with Puppet and F5 - PuppetConf 2014
Puppet
 
OrientDB introduction - NoSQL
OrientDB introduction - NoSQLOrientDB introduction - NoSQL
OrientDB introduction - NoSQL
Luca Garulli
 
Learning the basics of Apache NiFi for iot OSS Europe 2020
Learning the basics of Apache NiFi for iot OSS Europe 2020Learning the basics of Apache NiFi for iot OSS Europe 2020
Learning the basics of Apache NiFi for iot OSS Europe 2020
Timothy Spann
 
PLNOG 18 - Piotr Wojciechowski - REST API czyli jak miękko wejść w programowa...
PLNOG 18 - Piotr Wojciechowski - REST API czyli jak miękko wejść w programowa...PLNOG 18 - Piotr Wojciechowski - REST API czyli jak miękko wejść w programowa...
PLNOG 18 - Piotr Wojciechowski - REST API czyli jak miękko wejść w programowa...
PROIDEA
 
Prototyping applications with heroku and elasticsearch
 Prototyping applications with heroku and elasticsearch Prototyping applications with heroku and elasticsearch
Prototyping applications with heroku and elasticsearch
protofy
 
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
Nelson Kopliku
 
Deep Dive: Strategic Importance of BaaS
Deep Dive: Strategic Importance of BaaSDeep Dive: Strategic Importance of BaaS
Deep Dive: Strategic Importance of BaaS
Apigee | Google Cloud
 
Testing API platform with Behat BDD tests
Testing API platform with Behat BDD testsTesting API platform with Behat BDD tests
Testing API platform with Behat BDD tests
Stefan Adolf
 
Building APIs in an easy way using API Platform
Building APIs in an easy way using API PlatformBuilding APIs in an easy way using API Platform
Building APIs in an easy way using API Platform
Antonio Peric-Mazar
 
Semantic Web & TYPO3
Semantic Web & TYPO3Semantic Web & TYPO3
Semantic Web & TYPO3
André Wuttig
 
Design Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsDesign Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIs
Stormpath
 
Terrastore - A document database for developers
Terrastore - A document database for developersTerrastore - A document database for developers
Terrastore - A document database for developers
Sergio Bossa
 
CoC23_Utilizing Real-Time Transit Data for Travel Optimization
CoC23_Utilizing Real-Time Transit Data for Travel OptimizationCoC23_Utilizing Real-Time Transit Data for Travel Optimization
CoC23_Utilizing Real-Time Transit Data for Travel Optimization
Timothy Spann
 
HTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & socketsHTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & sockets
Remy Sharp
 
OSS EU: Deep Dive into Building Streaming Applications with Apache Pulsar
OSS EU:  Deep Dive into Building Streaming Applications with Apache PulsarOSS EU:  Deep Dive into Building Streaming Applications with Apache Pulsar
OSS EU: Deep Dive into Building Streaming Applications with Apache Pulsar
Timothy Spann
 
how to use openstack api
how to use openstack apihow to use openstack api
how to use openstack api
Liang Bo
 
Ad

Recently uploaded (20)

#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Ad

Guillotina: The Asyncio REST Resource API

  • 1. GUILLOTINA Async REST Resource API to manage millions of objects
  • 2. Full Stack Engineer Onna - BCN Connect and search all knowledge
 inside an enterprise with ML Nathan Van Gheem Plone Software Foundation,
 FWT Member, 
 UITEAM,
 SecurityTeam
  • 3. CoFounder/CTO Onna - SF/BCN Connect and search all knowledge
 inside an enterprise with ML Ramon Navarro Bosch Plone Software Foundation & FWT Member
  • 5. WEB FRAMEWORKS • Angular/React : Server rendering frameworks are dying • Most sources of data comes from the web/api • Lots of experience on storing, distributing, managing resources
  • 6. LOVE We love Plone but wanted to be able to use it in high performant situations with modern web technologies
  • 7. 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
  • 10. LESSONS Taking lessons learned from Plone, simplify and apply to an AsyncIO context
  • 11. INSPIRATION Plone/Zope’s hierarchical data model Pyramid’s decorator-based configuration Django’s global application settings ZCA pluggability Plone/Zope’s security model JSON Schema
  • 12. FORKS parts of zodb data model plone.behavior zope.security zope.schema zope.component/zope.configuration zope.dublincore zope.i18n zope.lifecycleevent zope.location zope.event
  • 13. WHAT IT IS NOT replacement for Plone re-implementation of Plone plone.restapi compatible API guillotina_cms
  • 15. TRANSACTION All operations are managed to be durable and confirmed, conflict resolution policies
  • 17. RELATIONAL DATABASES Use the best database systems available PostgreSQL CockroachDB
  • 19. RESOURCES Objects are resources with schema attributes, annotations, OO inheritance and static/ dynamic behaviors. RESOURCE
  • 21. SECURITY Full definition of permissions / roles / principals with global and local inheritance of permissions on the tree.Allow, Deny, Unset,AllowSingle (no inheritance)
  • 22. CRUD DynamicTraversal CRUD HTTP verbs mapping for each content type Custom endpoints for specific operations GET HEAD POST PUTPATCH
  • 23. ASYNCIO All based on asyncio for network integrations with external indexers, db, caching, services Based on aioHTTP
  • 24. SIMPLE Easy to install, Easy to develop pip install guillotina docker run guillotina/guillotina
  • 25. CORS Cors configured globally and enabled by default
  • 26. WEBSOCKET Websocket connection to apply operations through frames. Mapping of REST API on aTCP async channel.
  • 29. APPLICATIONS Easily extendable with python packages guillotina_swagger guillotina_elasticsearch guillotina_rediscache guillotina_s3storage guillotina_gcloudstorage guillotina_dbusers guillotina_mailer guillotina_pgcatalog
  • 30. EXTENSIBLE Uses zope.interface and based on zope.component
 
 utilities and adapters!Yay!
  • 31. COOKIE CUTTER Cookie cutter templates for configuration and applications
  • 32. QUEUE Operational queue and after response tasks
  • 33. EVENT Async event based system to trigger operations in code
 
 Async tasks
  • 35. STATIC FILES AND JS APPS Support for serving JavaScript applications
  • 36. MULTI DB Mount multiple DBs
 Supports: POSTGRESQL COCKROACH
  • 37. FILE CLOUD Support for S3/GCloud storage. Database blob storage otherwise
  • 41. CONTAINERS Docker / K8s / Nomad out the box
  • 42. EXPLICIT PY All configuration is defined on the code using decorators @configure.service()
  • 43. guillotina(x) = argmin Zope/Plone(x) * zope.interface still used
  • 45. • Only >= Python 3.6 • Designed to host millions of objects • Memory optimizations • Apply operations to contained objects in async • Authentication & authorization extensions • Reusable UI JS components from Plone (Widgets/SPA)
  • 47. --- 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: []
  • 48. 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 .
  • 49. DATA MODEL Resource & Container Interface Schema fields Static Behaviors Dynamic Behaviors
  • 50. 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
  • 51. @configure.subscriber(for_=(ICustomType, IObjectAddedEvent)) async def created_userfolder(obj, evnt): ... @configure.service( context=ICustomType, name='@myEndpoint', method='GET', permission='guillotina.AccessContent') async def my_service(context, request): ...
  • 53. “Organizing data is where we spend more time and its boring.” Data Scientist Sysadmin / Engineers
  • 54. Tables / CSV Docs / Unstructured data NOSQLSQL
  • 55. 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)
  • 56. 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)
  • 57. Try it, create issues, contribute
  • 58. Go to the “Introduction to AsyncIO” talk!
  • 59. PREGUNTES ? GRÀCIES ! [email protected] [email protected] CORE : https://github.com/plone/guillotina DOCS : http://guillotina.readthedocs.io/en/latest/ DOCKER: https://hub.docker.com/r/guillotina/guillotina/ MODULES : https://github.com/guillotinaweb ONNA: https://github.com/onna