SlideShare una empresa de Scribd logo
1 de 45
Descargar para leer sin conexión
Wednesday, March 6, 13
Applying Evolutionary
                           Architecture on a
                             Popular API
                                   phil calçado
                                    @pcalcado
                             http://philcalcado.com

                   QCon London Session Code: 1603
Wednesday, March 6, 13
Wednesday, March 6, 13
Wednesday, March 6, 13
> 50K registered
                            client apps
       ~ 180 million users / month
                           ~5 years old

Wednesday, March 6, 13
Wednesday, March 6, 13
API controllers        UI controllers




                                      domain logic




Wednesday, March 6, 13
http://bit.ly/building-the-next-soundcloud

Wednesday, March 6, 13
API controllers        UI controllers




                                      domain logic




Wednesday, March 6, 13
UI controllers




                                           internet




                         API controllers




                                      domain logic



Wednesday, March 6, 13
a new platform while
                          keeping the old one
                               running?



Wednesday, March 6, 13
WARNING:
                              THIS IS
                         WORK IN PROGRESS
                         and you can help us ;)
                           http://bit.ly/work-at-soundcloud



Wednesday, March 6, 13
DO NOT BREAK
                          CLIENT APPS




Wednesday, March 6, 13
separate
                          application
                         from domain



Wednesday, March 6, 13
Classic        Next
               SoundCloud    SoundCloud

          A set is a         A set is a
         collection of      collection of
          your own           your own
           sounds             sounds




Wednesday, March 6, 13
Classic                        Next
               SoundCloud                    SoundCloud

          A set is a                         A set is a
         collection of                      collection of
          your own                           your own
           sounds                             sounds
                             SoundCloud
                                API
                             A set is a
                            collection of
                              sounds
Wednesday, March 6, 13
UI controllers




                                           internet




                         API controllers




                                      domain logic



Wednesday, March 6, 13
UI controllers




                                           internet




                                        API controllers




                         domain logic    domain logic     domain logic


Wednesday, March 6, 13
applications enforce their
               own business rules

             domain enforces “global”
                      rules



Wednesday, March 6, 13
applications enforce their
               own business rules

             domain enforces “global”
                      rules

                         (accidents happen...)
Wednesday, March 6, 13
how to add/change
                         features on the fly?



Wednesday, March 6, 13
attempt #1:
                    identify “official” apps


            - too easy to spoof
            - abused by spammers
            - Android and iOS can’t easily
            rotate secrets

Wednesday, March 6, 13
attempt #2:
                         namespace endpoints

            - “experimental” endpoints
            would link to regular ones but
            never be linked back
            - toyed with “lifted”
            hyperlinks, not enough time
            for launch
Wednesday, March 6, 13
attempt #3:
                         just use feature flags
            - works ok for logged in users

            - system is a little monster
            now, and ruby is not very
            good with numbers. rewriting
            in scala


Wednesday, March 6, 13
SPLITTING THE
                          MOTHERSHIP




Wednesday, March 6, 13
define internal protocols



Wednesday, March 6, 13
micro-services
            - couple thousands lines of code

            - mostly JVM-based, JRuby, Clojure
            and Scala

            - more about this at the SoundCoud
            pub night tomorrow: http://
            lanyrd.com/2013/soundcloudpub/
            (Walrus Pub Waterloo)
Wednesday, March 6, 13
HTTP+JSON & AMQP
                            for most stuff
            - moving AMQP usage for
            event broadcasting, as
            opposed to messaging

            - no internal HTTP caching
            (yet?)

Wednesday, March 6, 13
make it easy to get stuff in
                   prod

            - heroku-like deployment
            system

            - tending towards twitter
            stack (Finagle) for I/O

Wednesday, March 6, 13
URNs, not IDs

                    soundcloud:sounds:123




Wednesday, March 6, 13
URNs, not IDs
            - everything addressable has
            a URN, some have URLs

            - Mapping depends on
            context, e.g. given object may
            have a public URL and an
            internal URL
Wednesday, March 6, 13
<3 hypermedia

            - can easily remove things
            from the main app without
            breaking clients, just some
            HTTP 303s


