SlideShare uma empresa Scribd logo
1 de 71
Baixar para ler offline
Taming Monolithic Monsters

@gavinjoyce
Need help building
something ambitious?
gavinjoyce@gmail.com
What’s the Problem?
What’s the Problem?
● Rails apps don’t scale
What’s the Problem?
● Rails apps don’t scale
● Rails apps do scale:
What’s the Problem?
● Rails apps don’t scale
● Rails apps do scale:
○ Web servers are cheap
What’s the Problem?
● Rails apps don’t scale
● Rails apps do scale:
○ Web servers are cheap
○ Engineers are expensive
What’s the Problem?
● Rails apps don’t scale
● Rails apps do scale:
○ Web servers are cheap
○ Engineers are expensive
○ Rails is optimised to save engineering time
What’s the Problem?
● Rails apps don’t scale
● Rails apps do scale:
○ Web servers are cheap
○ Engineers are expensive
○ Rails is optimised to save engineering time
○ not the full story...
What’s the Problem?
In my experience:
● Large rails apps are hard to scale
What’s the Problem?
In my experience:
● Large rails apps are hard to scale:
○ Team size
What’s the Problem?
In my experience:
● Large rails apps are hard to scale:
○ Team size
■ code base complexity
What’s the Problem?
In my experience:
● Large rails apps are hard to scale:
○ Team size
■ code base complexity
■ brittleness due to tight coupling between
models
What’s the Problem?
In my experience:
● Large rails apps are hard to scale:
○ Team size
■ code base complexity
■ brittleness due to tight coupling between
models
○ TDD feedback time
Mutations Gem
github.com/cypriss/mutations
Mutations Gem
github.com/cypriss/mutations

● Compose your business logic into
commands that sanitize and validate input
Mutations Gem
github.com/cypriss/mutations

● Compose your business logic into
commands that sanitize and validate input
● Write safe, reusable, and maintainable
code for Ruby and Rails apps
Defining a Mutations Command
Using a Mutations Command
demo - simple mutation command
Mutations in your app
Mutations in your app
● create an internal api
Mutations in your app
● create an internal api
○ logically isolate key business logic
Mutations in RestPack
Mutations in RestPack

https://github.com/restpack
Mutations in RestPack
Mutations in RestPack
● Services are packaged as gems
Mutations in RestPack
● Services are packaged as gems:
○ Commands
Mutations in RestPack
● Services are packaged as gems:
○ Commands
○ Serialisers
Mutations in RestPack
● Services are packaged as gems:
○ Commands
○ Serialisers
○ Models
Mutations in RestPack
● Services are packaged as gems:
○ Commands
○ Serialisers
○ Models
○ Migrations
Mutations in RestPack
● Services are packaged as gems:
○ Commands
○ Serialisers
○ Models
○ Migrations
○ Specs
Mutations in RestPack
● Services are packaged as gems:
○ Commands
○ Serialisers
○ Models
○ Migrations
○ Specs
● Commands are the public interface
Mutations in RestPack
● Services are packaged as gems:
○ Commands
○ Serialisers
○ Models
○ Migrations
○ Specs
● Commands are the public interface
○ either Ruby or REST
RestPack Service Gem Anatomy
RestPack Service Gem Anatomy

DB
RestPack Service Gem Anatomy

rake restpack:migrate
DB
RestPack Service Gem Anatomy

models

rake restpack:migrate
DB
RestPack Service Gem Anatomy

models

ActiveRecord models

rake restpack:migrate
DB
RestPack Service Gem Anatomy

serialisers

models

ActiveRecord models

rake restpack:migrate
DB
RestPack Service Gem Anatomy

serialisers

RestPack::Serializer gem

models

ActiveRecord models

rake restpack:migrate
DB
RestPack Service Gem Anatomy
commands

serialisers

RestPack::Serializer gem

models

ActiveRecord models

rake restpack:migrate
DB
RestPack Service Gem Anatomy
commands

Mutations gem

serialisers

RestPack::Serializer gem

models

ActiveRecord models

rake restpack:migrate
DB
RestPack Service Gem Anatomy

code demo - restpack_activity_service
https://github.com/RestPack/restpack_activity_service
Using service gems from Rails

A first attempt….
Activity Service Gem

DB
actv.io rails app
Activity Controller

Host Ruby Application

Activity Service Gem

DB
actv.io rails app
Activity Controller

Host Ruby Application

Activity Clent Gem

Activity Service Gem

