SlideShare a Scribd company logo
From Legacy
To a Microservices Architecture
Python, ZCA, Pyramid, Angular 4 & Deis
About me
Ruda Porto Filgueiras
Software Architect at Briefy

http://briefy.co
From Brazil, based in Berlin
Twitter @rudaporto

ruda@briefy.co
The Company
Briefy Team
Creating visual content at scale
INPUT & IMPORT
We define a briefing together with
our Customers. After this we
receive a listing with all items to
shoot Hotels, Flats, Restaurants, etc.
Receive Orders
ASSIGNMENTS
We connect Creatives assigning
them to Orders in the location are
available. Creative schedules the
shoot with the third-party contact and
execute it.
Assign Creative
VALIDATE & PACKAGING
Creative upload assets and we
validate and do QA to make sure we
are following the briefing and specific
requirements. We deliver the content
to Customer: SFTP, GDrive, API.
QA & Delivery
Visual content matter
Embrace the change
Overview
A solution based on three pillars
API CENTRIC
To serve distinct use cases using the
same codebase, Briefy built its
solution around REST APIs.

Web, Mobile and customer integration
were the planned consumers.
MICROSERVICES
Single responsibility and distinct life
cycles for parts of the solution
pointed Briefy to use a micro
services architecture.
EVENTS BASED
Most of the communication between
the services could be done
asynchronously, so an event-based
— with messaging — solution was
implemented.
Code quality and reuse as principles
TESTING
Codebase testing with

Continuous Integration and

Continuous deployment
CODE QUALITY
Style guide and

documentation for

the entire codebase
DEVOPS
Use existing toolset to
minimise devops work.
CODE REUSE
Shared packages/libraries

Build upon existing OSS
codebase
Tech stack
INFRA
Storage: GDrive & S3

Messages: SQS

Cluster: 

Kubernetes 1.7.8

DEIS 2.18
API
Python 3.6.3

Zope Component Architecture

Pyramid 1.9 / Cornice

SQLAlchemy 1.2

Postgresql 9.6
DEV TOOLS
Repo: GitHub

CI: TravisCI

Logging: Logstash

Reporting: Sentry /
NewRelic / Slack
WEB FRONTEND
Angular 4

Typescript

Generic views

Generic Listings

Generic CTAs
Infrastructure
AWS
THREE ENVIRONMENTS
Live: eu-central-1

Staging: us-east-1

Development: eu-west-1
SERVICES
Message routed using SQS

S3 for static data & assets

Kubernets Cluster on EC2

Dies Workflow
Kops
AUTOMATE
Kubernets cluster creation with a single
command line, including bastion and nat

High availability, multiple SDN options
MAINTAIN
Cluster upgrade and change

Export format templates to cloud formation and
terraform
Kubernets
KUBERNETES OVER EC2
One master, n minions
DEIS ON TOP OF KUBERNETES
Workflow solution similar to Heroku PaaS
EC2 WITH AUTO SCALING
T2 and M4 instances.
Deis Workflow
DOCKER
Automatic build and save images
SIMPLE
git push deis master
TWELVE-FACTOR
And also support legacy if necessary
Devops
MONITORING WITH NEWRELIC
Servers and applications
REPORTS ON SLACK / EMAIL
Deploy, errors and alerts posted on
tech channel
AUTOMATION WITH ANSIBLE
AWS and Cloudflare integration
Code
Shared codebase
BRIEFY.COMMON
Events / Queue

Base Models / Mixins

Logging

Workflow
BRIEFY.WS
REST API blueprints

Validation

Error handling
BRIEFY.GDRIVE
Common GDrive actions

Create, Copy, Metadata,
List, Download
BRIEFY.S3
Common S3 actions