Wednesday, March 6, 13
OPTIMISE ALL
                         THE THINGS!!11!




Wednesday, March 6, 13
twitter moving back to
                     server rendering...?



Wednesday, March 6, 13
not too bad, actually


            - besides load balancers vs.
            increase in number of
            requests per page


            http://backstage.soundcloud.com/2012/08/evolution-of-soundclouds-
                                       architecture/
Wednesday, March 6, 13
the actual problems
            - number of requests from
            Next keeps increasing, page
            load affected
            - very different behaviour
            depending on the client app


Wednesday, March 6, 13
UI controllers




                                           internet




                                        API controllers




                         domain logic    domain logic     domain logic


Wednesday, March 6, 13
UI controllers




                            internet




                         API controllers




Wednesday, March 6, 13
attempt #1:
                   optmising proxy for clients
                                        UI controllers




                                           internet




                                             Proxy




                                        API controllers




                         domain logic    domain logic     domain logic


Wednesday, March 6, 13
attempt #1:
                   optmising proxy for clients

            - still leverage public API
            - API has to know about how
            things behave in different
            clients


Wednesday, March 6, 13
attempt #2:
        specialised back-end for official
                     clients
                                        UI controllers




                                           internet




                                         Specialised
                                                         API controllers
                                          Back-end




                         domain logic    domain logic    domain logic




Wednesday, March 6, 13
attempt #2:
        specialised back-end for official
                     clients
            - each official app has its own back-
            end facade
            - no rendering, just data
            - public API becomes just one of
            them
            - front-end heavy teams can just
            script a common core using JRuby
Wednesday, March 6, 13
NEXT STEPS




Wednesday, March 6, 13
what we are looking at

            - dataflow programming for the
            specialised back-ends

            - ProtocolBuffers for Android

            - make the mothership just a back-
            end service, not exposed to the
            Internet

Wednesday, March 6, 13
phil calçado


                         http://philcalcado.com
                               @pcalcado



                              www.soundcloud.com




Wednesday, March 6, 13

Más contenido relacionado

Destacado

Structuring apps in Scala
Structuring apps in ScalaStructuring apps in Scala
Structuring apps in Scala
Phil Calçado
 
An example of Future composition in a real app
An example of Future composition in a real appAn example of Future composition in a real app
An example of Future composition in a real app
Phil Calçado
 
Evolutionary Architecture at Work
Evolutionary  Architecture at WorkEvolutionary  Architecture at Work
Evolutionary Architecture at Work
Phil Calçado
 
Microservices vs. The First Law of Distributed Objects - GOTO Nights Chicago ...
Microservices vs. The First Law of Distributed Objects - GOTO Nights Chicago ...Microservices vs. The First Law of Distributed Objects - GOTO Nights Chicago ...
Microservices vs. The First Law of Distributed Objects - GOTO Nights Chicago ...
Phil Calçado
 

Destacado (12)

Structuring apps in Scala
Structuring apps in ScalaStructuring apps in Scala
Structuring apps in Scala
 
Rhein-Main Scala Enthusiasts — Your microservice as a Function
Rhein-Main Scala Enthusiasts — Your microservice as a FunctionRhein-Main Scala Enthusiasts — Your microservice as a Function
Rhein-Main Scala Enthusiasts — Your microservice as a Function
 
An example of Future composition in a real app
An example of Future composition in a real appAn example of Future composition in a real app
An example of Future composition in a real app
 
Evolutionary Architecture at Work
Evolutionary  Architecture at WorkEvolutionary  Architecture at Work
Evolutionary Architecture at Work
 
APIs: The Problems with Eating your Own Dog Food
APIs: The Problems with Eating your Own Dog FoodAPIs: The Problems with Eating your Own Dog Food
APIs: The Problems with Eating your Own Dog Food
 
ScalaItaly 2015 - Your Microservice as a Function
ScalaItaly 2015 - Your Microservice as a FunctionScalaItaly 2015 - Your Microservice as a Function
ScalaItaly 2015 - Your Microservice as a Function
 
Finagle @ SoundCloud
Finagle @ SoundCloudFinagle @ SoundCloud
Finagle @ SoundCloud
 
Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015
Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015
Three Years of Microservices at SoundCloud - Distributed Matters Berlin 2015
 