DB
actv.io rails app
Activity Controller

Activity Model

Host Ruby Application

Activity Clent Gem

Activity Service Gem

DB
actv.io rails app
Activity Controller

Activity Model

Host Ruby Application

Activity Clent Gem

Local Proxy

Activity Service Gem

DB
actv.io rails app

Host Ruby Application

Activity Controller

Activity Model

Local Proxy

Activity Clent Gem
API Proxy
REST
API

Activity Service Gem

DB
demo - Rails App
actv.io rails app

Host Ruby Application

Activity Controller

Activity Model

Local Proxy

Activity Clent Gem
API Proxy
REST
API

Activity Service Gem

DB
No need for Rails, the API is
the server application

API
No need for Rails, the API is
the server application
Android App

API
No need for Rails, the API is
the server application
Android App

iOS App

API
No need for Rails, the API is
the server application
Web App

Android App

iOS App

API
No need for Rails, the API is
the server application
Web App

Android App

iOS App

API

... App
... App
... App
api.restpack.org
api.restpack.org

DB
Core
api.restpack.org

DB

DB

Core

Users
api.restpack.org

DB

DB

DB

Core

Users

Groups
api.restpack.org

DB

DB

DB

DB

Core

Users

Groups

Account
api.restpack.org

Job
Q

DB

DB

DB

DB

DB

Core

Users

Groups

Account

Email

Redis
Apply Security Policy
api.restpack.org

Job
Q

DB

DB

DB

DB

DB

Core

Users

Groups

Account

Email

Redis
dashboard.restpack.org

Apply Security Policy
api.restpack.org

Job
Q

DB

DB

DB

DB

DB

Core

Users

Groups

Account

Email

Redis
3rd Party Applications
3rd Party Applications
3rd Party Applications
3rd Party Applications

dashboard.restpack.org

Apply Security Policy
api.restpack.org

Job
Q

DB

DB

DB

DB

DB

Core

Users

Groups

Account

Email

Redis
demo - Ember.js App
1 Application, 1 DB

dashboard.restpack.org

api.restpack.org

Job
Q

DB

Redis
Many Applications, Many DBs

dashboard.restpack.org

Apply Security Policy

api.restpack.org

API

API

API

API

API

Job
Q

DB

DB

DB

DB

DB

Core

Users

Groups

Account

Email

Redis
Questions?

@gavinjoyce
github.com/RestPack

Mais conteúdo relacionado

Mais procurados

Rails project code review
Rails project code reviewRails project code review
Rails project code review
Richard Huang
 
Netapp Michael Galpin
Netapp Michael GalpinNetapp Michael Galpin
Netapp Michael Galpin
rajivmordani
 

Mais procurados (20)

Rails project code review
Rails project code reviewRails project code review
Rails project code review
 
Rails bestpractices.com
Rails bestpractices.comRails bestpractices.com
Rails bestpractices.com
 
2010-07-19_rails_tdd_week1
2010-07-19_rails_tdd_week12010-07-19_rails_tdd_week1
2010-07-19_rails_tdd_week1
 
Graphql
GraphqlGraphql
Graphql
 
Wax on, wax off
Wax on, wax offWax on, wax off
Wax on, wax off
 
Streamlined Geek Talk
Streamlined Geek TalkStreamlined Geek Talk
Streamlined Geek Talk
 
Reasonable app development
Reasonable app developmentReasonable app development
Reasonable app development
 
Alfresco Development Framework Basic
Alfresco Development Framework BasicAlfresco Development Framework Basic
Alfresco Development Framework Basic
 
Managing the flow of asynchronous operations in Node.js - SFNode
Managing the flow of asynchronous operations in Node.js - SFNodeManaging the flow of asynchronous operations in Node.js - SFNode
Managing the flow of asynchronous operations in Node.js - SFNode
 
Avoiding integration hell
Avoiding integration hellAvoiding integration hell
Avoiding integration hell
 
Capybara + RSpec - ruby dsl-based web ui qa automation
Capybara + RSpec - ruby dsl-based web ui qa automationCapybara + RSpec - ruby dsl-based web ui qa automation
Capybara + RSpec - ruby dsl-based web ui qa automation
 
Netapp Michael Galpin
Netapp Michael GalpinNetapp Michael Galpin
Netapp Michael Galpin
 
Kohainstallationwin 1231400749704906-2
Kohainstallationwin 1231400749704906-2Kohainstallationwin 1231400749704906-2
Kohainstallationwin 1231400749704906-2
 