Create, Copy, Metadata,
List, Download
briefy.common
QUEUE WORKER
Queue worker to consume
SQS messages and
dispatch
WORKFLOW
Workflow engine to create
solid and secure business
processes
EVENTS
Event firing to internal
component architecture
and to SQS
MODELS
Base mixins and sqlalchemy
models with versioning, local
roles support and polymorphic
types
CACHE
Cache object serialization
on redis with dogpile.cache
briefy.ws
FILTER
Sort and filter listings
automatically based on
model fields
RESOURCES
Base classes to exposure
models as API endpoints:
REST, workflow transitions,
versioning
EVENTS
Object lifecycle events
firing
SCHEMA
Automatic colander schema
generation for validation
and deserialization
SECURITY
Resource factory to
dynamically compute ACLs
based on model workflow and
local roles
Productivity tools
CHECKSTYLE
Linting rules and code style
guide
COOKIECUTTERS
Templates to create new
packages and services
DOCKER IMAGES
Python 3.6.3

Plone 5.0.8

Nginx / Varnish
Services
Core services
MS.LAURE
Automatic quality
assurance and renaming of
assets
LEICA
Workflow and scheduling
solution.

API-based
CHOREOGRAPHER
Events handling and
routing.
ROLLEIFLEX
Authorisation and user
management service.
ALEXANDRIA
Digital Assets management
solution

API-based
Support services
CMS
Content management
backend for Briefy website.

Using Plone CMS.
THUMBOR
Image server handling
automatic cropping, resizing
and image transforms
BRIEFY.SLACK
Service handling Slack
notifications.
BRIEFY.MAIL
Service handling Mail
notifications using Mandrill
as the provider
HOTELS CRM
CRM solution to deal with
Hotels acquisition for the
City Packages initiative.
LEADS
Service handling leads and
quotes coming from
briefy.co website.
SITEMAP
Service that generates a
sitemap.xml for CMS and static
content.

SEO helper
API GATEWAY
Gateway and router
handling public accesses
to Briefy API
Leica: from briefing to assets
The core of Briefy
WORKFLOW & PERMISSIONS
Every model have its own workflow
HUNDREDS OF EVENTS
Workflow transition, task execution, object creation
and update.
DATA MODELS
Customer, Project, Order, Assignment, Creative
and User profiles
Being the scheduling and workflow solution for visual content
creation, Leica is the core of Briefy operations.

Elements of Leica
BRIEFY.FRONTEND
Web application developed with
Angular4, connects to Leica API.

This app has 3 distinct users:
Customer, Creative and Briefy team
member, with distinct permissions.
User Interface
BRIEFY.LEICA
Domain models, permissions,
business logic and API endpoints.

Codebase is well documented and
90% code coverage.
API
LEICA TASKS
Scheduled tasks execute workflow
transitions, generate reports and
post KPIs.

Share the same codebase as
briefy.leica
Tasks
Domain Models
CUSTOMER
Company requesting visual
content creation.
PROJECT
A grouping of orders from the
same customer.

Usually attached to one
contract (or agreement)
ORDER
A content creation request.
When it is not confirmed, it is
called Lead.

Customer oriented.
ASSIGNMENT
A content creation
execution schedule.

Creative oriented.
JOB POOL
Groups available Orders to
be offered to a group of
pre-selected Creatives.
CREATIVE
A visual content creator -
Photographer,
videographer — profile.
CUSTOMER USER
Profile of a user attached to
a Customer.
BRIEFY USER
Profile of a Briefy team
member user.
Managing visual content creation at scale
cost is complex
Confidential
Managing
Visual
Content
Creation Is
Complex
From Events
To Actions
Every action, one event (1)
ARIANA
Assign a creative to an Order
ORDER.WORKFLOW.ASSIGN
2017-07-27 15:46:10.03267
120

Times
Every action, one event (2)
OPHELIE
Validates a Creative
PROFESSIONAL.WORKFLOW.VALIDATE
2017-07-31 15:55:11.436015
213