A Brief Talk On High-Performing Organisations
A Brief Talk On High-Performing OrganisationsA Brief Talk On High-Performing Organisations
A Brief Talk On High-Performing Organisations
 
Concepts of Code Quality
Concepts of Code QualityConcepts of Code Quality
Concepts of Code Quality
 
Microservices vs. The First Law of Distributed Objects - GOTO Nights Chicago ...
Microservices vs. The First Law of Distributed Objects - GOTO Nights Chicago ...Microservices vs. The First Law of Distributed Objects - GOTO Nights Chicago ...
Microservices vs. The First Law of Distributed Objects - GOTO Nights Chicago ...
 
Tech Talk: Wozu Clean Code?
Tech Talk: Wozu Clean Code?Tech Talk: Wozu Clean Code?
Tech Talk: Wozu Clean Code?
 

Similar a Applying Evolutionary Architecture on a Popular API

Ruby como-lenguaje-de-programacion
Ruby como-lenguaje-de-programacionRuby como-lenguaje-de-programacion
Ruby como-lenguaje-de-programacion
Emmanuel Delgado
 
Aloha on-rails-2009
Aloha on-rails-2009Aloha on-rails-2009
Aloha on-rails-2009
John Woodell
 
Riak intro to..
Riak intro to..Riak intro to..
Riak intro to..
Adron Hall
 
Matt training-html-halfday
Matt training-html-halfdayMatt training-html-halfday
Matt training-html-halfday
Matthew Dobson
 

Similar a Applying Evolutionary Architecture on a Popular API (20)

FUTURESTACK13: Mobile Apps, A DevOps Way from Jonathan Karon, Engineering Man...
FUTURESTACK13: Mobile Apps, A DevOps Way from Jonathan Karon, Engineering Man...FUTURESTACK13: Mobile Apps, A DevOps Way from Jonathan Karon, Engineering Man...
FUTURESTACK13: Mobile Apps, A DevOps Way from Jonathan Karon, Engineering Man...
 
Ruby como-lenguaje-de-programacion
Ruby como-lenguaje-de-programacionRuby como-lenguaje-de-programacion
Ruby como-lenguaje-de-programacion
 
Practical Semantic Web and Why You Should Care - DrupalCon DC 2009
Practical Semantic Web and Why You Should Care - DrupalCon DC 2009Practical Semantic Web and Why You Should Care - DrupalCon DC 2009
Practical Semantic Web and Why You Should Care - DrupalCon DC 2009
 
Symfony2 and MongoDB - MidwestPHP 2013
Symfony2 and MongoDB - MidwestPHP 2013   Symfony2 and MongoDB - MidwestPHP 2013
Symfony2 and MongoDB - MidwestPHP 2013
 
The Testable Web
The Testable WebThe Testable Web
The Testable Web
 
The WordPress Hacker's Guide to the \Galaxy() [@MidwestPHP]
The WordPress Hacker's Guide to the \Galaxy() [@MidwestPHP]The WordPress Hacker's Guide to the \Galaxy() [@MidwestPHP]
The WordPress Hacker's Guide to the \Galaxy() [@MidwestPHP]
 
The WordPress Hacker's Guide to the \Galaxy() [@Baltimore PHP]
The WordPress Hacker's Guide to the \Galaxy() [@Baltimore PHP]The WordPress Hacker's Guide to the \Galaxy() [@Baltimore PHP]
The WordPress Hacker's Guide to the \Galaxy() [@Baltimore PHP]
 
Wphackergalaxy
WphackergalaxyWphackergalaxy
Wphackergalaxy
 
How to build an ecosystem for developers by David Bonilla
How to build an ecosystem for developers by David BonillaHow to build an ecosystem for developers by David Bonilla
How to build an ecosystem for developers by David Bonilla
 
Microservices and functional programming
Microservices and functional programmingMicroservices and functional programming
Microservices and functional programming
 
Aloha on-rails-2009
Aloha on-rails-2009Aloha on-rails-2009
Aloha on-rails-2009
 