Agile North East Agile + DevOps by Craig Pearson of CAP Project Services
Agile North East Agile + DevOps by Craig Pearson of CAP Project ServicesAgile North East Agile + DevOps by Craig Pearson of CAP Project Services
Agile North East Agile + DevOps by Craig Pearson of CAP Project Services
 
Intro to rails 2_kg_edited
Intro to rails 2_kg_editedIntro to rails 2_kg_edited
Intro to rails 2_kg_edited
 
Continuous Delivery - Voxxed Days Bucharest 2017
Continuous Delivery - Voxxed Days Bucharest 2017Continuous Delivery - Voxxed Days Bucharest 2017
Continuous Delivery - Voxxed Days Bucharest 2017
 
Review of Igalia's Contribution to WebKit (2018 WebKit Contributors Meeting)
Review of Igalia's Contribution to WebKit (2018 WebKit Contributors Meeting)Review of Igalia's Contribution to WebKit (2018 WebKit Contributors Meeting)
Review of Igalia's Contribution to WebKit (2018 WebKit Contributors Meeting)
 
API Test Automation Using Karate (Anil Kumar Moka)
API Test Automation Using Karate (Anil Kumar Moka)API Test Automation Using Karate (Anil Kumar Moka)
API Test Automation Using Karate (Anil Kumar Moka)
 
AWS Fargate AWS UG Dormund 2019 Kazulkin Jung
AWS Fargate AWS UG Dormund 2019 Kazulkin JungAWS Fargate AWS UG Dormund 2019 Kazulkin Jung
AWS Fargate AWS UG Dormund 2019 Kazulkin Jung
 
Keep your projects up-to-date
Keep your projects up-to-dateKeep your projects up-to-date
Keep your projects up-to-date
 

Destaque

Evaluation question improvement
Evaluation question  improvementEvaluation question  improvement
Evaluation question improvement
14150934
 
Ruby and Rails, as secret weapon to build your service-oriented apps
Ruby and Rails,  as secret weapon to build your service-oriented appsRuby and Rails,  as secret weapon to build your service-oriented apps
Ruby and Rails, as secret weapon to build your service-oriented apps
Felipe Talavera
 
Ember.js internals backburner.js and rsvp.js
Ember.js internals  backburner.js and rsvp.jsEmber.js internals  backburner.js and rsvp.js
Ember.js internals backburner.js and rsvp.js
gavinjoyce
 
Ember.js drum machine
Ember.js drum machineEmber.js drum machine
Ember.js drum machine
gavinjoyce
 

Destaque (14)

legacy
legacylegacy
legacy
 
Evaluation question improvement
Evaluation question  improvementEvaluation question  improvement
Evaluation question improvement
 
Get the best from your smartphone - save battery, save data and increase secu...
Get the best from your smartphone - save battery, save data and increase secu...Get the best from your smartphone - save battery, save data and increase secu...
Get the best from your smartphone - save battery, save data and increase secu...
 
Thera greece
Thera greeceThera greece
Thera greece
 
Recruiting new customers thanks to Google and Social Networks
Recruiting new customers thanks to Google and Social NetworksRecruiting new customers thanks to Google and Social Networks
Recruiting new customers thanks to Google and Social Networks
 
Ruby and Rails, as secret weapon to build your service-oriented apps
Ruby and Rails,  as secret weapon to build your service-oriented appsRuby and Rails,  as secret weapon to build your service-oriented apps
Ruby and Rails, as secret weapon to build your service-oriented apps
 
Ropa presentación
Ropa presentaciónRopa presentación
Ropa presentación
 
SMF 171213 - 5 Social Media Trends for 2014
SMF 171213 - 5 Social Media Trends for 2014 SMF 171213 - 5 Social Media Trends for 2014
SMF 171213 - 5 Social Media Trends for 2014
 
Ember.js internals backburner.js and rsvp.js
Ember.js internals  backburner.js and rsvp.jsEmber.js internals  backburner.js and rsvp.js
Ember.js internals backburner.js and rsvp.js
 
Gallo kiriko montaje
Gallo kiriko montajeGallo kiriko montaje
Gallo kiriko montaje
 
Ember.js drum machine
Ember.js drum machineEmber.js drum machine
Ember.js drum machine
 
Li fi
Li fi Li fi
Li fi
 
Anhidridos
AnhidridosAnhidridos
Anhidridos
 
