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

More Related Content

Viewers also liked

Structuring apps in Scala
Structuring apps in ScalaStructuring apps in Scala
Structuring apps in ScalaPhil Calçado
 
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 FunctionPhil 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 appPhil Calçado
 
Evolutionary Architecture at Work
Evolutionary  Architecture at WorkEvolutionary  Architecture at Work
Evolutionary Architecture at WorkPhil Calçado
 
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 FoodPhil Calçado
 
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 FunctionPhil Calçado
 
Finagle @ SoundCloud
Finagle @ SoundCloudFinagle @ SoundCloud
Finagle @ SoundCloudPhil Calçado
 
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 2015Phil Calçado
 
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 OrganisationsPhil 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
 
Tech Talk: Wozu Clean Code?
Tech Talk: Wozu Clean Code?Tech Talk: Wozu Clean Code?
Tech Talk: Wozu Clean Code?leanovate GmbH
 

Viewers also liked (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 to Applying Evolutionary Architecture on a Popular API

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...New Relic
 
Ruby como-lenguaje-de-programacion
Ruby como-lenguaje-de-programacionRuby como-lenguaje-de-programacion
Ruby como-lenguaje-de-programacionEmmanuel Delgado
 
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 2009Boris Mann
 
Symfony2 and MongoDB - MidwestPHP 2013
Symfony2 and MongoDB - MidwestPHP 2013   Symfony2 and MongoDB - MidwestPHP 2013
Symfony2 and MongoDB - MidwestPHP 2013 Pablo Godel
 
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]Jason Rhodes
 
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]Jason Rhodes
 
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 BonillaCodemotion
 
Microservices and functional programming
Microservices and functional programmingMicroservices and functional programming
Microservices and functional programmingMichael Neale
 
Aloha on-rails-2009
Aloha on-rails-2009Aloha on-rails-2009
Aloha on-rails-2009John Woodell
 
Vital.AI Creating Intelligent Apps
Vital.AI Creating Intelligent AppsVital.AI Creating Intelligent Apps
Vital.AI Creating Intelligent AppsVital.AI
 
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 SchlossnagleChef Software, Inc.
 
Riak intro to..
Riak intro to..Riak intro to..
Riak intro to..Adron Hall
 
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 GovernmentC4Media
 
Matt training-html-halfday
Matt training-html-halfdayMatt training-html-halfday
Matt training-html-halfdayMatthew Dobson
 
Strata lightening-talk
Strata lightening-talkStrata lightening-talk
Strata lightening-talkDanny Yuan
 

Similar to 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 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
 
Drupal for enterprise
Drupal for enterpriseDrupal for enterprise
Drupal for enterprise
 

More from 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 hypergrowthPhil 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 leaderPhil Calçado
 
The Economics of Microservices (redux)
The Economics of Microservices (redux)The Economics of Microservices (redux)
The Economics of Microservices (redux)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 2019Phil 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 ServerlessPhil Calçado
 
Ten Years of Failing Microservices
Ten Years of Failing MicroservicesTen Years of Failing Microservices
Ten Years of Failing MicroservicesPhil Calçado
 
The Next Generation of Microservices
The Next Generation of MicroservicesThe Next Generation of Microservices
The Next Generation of MicroservicesPhil Calçado
 
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 BrisbanePhil Calçado
 
The Economics of Microservices (2017 CraftConf)
The Economics of Microservices  (2017 CraftConf)The Economics of Microservices  (2017 CraftConf)
The Economics of Microservices (2017 CraftConf)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 UsersPhil Calçado
 
(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 DevelopmentPhil 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 productsPhil Calçado
 
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...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 WorkPhil Calçado
 

More from 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
 

Recently uploaded

Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 

Recently uploaded (20)

Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 

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