Infrastructure as Code with Chef / Puppet
Infrastructure as Code with Chef / PuppetInfrastructure as Code with Chef / Puppet
Infrastructure as Code with Chef / Puppet
 
Vital.AI Creating Intelligent Apps
Vital.AI Creating Intelligent AppsVital.AI Creating Intelligent Apps
Vital.AI Creating Intelligent Apps
 
Rails Intro & Tutorial
Rails Intro & TutorialRails Intro & Tutorial
Rails Intro & Tutorial
 
The InstallShield of the 21st Century – Theo Schlossnagle
The InstallShield of the 21st Century – Theo SchlossnagleThe InstallShield of the 21st Century – Theo Schlossnagle
The InstallShield of the 21st Century – Theo Schlossnagle
 
Riak intro to..
Riak intro to..Riak intro to..
Riak intro to..
 
Green Shoots in the Brownest Field: Being a Startup in Government
Green Shoots in the Brownest Field: Being a Startup in GovernmentGreen Shoots in the Brownest Field: Being a Startup in Government
Green Shoots in the Brownest Field: Being a Startup in Government
 
Storyplayer
StoryplayerStoryplayer
Storyplayer
 
Matt training-html-halfday
Matt training-html-halfdayMatt training-html-halfday
Matt training-html-halfday
 
Strata lightening-talk
Strata lightening-talkStrata lightening-talk
Strata lightening-talk
 

Más de Phil Calçado

the afterparty: refactoring after 100x hypergrowth
the afterparty: refactoring after 100x hypergrowththe afterparty: refactoring after 100x hypergrowth
the afterparty: refactoring after 100x hypergrowth
Phil Calçado
 
don't try this at home: self-improvement as a senior leader
don't try this at home: self-improvement as a senior leaderdon't try this at home: self-improvement as a senior leader
don't try this at home: self-improvement as a senior leader
Phil Calçado
 
From microservices to serverless - Chicago CTO Summit 2019
From microservices to serverless - Chicago CTO Summit 2019From microservices to serverless - Chicago CTO Summit 2019
From microservices to serverless - Chicago CTO Summit 2019
Phil Calçado
 
The Not-So-Straightforward Road From Microservices to Serverless
The Not-So-Straightforward Road From Microservices to ServerlessThe Not-So-Straightforward Road From Microservices to Serverless
The Not-So-Straightforward Road From Microservices to Serverless
Phil Calçado
 
[GOTO Copenhagen 2012] The Startup Hangover: Supporting 15 mil Users
[GOTO Copenhagen 2012] The Startup Hangover: Supporting 15 mil Users[GOTO Copenhagen 2012] The Startup Hangover: Supporting 15 mil Users
[GOTO Copenhagen 2012] The Startup Hangover: Supporting 15 mil Users
Phil Calçado
 
(In Portuguese) Seu produto é um sucesso, e agora? desafios técnicos que uma...
(In Portuguese) Seu produto é um sucesso, e agora?  desafios técnicos que uma...(In Portuguese) Seu produto é um sucesso, e agora?  desafios técnicos que uma...
(In Portuguese) Seu produto é um sucesso, e agora? desafios técnicos que uma...
Phil Calçado
 
mistaeks i’ve made developing software products
mistaeks i’ve made developing software productsmistaeks i’ve made developing software products
mistaeks i’ve made developing software products
Phil Calçado
 
A Brief, Incomplete, and Mostly Wrong Introduction to Alan Turing's Work
A Brief, Incomplete, and Mostly Wrong Introduction to Alan Turing's WorkA Brief, Incomplete, and Mostly Wrong Introduction to Alan Turing's Work
A Brief, Incomplete, and Mostly Wrong Introduction to Alan Turing's Work
Phil Calçado
 

Más de Phil Calçado (15)

the afterparty: refactoring after 100x hypergrowth
the afterparty: refactoring after 100x hypergrowththe afterparty: refactoring after 100x hypergrowth
the afterparty: refactoring after 100x hypergrowth
 
don't try this at home: self-improvement as a senior leader
don't try this at home: self-improvement as a senior leaderdon't try this at home: self-improvement as a senior leader
don't try this at home: self-improvement as a senior leader
 