Times
Events trigger new actions
ASSIGN. IS SCHEDULED
Assignment is scheduled on
Leica, generating an event
EVENT IS ROUTED
Actions are registered to this
event, i.e.: Send email to Creative
EMAIL SENT TO CREATIVE
Using Mandrill, a message is sent
to the Creative
An event on Leica will be sent to Choreographer, there it will be routed to other micro services

to execute new actions.

This flow is asynchronous and all messages are sent using SQS queues.
BRIEFY.LEICA BRIEFY.CHOREOGRAPHER BRIEFY.MAIL
Thank you!
@rudaporto



ruda@briefy.co

+49 176 28607522
Rudá Porto Filgueiras

More Related Content

PDF
Micro-serviços em Python usando Pyramid, Cornice e muito amor
PPTX
App Development Evolution: What has changed?
PPTX
The App Evolution
PDF
The App Evolution
PDF
Jfokus Workshop: Code in the Cloud for the Cloud
PDF
IBM Connect 2014 - BP207 - Don’t Reinvent the Wheel - (Re)use Open Source Sof...
PPTX
Running the-next-generation-of-cloud-native-applications-using-open-applicati...
PDF
The Cloud Foundry Story on OpenStack
Micro-serviços em Python usando Pyramid, Cornice e muito amor
App Development Evolution: What has changed?
The App Evolution
The App Evolution
Jfokus Workshop: Code in the Cloud for the Cloud
IBM Connect 2014 - BP207 - Don’t Reinvent the Wheel - (Re)use Open Source Sof...
Running the-next-generation-of-cloud-native-applications-using-open-applicati...
The Cloud Foundry Story on OpenStack

What's hot (20)

PDF
Webcast: API-Centric Architecture for Building Context-Aware Apps
PDF
Cloud native architeturecture
PDF
APIdays Barcelona 2019 - How a Cloud native Architecture helps to drive Busin...
PDF
What’s behind a high quality web API? Ensure your APIs are more than just a ...
PDF
20180123 loq hybrid integration vision
PDF
Developer Experience (DX) as a Fitness Function for Platform Teams
PPTX
Designing APIs and Microservices Using Domain-Driven Design
PDF
IBM Think 2020 Openshift on IBM Z and LinuxONE
PDF
API Management For Building Software Applications Powerpoint Presentation Slides
PDF
Where can you use serverless?  How does it relate to APIs, integration and mi...
PDF
Rightway meets your requirements in Flex development
PDF
Go Cloud Native with IBM Bluemix Developer Console - GIDS17
PPTX
Cognitive IBM Watson Services for Bluemix Developers
PDF
GlueCon 2018: Are REST APIs Still Relevant Today?
PPT
SAP Business Objects Software development Kit
PDF
ETS Summer School - Introduction to Bluemix (July 4th)
PPTX
Cloud Foundry Marketplace Powered by AppDirect
PDF
apidays LIVE Jakarta - API Sandbox: empowering Developer Experience (DX) by F...
PPTX
Migrating from IBM API Connect v5 to v2018
PDF
WaveMaker - Spring Roo - SpringSource Tool Suite - Choosing the right tool fo...
Webcast: API-Centric Architecture for Building Context-Aware Apps
Cloud native architeturecture
APIdays Barcelona 2019 - How a Cloud native Architecture helps to drive Busin...
What’s behind a high quality web API? Ensure your APIs are more than just a ...
20180123 loq hybrid integration vision
Developer Experience (DX) as a Fitness Function for Platform Teams
Designing APIs and Microservices Using Domain-Driven Design
IBM Think 2020 Openshift on IBM Z and LinuxONE
API Management For Building Software Applications Powerpoint Presentation Slides
Where can you use serverless?  How does it relate to APIs, integration and mi...
Rightway meets your requirements in Flex development
Go Cloud Native with IBM Bluemix Developer Console - GIDS17
Cognitive IBM Watson Services for Bluemix Developers
GlueCon 2018: Are REST APIs Still Relevant Today?
SAP Business Objects Software development Kit
ETS Summer School - Introduction to Bluemix (July 4th)
Cloud Foundry Marketplace Powered by AppDirect
apidays LIVE Jakarta - API Sandbox: empowering Developer Experience (DX) by F...
Migrating from IBM API Connect v5 to v2018
WaveMaker - Spring Roo - SpringSource Tool Suite - Choosing the right tool fo...
Ad

