SlideShare a Scribd company logo
1 of 35
Download to read offline
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

What's hot

Cloud Foundry Marketplace Powered by AppDirect
Cloud Foundry MarketplacePowered by AppDirectCloud Foundry MarketplacePowered by AppDirect
Cloud Foundry Marketplace Powered by AppDirect
Platform CF
 
WaveMaker - Spring Roo - SpringSource Tool Suite - Choosing the right tool fo...
WaveMaker - Spring Roo - SpringSource Tool Suite - Choosing the right tool fo...WaveMaker - Spring Roo - SpringSource Tool Suite - Choosing the right tool fo...
WaveMaker - Spring Roo - SpringSource Tool Suite - Choosing the right tool fo...
martinlippert
 

What's hot (20)

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

Similar to From Legacy to a Microservices Architecture

Similar to From Legacy to a Microservices Architecture (20)

App Development Evolution: What has changed?
App Development Evolution: What has changed? App Development Evolution: What has changed?
App Development Evolution: What has changed?
 
D-DAY 2015 Hybrid Cloud IBM
D-DAY 2015 Hybrid Cloud IBMD-DAY 2015 Hybrid Cloud IBM
D-DAY 2015 Hybrid Cloud IBM
 
Cloud Native Patterns with Bluemix Developer Console
Cloud Native Patterns with Bluemix Developer ConsoleCloud Native Patterns with Bluemix Developer Console
Cloud Native Patterns with Bluemix Developer Console
 
Evolve 19 | Sarah Xu & Kanika Gera | Adobe I/O - Why You Need it to Execute o...
Evolve 19 | Sarah Xu & Kanika Gera | Adobe I/O - Why You Need it to Execute o...Evolve 19 | Sarah Xu & Kanika Gera | Adobe I/O - Why You Need it to Execute o...
Evolve 19 | Sarah Xu & Kanika Gera | Adobe I/O - Why You Need it to Execute o...
 
R-Style Lab Web Development Portfolio
R-Style Lab Web Development PortfolioR-Style Lab Web Development Portfolio
R-Style Lab Web Development Portfolio
 
Introducing amplify and full stack demo app built with vue.js, graph ql, auth...
Introducing amplify and full stack demo app built with vue.js, graph ql, auth...Introducing amplify and full stack demo app built with vue.js, graph ql, auth...
Introducing amplify and full stack demo app built with vue.js, graph ql, auth...
 
Hybrid Cloud DevOps with Apprenda and UrbanCode Deploy
Hybrid Cloud DevOps with Apprenda and UrbanCode DeployHybrid Cloud DevOps with Apprenda and UrbanCode Deploy
Hybrid Cloud DevOps with Apprenda and UrbanCode Deploy
 
AWS Enterprise Summit London 2015 | Adobe Creative Cloud and AWS
 AWS Enterprise Summit London 2015 | Adobe Creative Cloud and AWS AWS Enterprise Summit London 2015 | Adobe Creative Cloud and AWS
AWS Enterprise Summit London 2015 | Adobe Creative Cloud and AWS
 
POST GRADUATE PROGRAM IN CLOUD COMPUTING
POST GRADUATE PROGRAM IN CLOUD COMPUTINGPOST GRADUATE PROGRAM IN CLOUD COMPUTING
POST GRADUATE PROGRAM IN CLOUD COMPUTING
 
AWS Amplify
AWS AmplifyAWS Amplify
AWS Amplify
 
SaaS Add-on Services for Cloud Foundry Powered by AppDirect (Cloud Foundry Su...
SaaS Add-on Services for Cloud Foundry Powered by AppDirect (Cloud Foundry Su...SaaS Add-on Services for Cloud Foundry Powered by AppDirect (Cloud Foundry Su...
SaaS Add-on Services for Cloud Foundry Powered by AppDirect (Cloud Foundry Su...
 
Webinar- How to integrate interactive and engaging contents to your Apps?
Webinar- How to integrate interactive and engaging contents to your Apps?Webinar- How to integrate interactive and engaging contents to your Apps?
Webinar- How to integrate interactive and engaging contents to your Apps?
 
Build Event-Driven Microservices with Confluent Cloud Workshop #1
Build Event-Driven Microservices with Confluent Cloud Workshop #1Build Event-Driven Microservices with Confluent Cloud Workshop #1
Build Event-Driven Microservices with Confluent Cloud Workshop #1
 
Demistifying serverless on aws
Demistifying serverless on awsDemistifying serverless on aws
Demistifying serverless on aws
 
DevNet Express - Spark & Tropo API - Lisbon May 2016
DevNet Express - Spark & Tropo API - Lisbon May 2016DevNet Express - Spark & Tropo API - Lisbon May 2016
DevNet Express - Spark & Tropo API - Lisbon May 2016
 
Accelerating Software Delivery with AWS Developer Tools & AWS Mobile services...
Accelerating Software Delivery with AWS Developer Tools & AWS Mobile services...Accelerating Software Delivery with AWS Developer Tools & AWS Mobile services...
Accelerating Software Delivery with AWS Developer Tools & AWS Mobile services...
 
Developing truly personalised experiences
Developing truly personalised experiencesDeveloping truly personalised experiences
Developing truly personalised experiences
 
Collaborative Line of Business Applications on IBM Bluemix
Collaborative Line of Business Applications on IBM BluemixCollaborative Line of Business Applications on IBM Bluemix
Collaborative Line of Business Applications on IBM Bluemix
 
APIdays Paris - How to Build Your Web API
APIdays Paris - How to Build Your Web APIAPIdays Paris - How to Build Your Web API
APIdays Paris - How to Build Your Web API
 
MCA 6th Sem Project Report
MCA 6th Sem Project ReportMCA 6th Sem Project Report
MCA 6th Sem Project Report
 

Recently uploaded

scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
HenryBriggs2
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
mphochane1998
 
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
Health
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
MsecMca
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
Neometrix_Engineering_Pvt_Ltd
 

Recently uploaded (20)

Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
Rums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdfRums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdf
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Bridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptxBridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptx
 

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