Succession “Losers”: What Happens to Executives Passed Over for the CEO Job?
Succession “Losers”: What Happens to Executives Passed Over for the CEO Job? Succession “Losers”: What Happens to Executives Passed Over for the CEO Job?
Succession “Losers”: What Happens to Executives Passed Over for the CEO Job?
 

Semelhante a Taming monolithic monsters

Ruby and Rails short motivation
Ruby and Rails short motivationRuby and Rails short motivation
Ruby and Rails short motivation
jistr
 
Web Development using Ruby on Rails
Web Development using Ruby on RailsWeb Development using Ruby on Rails
Web Development using Ruby on Rails
Avi Kedar
 
Enterprise Architectures with Ruby (and Rails)
Enterprise Architectures with Ruby (and Rails)Enterprise Architectures with Ruby (and Rails)
Enterprise Architectures with Ruby (and Rails)
Konstantin Gredeskoul
 

Semelhante a Taming monolithic monsters (20)

Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Rails
 
2011-02-03 LA RubyConf Rails3 TDD Workshop
2011-02-03 LA RubyConf Rails3 TDD Workshop2011-02-03 LA RubyConf Rails3 TDD Workshop
2011-02-03 LA RubyConf Rails3 TDD Workshop
 
Modular Web Applications With Netzke
Modular Web Applications With NetzkeModular Web Applications With Netzke
Modular Web Applications With Netzke
 
Real-time GraphQL API with minimum coding and maximum benefit
 Real-time GraphQL API with minimum coding and maximum benefit Real-time GraphQL API with minimum coding and maximum benefit
Real-time GraphQL API with minimum coding and maximum benefit
 
React on rails v6.1 at LA Ruby, November 2016
React on rails v6.1 at LA Ruby, November 2016React on rails v6.1 at LA Ruby, November 2016
React on rails v6.1 at LA Ruby, November 2016
 
Ruby and Rails short motivation
Ruby and Rails short motivationRuby and Rails short motivation
Ruby and Rails short motivation
 
Fisl - Deployment
Fisl - DeploymentFisl - Deployment
Fisl - Deployment
 
Performance and Scalability Art of Isomorphic React Applications
Performance and Scalability Art of Isomorphic React ApplicationsPerformance and Scalability Art of Isomorphic React Applications
Performance and Scalability Art of Isomorphic React Applications
 
Born in the Cloud, Built like a Startup
Born in the Cloud, Built like a StartupBorn in the Cloud, Built like a Startup
Born in the Cloud, Built like a Startup
 
RubyEnRails2007 - Dr Nic Williams - Keynote
RubyEnRails2007 - Dr Nic Williams - KeynoteRubyEnRails2007 - Dr Nic Williams - Keynote
RubyEnRails2007 - Dr Nic Williams - Keynote
 
Presto + Alluxio on steroids a romantic drama on Production with happy end
Presto + Alluxio on steroids a romantic drama on Production with happy endPresto + Alluxio on steroids a romantic drama on Production with happy end
Presto + Alluxio on steroids a romantic drama on Production with happy end
 
Rails for Django developers
Rails for Django developersRails for Django developers
Rails for Django developers
 
Matt Franklin - Apache Software (Geekfest)
Matt Franklin - Apache Software (Geekfest)Matt Franklin - Apache Software (Geekfest)
Matt Franklin - Apache Software (Geekfest)
 
Web Development using Ruby on Rails
Web Development using Ruby on RailsWeb Development using Ruby on Rails
Web Development using Ruby on Rails
 
Let's Get to the Rapids
Let's Get to the RapidsLet's Get to the Rapids
Let's Get to the Rapids
 
The new Netflix API
The new Netflix APIThe new Netflix API
The new Netflix API
 
React on rails v4
React on rails v4React on rails v4
React on rails v4
 
Reactive Microservices with Quarkus
Reactive Microservices with QuarkusReactive Microservices with Quarkus
Reactive Microservices with Quarkus
 
Enterprise Architectures with Ruby (and Rails)
Enterprise Architectures with Ruby (and Rails)Enterprise Architectures with Ruby (and Rails)
Enterprise Architectures with Ruby (and Rails)
 
Fearless From Monolith to Serverless with Dynatrace
Fearless From Monolith to Serverless with DynatraceFearless From Monolith to Serverless with Dynatrace
Fearless From Monolith to Serverless with Dynatrace
 

Último

Último (20)

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 

Taming monolithic monsters