The Economics of Microservices (redux)
The Economics of Microservices (redux)The Economics of Microservices (redux)
The Economics of Microservices (redux)
 
From microservices to serverless - Chicago CTO Summit 2019
From microservices to serverless - Chicago CTO Summit 2019From microservices to serverless - Chicago CTO Summit 2019
From microservices to serverless - Chicago CTO Summit 2019
 
The Not-So-Straightforward Road From Microservices to Serverless
The Not-So-Straightforward Road From Microservices to ServerlessThe Not-So-Straightforward Road From Microservices to Serverless
The Not-So-Straightforward Road From Microservices to Serverless
 
Ten Years of Failing Microservices
Ten Years of Failing MicroservicesTen Years of Failing Microservices
Ten Years of Failing Microservices
 
The Next Generation of Microservices
The Next Generation of MicroservicesThe Next Generation of Microservices
The Next Generation of Microservices
 
The Next Generation of Microservices — YOW 2017 Brisbane
The Next Generation of Microservices — YOW 2017 BrisbaneThe Next Generation of Microservices — YOW 2017 Brisbane
The Next Generation of Microservices — YOW 2017 Brisbane
 
The Economics of Microservices (2017 CraftConf)
The Economics of Microservices  (2017 CraftConf)The Economics of Microservices  (2017 CraftConf)
The Economics of Microservices (2017 CraftConf)
 
[GOTO Copenhagen 2012] The Startup Hangover: Supporting 15 mil Users
[GOTO Copenhagen 2012] The Startup Hangover: Supporting 15 mil Users[GOTO Copenhagen 2012] The Startup Hangover: Supporting 15 mil Users
[GOTO Copenhagen 2012] The Startup Hangover: Supporting 15 mil Users
 
(v2.0) Better Functional Design Through Test-Driven Development
(v2.0) Better Functional Design Through Test-Driven Development(v2.0) Better Functional Design Through Test-Driven Development
(v2.0) Better Functional Design Through Test-Driven Development
 
(In Portuguese) Seu produto é um sucesso, e agora? desafios técnicos que uma...
(In Portuguese) Seu produto é um sucesso, e agora?  desafios técnicos que uma...(In Portuguese) Seu produto é um sucesso, e agora?  desafios técnicos que uma...
(In Portuguese) Seu produto é um sucesso, e agora? desafios técnicos que uma...
 
mistaeks i’ve made developing software products
mistaeks i’ve made developing software productsmistaeks i’ve made developing software products
mistaeks i’ve made developing software products
 
Berlin-Brandenburg Scala User Group: objects can still teach us one or two th...
Berlin-Brandenburg Scala User Group: objects can still teach us one or two th...Berlin-Brandenburg Scala User Group: objects can still teach us one or two th...
Berlin-Brandenburg Scala User Group: objects can still teach us one or two th...
 
A Brief, Incomplete, and Mostly Wrong Introduction to Alan Turing's Work
A Brief, Incomplete, and Mostly Wrong Introduction to Alan Turing's WorkA Brief, Incomplete, and Mostly Wrong Introduction to Alan Turing's Work
A Brief, Incomplete, and Mostly Wrong Introduction to Alan Turing's Work
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Último (20)

Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
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
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
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
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 