Similar to From Legacy to a Microservices Architecture (20)

PPTX
App Development Evolution: What has changed?
PDF
D-DAY 2015 Hybrid Cloud IBM
PPTX
What is Headless and headless 101 at Acquia
PDF
What is Headless and headless 101 at Acquia.pdf
PDF
Cloud Native Patterns with Bluemix Developer Console
PDF
Evolve 19 | Sarah Xu & Kanika Gera | Adobe I/O - Why You Need it to Execute o...
PDF
R-Style Lab Web Development Portfolio
PPTX
Cloud computing which explians about cloud topics
PDF
Hybrid Cloud DevOps with Apprenda and UrbanCode Deploy
PDF
POST GRADUATE PROGRAM IN CLOUD COMPUTING
PPTX
PPTX
SaaS Add-on Services for Cloud Foundry Powered by AppDirect (Cloud Foundry Su...
PDF
Webinar- How to integrate interactive and engaging contents to your Apps?
PDF
Build Event-Driven Microservices with Confluent Cloud Workshop #1
PDF
Application Modernization with Code Refactoring
PPTX
Demistifying serverless on aws
PPTX
DevNet Express - Spark & Tropo API - Lisbon May 2016
PDF
Best AWS with DevOps course in Hyderabad
PDF
Developing truly personalised experiences
PDF
Collaborative Line of Business Applications on IBM Bluemix
App Development Evolution: What has changed?
D-DAY 2015 Hybrid Cloud IBM
What is Headless and headless 101 at Acquia
What is Headless and headless 101 at Acquia.pdf
Cloud Native Patterns with Bluemix Developer Console
Evolve 19 | Sarah Xu & Kanika Gera | Adobe I/O - Why You Need it to Execute o...
R-Style Lab Web Development Portfolio
Cloud computing which explians about cloud topics
Hybrid Cloud DevOps with Apprenda and UrbanCode Deploy
POST GRADUATE PROGRAM IN CLOUD COMPUTING
SaaS Add-on Services for Cloud Foundry Powered by AppDirect (Cloud Foundry Su...
Webinar- How to integrate interactive and engaging contents to your Apps?
Build Event-Driven Microservices with Confluent Cloud Workshop #1
Application Modernization with Code Refactoring
Demistifying serverless on aws
DevNet Express - Spark & Tropo API - Lisbon May 2016
Best AWS with DevOps course in Hyderabad
Developing truly personalised experiences
Collaborative Line of Business Applications on IBM Bluemix
Ad

Recently uploaded (20)

PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPTX
web development for engineering and engineering
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
Geodesy 1.pptx...............................................
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PPTX
Lecture Notes Electrical Wiring System Components
PPTX
Sustainable Sites - Green Building Construction
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPT
Project quality management in manufacturing
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PDF
Digital Logic Computer Design lecture notes
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
additive manufacturing of ss316l using mig welding
PPTX
bas. eng. economics group 4 presentation 1.pptx
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
Operating System & Kernel Study Guide-1 - converted.pdf
web development for engineering and engineering
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Embodied AI: Ushering in the Next Era of Intelligent Systems
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Geodesy 1.pptx...............................................
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Lecture Notes Electrical Wiring System Components
Sustainable Sites - Green Building Construction
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Project quality management in manufacturing
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
Digital Logic Computer Design lecture notes
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
UNIT-1 - COAL BASED THERMAL POWER PLANTS
additive manufacturing of ss316l using mig welding
bas. eng. economics group 4 presentation 1.pptx
Automation-in-Manufacturing-Chapter-Introduction.pdf

From Legacy to a Microservices Architecture

  • 1. From Legacy To a Microservices Architecture Python, ZCA, Pyramid, Angular 4 & Deis
  • 2. About me Ruda Porto Filgueiras Software Architect at Briefy
 http://briefy.co From Brazil, based in Berlin Twitter @rudaporto
 ruda@briefy.co
  • 5. Creating visual content at scale INPUT & IMPORT We define a briefing together with our Customers. After this we receive a listing with all items to shoot Hotels, Flats, Restaurants, etc. Receive Orders ASSIGNMENTS We connect Creatives assigning them to Orders in the location are available. Creative schedules the shoot with the third-party contact and execute it. Assign Creative VALIDATE & PACKAGING Creative upload assets and we validate and do QA to make sure we are following the briefing and specific requirements. We deliver the content to Customer: SFTP, GDrive, API. QA & Delivery
  • 9. A solution based on three pillars API CENTRIC To serve distinct use cases using the same codebase, Briefy built its solution around REST APIs.
 Web, Mobile and customer integration were the planned consumers. MICROSERVICES Single responsibility and distinct life cycles for parts of the solution pointed Briefy to use a micro services architecture. EVENTS BASED Most of the communication between the services could be done asynchronously, so an event-based — with messaging — solution was implemented.
  • 10. Code quality and reuse as principles TESTING Codebase testing with
 Continuous Integration and
 Continuous deployment CODE QUALITY Style guide and
 documentation for
 the entire codebase DEVOPS Use existing toolset to minimise devops work. CODE REUSE Shared packages/libraries
 Build upon existing OSS codebase
  • 11. Tech stack INFRA Storage: GDrive & S3
 Messages: SQS
 Cluster: 
 Kubernetes 1.7.8
 DEIS 2.18 API Python 3.6.3
 Zope Component Architecture
 Pyramid 1.9 / Cornice
 SQLAlchemy 1.2
 Postgresql 9.6 DEV TOOLS Repo: GitHub
 CI: TravisCI
 Logging: Logstash
 Reporting: Sentry / NewRelic / Slack WEB FRONTEND Angular 4
 Typescript
 Generic views
 Generic Listings
 Generic CTAs
  • 13. AWS THREE ENVIRONMENTS Live: eu-central-1
 Staging: us-east-1
 Development: eu-west-1 SERVICES Message routed using SQS
 S3 for static data & assets
 Kubernets Cluster on EC2
 Dies Workflow
  • 14. Kops AUTOMATE Kubernets cluster creation with a single command line, including bastion and nat
 High availability, multiple SDN options MAINTAIN Cluster upgrade and change
 Export format templates to cloud formation and terraform
  • 15. Kubernets KUBERNETES OVER EC2 One master, n minions DEIS ON TOP OF KUBERNETES Workflow solution similar to Heroku PaaS EC2 WITH AUTO SCALING T2 and M4 instances.
  • 16. Deis Workflow DOCKER Automatic build and save images SIMPLE git push deis master TWELVE-FACTOR And also support legacy if necessary
  • 17. Devops MONITORING WITH NEWRELIC Servers and applications REPORTS ON SLACK / EMAIL Deploy, errors and alerts posted on tech channel AUTOMATION WITH ANSIBLE AWS and Cloudflare integration
  • 18. Code
  • 19. Shared codebase BRIEFY.COMMON Events / Queue
 Base Models / Mixins
 Logging
 Workflow BRIEFY.WS REST API blueprints
 Validation
 Error handling BRIEFY.GDRIVE Common GDrive actions
 Create, Copy, Metadata, List, Download BRIEFY.S3 Common S3 actions
 Create, Copy, Metadata, List, Download
  • 20. briefy.common QUEUE WORKER Queue worker to consume SQS messages and dispatch WORKFLOW Workflow engine to create solid and secure business processes EVENTS Event firing to internal component architecture and to SQS MODELS Base mixins and sqlalchemy models with versioning, local roles support and polymorphic types CACHE Cache object serialization on redis with dogpile.cache
  • 21. briefy.ws FILTER Sort and filter listings automatically based on model fields RESOURCES Base classes to exposure models as API endpoints: REST, workflow transitions, versioning EVENTS Object lifecycle events firing SCHEMA Automatic colander schema generation for validation and deserialization SECURITY Resource factory to dynamically compute ACLs based on model workflow and local roles
  • 22. Productivity tools CHECKSTYLE Linting rules and code style guide COOKIECUTTERS Templates to create new packages and services DOCKER IMAGES Python 3.6.3
 Plone 5.0.8
 Nginx / Varnish
  • 24. Core services MS.LAURE Automatic quality assurance and renaming of assets LEICA Workflow and scheduling solution.
 API-based CHOREOGRAPHER Events handling and routing. ROLLEIFLEX Authorisation and user management service. ALEXANDRIA Digital Assets management solution
 API-based
  • 25. Support services CMS Content management backend for Briefy website.
 Using Plone CMS. THUMBOR Image server handling automatic cropping, resizing and image transforms BRIEFY.SLACK Service handling Slack notifications. BRIEFY.MAIL Service handling Mail notifications using Mandrill as the provider HOTELS CRM CRM solution to deal with Hotels acquisition for the City Packages initiative. LEADS Service handling leads and quotes coming from briefy.co website. SITEMAP Service that generates a sitemap.xml for CMS and static content.
 SEO helper API GATEWAY Gateway and router handling public accesses to Briefy API
  • 27. The core of Briefy WORKFLOW & PERMISSIONS Every model have its own workflow HUNDREDS OF EVENTS Workflow transition, task execution, object creation and update. DATA MODELS Customer, Project, Order, Assignment, Creative and User profiles Being the scheduling and workflow solution for visual content creation, Leica is the core of Briefy operations.

  • 28. Elements of Leica BRIEFY.FRONTEND Web application developed with Angular4, connects to Leica API.
 This app has 3 distinct users: Customer, Creative and Briefy team member, with distinct permissions. User Interface BRIEFY.LEICA Domain models, permissions, business logic and API endpoints.
 Codebase is well documented and 90% code coverage. API LEICA TASKS Scheduled tasks execute workflow transitions, generate reports and post KPIs.
 Share the same codebase as briefy.leica Tasks
  • 29. Domain Models CUSTOMER Company requesting visual content creation. PROJECT A grouping of orders from the same customer.
 Usually attached to one contract (or agreement) ORDER A content creation request. When it is not confirmed, it is called Lead.
 Customer oriented. ASSIGNMENT A content creation execution schedule.
 Creative oriented. JOB POOL Groups available Orders to be offered to a group of pre-selected Creatives. CREATIVE A visual content creator - Photographer, videographer — profile. CUSTOMER USER Profile of a user attached to a Customer. BRIEFY USER Profile of a Briefy team member user.
  • 30. Managing visual content creation at scale cost is complex Confidential Managing Visual Content Creation Is Complex
  • 32. Every action, one event (1) ARIANA Assign a creative to an Order ORDER.WORKFLOW.ASSIGN 2017-07-27 15:46:10.03267 120
 Times
  • 33. Every action, one event (2) OPHELIE Validates a Creative PROFESSIONAL.WORKFLOW.VALIDATE 2017-07-31 15:55:11.436015 213
 Times
  • 34. Events trigger new actions ASSIGN. IS SCHEDULED Assignment is scheduled on Leica, generating an event EVENT IS ROUTED Actions are registered to this event, i.e.: Send email to Creative EMAIL SENT TO CREATIVE Using Mandrill, a message is sent to the Creative An event on Leica will be sent to Choreographer, there it will be routed to other micro services
 to execute new actions.
 This flow is asynchronous and all messages are sent using SQS queues. BRIEFY.LEICA BRIEFY.CHOREOGRAPHER BRIEFY.MAIL