Applying Evolutionary Architecture on a Popular API

  • 2. Applying Evolutionary Architecture on a Popular API phil calçado @pcalcado http://philcalcado.com QCon London Session Code: 1603 Wednesday, March 6, 13
  • 5. > 50K registered client apps ~ 180 million users / month ~5 years old Wednesday, March 6, 13
  • 7. API controllers UI controllers domain logic Wednesday, March 6, 13
  • 9. API controllers UI controllers domain logic Wednesday, March 6, 13
  • 10. UI controllers internet API controllers domain logic Wednesday, March 6, 13
  • 11. a new platform while keeping the old one running? Wednesday, March 6, 13
  • 12. WARNING: THIS IS WORK IN PROGRESS and you can help us ;) http://bit.ly/work-at-soundcloud Wednesday, March 6, 13
  • 13. DO NOT BREAK CLIENT APPS Wednesday, March 6, 13
  • 14. separate application from domain Wednesday, March 6, 13
  • 15. Classic Next SoundCloud SoundCloud A set is a A set is a collection of collection of your own your own sounds sounds Wednesday, March 6, 13
  • 16. Classic Next SoundCloud SoundCloud A set is a A set is a collection of collection of your own your own sounds sounds SoundCloud API A set is a collection of sounds Wednesday, March 6, 13
  • 17. UI controllers internet API controllers domain logic Wednesday, March 6, 13
  • 18. UI controllers internet API controllers domain logic domain logic domain logic Wednesday, March 6, 13
  • 19. applications enforce their own business rules domain enforces “global” rules Wednesday, March 6, 13
  • 20. applications enforce their own business rules domain enforces “global” rules (accidents happen...) Wednesday, March 6, 13
  • 21. how to add/change features on the fly? Wednesday, March 6, 13
  • 22. attempt #1: identify “official” apps - too easy to spoof - abused by spammers - Android and iOS can’t easily rotate secrets Wednesday, March 6, 13
  • 23. attempt #2: namespace endpoints - “experimental” endpoints would link to regular ones but never be linked back - toyed with “lifted” hyperlinks, not enough time for launch Wednesday, March 6, 13
  • 24. attempt #3: just use feature flags - works ok for logged in users - system is a little monster now, and ruby is not very good with numbers. rewriting in scala Wednesday, March 6, 13
  • 25. SPLITTING THE MOTHERSHIP Wednesday, March 6, 13
  • 27. micro-services - couple thousands lines of code - mostly JVM-based, JRuby, Clojure and Scala - more about this at the SoundCoud pub night tomorrow: http:// lanyrd.com/2013/soundcloudpub/ (Walrus Pub Waterloo) Wednesday, March 6, 13
  • 28. HTTP+JSON & AMQP for most stuff - moving AMQP usage for event broadcasting, as opposed to messaging - no internal HTTP caching (yet?) Wednesday, March 6, 13
  • 29. make it easy to get stuff in prod - heroku-like deployment system - tending towards twitter stack (Finagle) for I/O Wednesday, March 6, 13
  • 30. URNs, not IDs soundcloud:sounds:123 Wednesday, March 6, 13
  • 31. URNs, not IDs - everything addressable has a URN, some have URLs - Mapping depends on context, e.g. given object may have a public URL and an internal URL Wednesday, March 6, 13
  • 32. <3 hypermedia - can easily remove things from the main app without breaking clients, just some HTTP 303s Wednesday, March 6, 13
  • 33. OPTIMISE ALL THE THINGS!!11! Wednesday, March 6, 13
  • 34. twitter moving back to server rendering...? Wednesday, March 6, 13
  • 35. not too bad, actually - besides load balancers vs. increase in number of requests per page http://backstage.soundcloud.com/2012/08/evolution-of-soundclouds- architecture/ Wednesday, March 6, 13
  • 36. the actual problems - number of requests from Next keeps increasing, page load affected - very different behaviour depending on the client app Wednesday, March 6, 13
  • 37. UI controllers internet API controllers domain logic domain logic domain logic Wednesday, March 6, 13
  • 38. UI controllers internet API controllers Wednesday, March 6, 13
  • 39. attempt #1: optmising proxy for clients UI controllers internet Proxy API controllers domain logic domain logic domain logic Wednesday, March 6, 13
  • 40. attempt #1: optmising proxy for clients - still leverage public API - API has to know about how things behave in different clients Wednesday, March 6, 13
  • 41. attempt #2: specialised back-end for official clients UI controllers internet Specialised API controllers Back-end domain logic domain logic domain logic Wednesday, March 6, 13
  • 42. attempt #2: specialised back-end for official clients - each official app has its own back- end facade - no rendering, just data - public API becomes just one of them - front-end heavy teams can just script a common core using JRuby Wednesday, March 6, 13
  • 44. what we are looking at - dataflow programming for the specialised back-ends - ProtocolBuffers for Android - make the mothership just a back- end service, not exposed to the Internet Wednesday, March 6, 13
  • 45. phil calçado http://philcalcado.com @pcalcado www.soundcloud.com Wednesday, March 6, 13