SlideShare a Scribd company logo
Scaling with Swagger

      Tony Tam
      @fehguy
Scaling is the Developer's Job

Was:
• Write code, make it work
• If it get slow, buy:
 •   Bigger server
 •   Bigger database
 •   "Enterprise" software support
Needs Harmony Between

• Software
• Data Tier
• Development Infrastructure
• Deployment Infrastructure
• Team
• Ability to manage it all
Needs Harmony Between

• Software
• Data Tier
• Development Infrastructure
• Deployment Infrastructure
• Team
• Ability to manage it Best Achieved
                       all
                       with Good
                      Architecture
Background


Biz
Tier


 Data
 Tier


  DBA
                     "Bee
                       n
Common Mistakes…

• "Let's organize by horizontal!"
• "Back end shouldn't care what front end
  does!"
• "Just get it launched and we'll scale with
  hardware"
• "You can scale transparently with
  technology X"
• "Get an Oracle consultant to speed things
  up"
Common Problems
• Overly complicated interfaces
 •   Abstracted too many times
 •   "We can switch out entities with a simple
     configuration!"
• Over-abstracted
 •   "We might need to change database vendors so
     abstract the SQL layer"
• Over designed
 •   "We don't know how the client will call, so support
     all possible calls!"
Solutions

• Many Possible
 •   Some suck, some good
• Let's look at Wordnik
Directionally Speaking

• Go Vertical!
 •   Ability to understand full lifecycle
 •   APIs as the communication of choice
 •   General convergence on developers
     •   Databases (MongoDB, Cassandra, Dynamo)
     •   API frameworks
• IT & QA are disappearing
 •   Wordnik currently has *none*
 •   Team, infrastructure, discipline *win*
Directionally Speaking

• Go Vertical!
 •   Ability to understand full lifecycle
 •   APIs as the communication of choice
 •   General convergence on developers
                                Still Room
     •   Databases (MongoDB, Cassandra, Dynamo)
                               to specialize
     •   API frameworks
• IT & QA are disappearing
 •   Wordnik currently has *none*
 •   Team, infrastructure, discipline *win*
Vertical, Explained

• Big application => micro services


Monolithic
application



    "Isn't this
       just
     SOA?"
Not SOA
• This is different
  •   No proprietary message bus
  •   Decoupled objects
  •   Dedicated storage***
• Speak REST
  •   Develop your services in…
      •   Java
      •   Scala
      •   Ruby
      •   Php
Speak REST?

• Sounds good but…
 •   REST semantics vary wildly
 •   HATEOAS vs. practical REST?
/api/pet.json/1?delete (GET)
/api/pet.json/1 (DELETE)            All
/api/pet.json/1 (POST empty)       valid!


So…
Speak REST?

• Sounds good but…
 •   REST semantics vary wildly
 •   HATEOAS vs. practical REST?
/api/pet.json/1?delete (GET)
                         Peer            All
/api/pet.json/1     (DELETE)
                       Review!          valid!
/api/pet.json/1 (POST empty)
     Better
      Docs!
So…
                                      API
        API                        Styleguide
      Council!                          !
Hello, Swagger

• Swagger is…
 •   Spec for declaring an API schema
 •   A framework for auto-generating the spec
 •   A library for client library generation
 •   A JSON-based test framework
What is this Resource Declaration?

• Listing of all available APIs
http://petstore.swagger.wordnik.com/api/resources.json




                                      “It’s like a
                                     sitemap for
                                      your API!”
What is this Resource Declaration?

• “But I don’t want it all exposed!”
  •   Swagger can filter APIs by permissions




                                   Header,
      Api key,                      URL,
      Cookies,                     Method
       OAuth
What is this Resource Declaration?
• Each api is documented
http://petstore.swagger.wordnik.com/api/pet.json
API Documentation Highlights

• Describes
 •   Operations
 •   Models
• Permission-based filtering
• JSON and XML supported
Anatomy of API Documentation
Anatomy of API Documentation


                                Based on
                                 JSON
                                Schema
                                 (Draft)




http://tools.ietf.org/html/draft-zyp-json-schema-03
API Parameters
API Parameters

• Filtering on parameters
• Enumerated options w/optional default
API Parameters
How does this help?

• Generate client libs
• Invoke methods not URLs
• Pass arguments, not query params
• Don't care about how service is developed
 •   Different versions of java?
 •   Different REST frameworks?
How does this help?

• Generate client libs
• Invoke methods not URLs
• Pass arguments, not query params
• Don'tRESTler? how service is developed
        care about     JAX-RS
 •   Different versions of java?
 •   Different REST frameworks?
                       Client
      Play!                        Scalatra
                      doesn't
                       care
Example Codegen
./bin/generate-scala-lib.sh 
   http://petstore.swagger.wordnik.com/api 
   "" 
   "com.wordnik" 
   client
Example Invocation

Scala



                        Ruby
But What about Speed?

• Yes!   REST over HTTP is slow
 •   Connection overhead
 •   Marshaling & Unmarshaling overhead
 •   Chatter
 •   JSON/XML need to diet
• It's also…
 •   Synchronous
 •   GET/POST/PUT/DELETE don't cut it
But What about Speed?

• Yes!   REST over HTTP is slow
 •   Connection overhead
 •                                 Your
     Marshaling & Unmarshaling overhead prod
 •   Chatter                     Database
 •   JSON/XML need to diet       isn't doing
• It's also…                       REST
 •   Synchronous
 •   GET/POST/PUT/DELETE don't cut it
Websockets to the Rescue!

• It's…
 •   Full Duplex
 •   Persistent connections
 •   Completely Async
• But…
 •   Very finicky
 •   Wildly inconsistent server support
 •   Still in draft
Websockets to the Rescue!

• It's…
 •   Full Duplex
 •   Persistent connections
 •   Completely Async
• But…
 •   Very finicky
 •   Wildly inconsistent server support
 •   Still in draft
Abstracted by Atmosphere
https://github.com/Atmosphere/atmosphere

• Fully Sponsored by Wordnik
• Abstracts the mess
• Support on many containers
• Client fallback/draft protocol support
Abstracted by Atmosphere
https://github.com/Atmosphere/atmosphere

• Fully Sponsored by Wordnik
• Abstracts the mess
• Support on many containers
• Client fallback/draft protocolTomcat
                                 support
              Weblogi
   Jetty         c
            JBoss           Resin
             Netty              Glassfis
                                   h
Swagger + Websockets

• Swagger sockets
 •   Same discovery interface
 •   Same client interface
 •   Same codegen
• But…
 •   Multiplexed connections
 •   Support for binary protocol
 •   Full Async
 •   Adding "subscribe" to GET/POST/PUT/DELETE
Swagger Sockets

• Live now on smartmoney.com
• Fully OSS
• Wire-protocol speed
• Format-agnostic
 •   JSON
 •   Binary
Summary

• Smaller, dedicated units of work
• Micro services => micro teams
• Full service knowledge
• Swagger is the Fabric for your Services
• Swagger sockets are like Fiber for your
  grid's connectivity
See More…

• http://swagger.wordnik.com/
• https://github.com/wordnik/swagger-core
• https://github.com/wordnik/swagger-ui
• https://github.com/wordnik/wordnik-oss
Questions?
Ad

More Related Content

What's hot (20)

Service-Oriented Design and Implement with Rails3
Service-Oriented Design and Implement with Rails3Service-Oriented Design and Implement with Rails3
Service-Oriented Design and Implement with Rails3
Wen-Tien Chang
 
Why we chose mongodb for guardian.co.uk
Why we chose mongodb for guardian.co.ukWhy we chose mongodb for guardian.co.uk
Why we chose mongodb for guardian.co.uk
Graham Tackley
 
Oak, the architecture of Apache Jackrabbit 3
Oak, the architecture of Apache Jackrabbit 3Oak, the architecture of Apache Jackrabbit 3
Oak, the architecture of Apache Jackrabbit 3
Jukka Zitting
 
Building a Node.js API backend with LoopBack in 5 Minutes
Building a Node.js API backend with LoopBack in 5 MinutesBuilding a Node.js API backend with LoopBack in 5 Minutes
Building a Node.js API backend with LoopBack in 5 Minutes
Raymond Feng
 
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
Sencha
 
Working with LoopBack Models
Working with LoopBack ModelsWorking with LoopBack Models
Working with LoopBack Models
Raymond Feng
 
Apache Con 2021 : Apache Bookkeeper Key Value Store and use cases
Apache Con 2021 : Apache Bookkeeper Key Value Store and use casesApache Con 2021 : Apache Bookkeeper Key Value Store and use cases
Apache Con 2021 : Apache Bookkeeper Key Value Store and use cases
Shivji Kumar Jha
 
Ruby and Distributed Storage Systems
Ruby and Distributed Storage SystemsRuby and Distributed Storage Systems
Ruby and Distributed Storage Systems
SATOSHI TAGOMORI
 
Webinar: Adobe Experience Manager Clustering Made Easy on MongoDB
Webinar: Adobe Experience Manager Clustering Made Easy on MongoDB Webinar: Adobe Experience Manager Clustering Made Easy on MongoDB
Webinar: Adobe Experience Manager Clustering Made Easy on MongoDB
MongoDB
 
Apache Jackrabbit Oak on MongoDB
Apache Jackrabbit Oak on MongoDBApache Jackrabbit Oak on MongoDB
Apache Jackrabbit Oak on MongoDB
MongoDB
 
Building better SQL Server Databases
Building better SQL Server DatabasesBuilding better SQL Server Databases
Building better SQL Server Databases
ColdFusionConference
 
Building APIs in an easy way using API Platform
Building APIs in an easy way using API PlatformBuilding APIs in an easy way using API Platform
Building APIs in an easy way using API Platform
Antonio Peric-Mazar
 
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
 
How NOT to get lost in the current JavaScript landscape
How NOT to get lost in the current JavaScript landscapeHow NOT to get lost in the current JavaScript landscape
How NOT to get lost in the current JavaScript landscape
Radosław Scheibinger
 
spray: REST on Akka (Scala Days)
spray: REST on Akka (Scala Days)spray: REST on Akka (Scala Days)
spray: REST on Akka (Scala Days)
sirthias
 
Introduction to CQ5
Introduction to CQ5Introduction to CQ5
Introduction to CQ5
Michele Mostarda
 
Seattle StrongLoop Node.js Workshop
Seattle StrongLoop Node.js WorkshopSeattle StrongLoop Node.js Workshop
Seattle StrongLoop Node.js Workshop
Jimmy Guerrero
 
Day 4 - Models
Day 4 - ModelsDay 4 - Models
Day 4 - Models
Barry Jones
 
Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"
Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"
Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"
Fwdays
 
Picking the Right Node.js Framework for Your Use Case
Picking the Right Node.js Framework for Your Use CasePicking the Right Node.js Framework for Your Use Case
Picking the Right Node.js Framework for Your Use Case
Jimmy Guerrero
 
Service-Oriented Design and Implement with Rails3
Service-Oriented Design and Implement with Rails3Service-Oriented Design and Implement with Rails3
Service-Oriented Design and Implement with Rails3
Wen-Tien Chang
 
Why we chose mongodb for guardian.co.uk
Why we chose mongodb for guardian.co.ukWhy we chose mongodb for guardian.co.uk
Why we chose mongodb for guardian.co.uk
Graham Tackley
 
Oak, the architecture of Apache Jackrabbit 3
Oak, the architecture of Apache Jackrabbit 3Oak, the architecture of Apache Jackrabbit 3
Oak, the architecture of Apache Jackrabbit 3
Jukka Zitting
 
Building a Node.js API backend with LoopBack in 5 Minutes
Building a Node.js API backend with LoopBack in 5 MinutesBuilding a Node.js API backend with LoopBack in 5 Minutes
Building a Node.js API backend with LoopBack in 5 Minutes
Raymond Feng
 
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
Sencha
 
Working with LoopBack Models
Working with LoopBack ModelsWorking with LoopBack Models
Working with LoopBack Models
Raymond Feng
 
Apache Con 2021 : Apache Bookkeeper Key Value Store and use cases
Apache Con 2021 : Apache Bookkeeper Key Value Store and use casesApache Con 2021 : Apache Bookkeeper Key Value Store and use cases
Apache Con 2021 : Apache Bookkeeper Key Value Store and use cases
Shivji Kumar Jha
 
Ruby and Distributed Storage Systems
Ruby and Distributed Storage SystemsRuby and Distributed Storage Systems
Ruby and Distributed Storage Systems
SATOSHI TAGOMORI
 
Webinar: Adobe Experience Manager Clustering Made Easy on MongoDB
Webinar: Adobe Experience Manager Clustering Made Easy on MongoDB Webinar: Adobe Experience Manager Clustering Made Easy on MongoDB
Webinar: Adobe Experience Manager Clustering Made Easy on MongoDB
MongoDB
 
Apache Jackrabbit Oak on MongoDB
Apache Jackrabbit Oak on MongoDBApache Jackrabbit Oak on MongoDB
Apache Jackrabbit Oak on MongoDB
MongoDB
 
Building better SQL Server Databases
Building better SQL Server DatabasesBuilding better SQL Server Databases
Building better SQL Server Databases
ColdFusionConference
 
Building APIs in an easy way using API Platform
Building APIs in an easy way using API PlatformBuilding APIs in an easy way using API Platform
Building APIs in an easy way using API Platform
Antonio Peric-Mazar
 
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
 
How NOT to get lost in the current JavaScript landscape
How NOT to get lost in the current JavaScript landscapeHow NOT to get lost in the current JavaScript landscape
How NOT to get lost in the current JavaScript landscape
Radosław Scheibinger
 
spray: REST on Akka (Scala Days)
spray: REST on Akka (Scala Days)spray: REST on Akka (Scala Days)
spray: REST on Akka (Scala Days)
sirthias
 
Seattle StrongLoop Node.js Workshop
Seattle StrongLoop Node.js WorkshopSeattle StrongLoop Node.js Workshop
Seattle StrongLoop Node.js Workshop
Jimmy Guerrero
 
Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"
Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"
Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"
Fwdays
 
Picking the Right Node.js Framework for Your Use Case
Picking the Right Node.js Framework for Your Use CasePicking the Right Node.js Framework for Your Use Case
Picking the Right Node.js Framework for Your Use Case
Jimmy Guerrero
 

Similar to Scaling with swagger (20)

Inside Wordnik's Architecture
Inside Wordnik's ArchitectureInside Wordnik's Architecture
Inside Wordnik's Architecture
Tony Tam
 
Middleware in Golang: InVision's Rye
Middleware in Golang: InVision's RyeMiddleware in Golang: InVision's Rye
Middleware in Golang: InVision's Rye
Cale Hoopes
 
APIs distribuidos con alta escalabilidad
APIs distribuidos con alta escalabilidadAPIs distribuidos con alta escalabilidad
APIs distribuidos con alta escalabilidad
Software Guru
 
SGCE 2015 REST APIs
SGCE 2015 REST APIsSGCE 2015 REST APIs
SGCE 2015 REST APIs
Domingo Suarez Torres
 
Java EE 7 Soup to Nuts at JavaOne 2014
Java EE 7 Soup to Nuts at JavaOne 2014Java EE 7 Soup to Nuts at JavaOne 2014
Java EE 7 Soup to Nuts at JavaOne 2014
Arun Gupta
 
Api crash
Api crashApi crash
Api crash
Tony Nguyen
 
Api crash
Api crashApi crash
Api crash
Fraboni Ec
 
Api crash
Api crashApi crash
Api crash
James Wong
 
Api crash
Api crashApi crash
Api crash
Young Alista
 
Api crash
Api crashApi crash
Api crash
Harry Potter
 
Api crash
Api crashApi crash
Api crash
Luis Goldster
 
Api crash
Api crashApi crash
Api crash
Hoang Nguyen
 
Be faster then rabbits
Be faster then rabbitsBe faster then rabbits
Be faster then rabbits
Vladislav Bauer
 
Prometheus lightning talk (Devops Dublin March 2015)
Prometheus lightning talk (Devops Dublin March 2015)Prometheus lightning talk (Devops Dublin March 2015)
Prometheus lightning talk (Devops Dublin March 2015)
Brian Brazil
 
Why ruby and rails
Why ruby and railsWhy ruby and rails
Why ruby and rails
Reuven Lerner
 
Swagger: Restful documentation that won't put you to sleep
Swagger: Restful documentation that won't put you to sleepSwagger: Restful documentation that won't put you to sleep
Swagger: Restful documentation that won't put you to sleep
Tobias Coetzee
 
Fastest to Mobile with Scalatra + Swagger
Fastest to Mobile with Scalatra + SwaggerFastest to Mobile with Scalatra + Swagger
Fastest to Mobile with Scalatra + Swagger
Tony Tam
 
The Characteristics of a Successful SPA
The Characteristics of a Successful SPAThe Characteristics of a Successful SPA
The Characteristics of a Successful SPA
Gil Fink
 
PLAT-7 Spring Web Scripts and Spring Surf
PLAT-7 Spring Web Scripts and Spring SurfPLAT-7 Spring Web Scripts and Spring Surf
PLAT-7 Spring Web Scripts and Spring Surf
Alfresco Software
 
PLAT-7 Spring Web Scripts and Spring Surf
PLAT-7 Spring Web Scripts and Spring SurfPLAT-7 Spring Web Scripts and Spring Surf
PLAT-7 Spring Web Scripts and Spring Surf
Alfresco Software
 
Inside Wordnik's Architecture
Inside Wordnik's ArchitectureInside Wordnik's Architecture
Inside Wordnik's Architecture
Tony Tam
 
Middleware in Golang: InVision's Rye
Middleware in Golang: InVision's RyeMiddleware in Golang: InVision's Rye
Middleware in Golang: InVision's Rye
Cale Hoopes
 
APIs distribuidos con alta escalabilidad
APIs distribuidos con alta escalabilidadAPIs distribuidos con alta escalabilidad
APIs distribuidos con alta escalabilidad
Software Guru
 
Java EE 7 Soup to Nuts at JavaOne 2014
Java EE 7 Soup to Nuts at JavaOne 2014Java EE 7 Soup to Nuts at JavaOne 2014
Java EE 7 Soup to Nuts at JavaOne 2014
Arun Gupta
 
Prometheus lightning talk (Devops Dublin March 2015)
Prometheus lightning talk (Devops Dublin March 2015)Prometheus lightning talk (Devops Dublin March 2015)
Prometheus lightning talk (Devops Dublin March 2015)
Brian Brazil
 
Swagger: Restful documentation that won't put you to sleep
Swagger: Restful documentation that won't put you to sleepSwagger: Restful documentation that won't put you to sleep
Swagger: Restful documentation that won't put you to sleep
Tobias Coetzee
 
Fastest to Mobile with Scalatra + Swagger
Fastest to Mobile with Scalatra + SwaggerFastest to Mobile with Scalatra + Swagger
Fastest to Mobile with Scalatra + Swagger
Tony Tam
 
The Characteristics of a Successful SPA
The Characteristics of a Successful SPAThe Characteristics of a Successful SPA
The Characteristics of a Successful SPA
Gil Fink
 
PLAT-7 Spring Web Scripts and Spring Surf
PLAT-7 Spring Web Scripts and Spring SurfPLAT-7 Spring Web Scripts and Spring Surf
PLAT-7 Spring Web Scripts and Spring Surf
Alfresco Software
 
PLAT-7 Spring Web Scripts and Spring Surf
PLAT-7 Spring Web Scripts and Spring SurfPLAT-7 Spring Web Scripts and Spring Surf
PLAT-7 Spring Web Scripts and Spring Surf
Alfresco Software
 
Ad

More from Tony Tam (18)

A Tasty deep-dive into Open API Specification Links
A Tasty deep-dive into Open API Specification LinksA Tasty deep-dive into Open API Specification Links
A Tasty deep-dive into Open API Specification Links
Tony Tam
 
API Design first with Swagger
API Design first with SwaggerAPI Design first with Swagger
API Design first with Swagger
Tony Tam
 
Developing Faster with Swagger
Developing Faster with SwaggerDeveloping Faster with Swagger
Developing Faster with Swagger
Tony Tam
 
Writer APIs in Java faster with Swagger Inflector
Writer APIs in Java faster with Swagger InflectorWriter APIs in Java faster with Swagger Inflector
Writer APIs in Java faster with Swagger Inflector
Tony Tam
 
Swagger APIs for Humans and Robots (Gluecon)
Swagger APIs for Humans and Robots (Gluecon)Swagger APIs for Humans and Robots (Gluecon)
Swagger APIs for Humans and Robots (Gluecon)
Tony Tam
 
Love your API with Swagger (Gluecon lightning talk)
Love your API with Swagger (Gluecon lightning talk)Love your API with Swagger (Gluecon lightning talk)
Love your API with Swagger (Gluecon lightning talk)
Tony Tam
 
Swagger for-your-api
Swagger for-your-apiSwagger for-your-api
Swagger for-your-api
Tony Tam
 
Swagger for startups
Swagger for startupsSwagger for startups
Swagger for startups
Tony Tam
 
Data Modeling for NoSQL
Data Modeling for NoSQLData Modeling for NoSQL
Data Modeling for NoSQL
Tony Tam
 
System insight without Interference
System insight without InterferenceSystem insight without Interference
System insight without Interference
Tony Tam
 
Keeping MongoDB Data Safe
Keeping MongoDB Data SafeKeeping MongoDB Data Safe
Keeping MongoDB Data Safe
Tony Tam
 
Scala & Swagger at Wordnik
Scala & Swagger at WordnikScala & Swagger at Wordnik
Scala & Swagger at Wordnik
Tony Tam
 
Introducing Swagger
Introducing SwaggerIntroducing Swagger
Introducing Swagger
Tony Tam
 
Why Wordnik went non-relational
Why Wordnik went non-relationalWhy Wordnik went non-relational
Why Wordnik went non-relational
Tony Tam
 
Building a Directed Graph with MongoDB
Building a Directed Graph with MongoDBBuilding a Directed Graph with MongoDB
Building a Directed Graph with MongoDB
Tony Tam
 
Managing a MongoDB Deployment
Managing a MongoDB DeploymentManaging a MongoDB Deployment
Managing a MongoDB Deployment
Tony Tam
 
Keeping the Lights On with MongoDB
Keeping the Lights On with MongoDBKeeping the Lights On with MongoDB
Keeping the Lights On with MongoDB
Tony Tam
 
Migrating from MySQL to MongoDB at Wordnik
Migrating from MySQL to MongoDB at WordnikMigrating from MySQL to MongoDB at Wordnik
Migrating from MySQL to MongoDB at Wordnik
Tony Tam
 
A Tasty deep-dive into Open API Specification Links
A Tasty deep-dive into Open API Specification LinksA Tasty deep-dive into Open API Specification Links
A Tasty deep-dive into Open API Specification Links
Tony Tam
 
API Design first with Swagger
API Design first with SwaggerAPI Design first with Swagger
API Design first with Swagger
Tony Tam
 
Developing Faster with Swagger
Developing Faster with SwaggerDeveloping Faster with Swagger
Developing Faster with Swagger
Tony Tam
 
Writer APIs in Java faster with Swagger Inflector
Writer APIs in Java faster with Swagger InflectorWriter APIs in Java faster with Swagger Inflector
Writer APIs in Java faster with Swagger Inflector
Tony Tam
 
Swagger APIs for Humans and Robots (Gluecon)
Swagger APIs for Humans and Robots (Gluecon)Swagger APIs for Humans and Robots (Gluecon)
Swagger APIs for Humans and Robots (Gluecon)
Tony Tam
 
Love your API with Swagger (Gluecon lightning talk)
Love your API with Swagger (Gluecon lightning talk)Love your API with Swagger (Gluecon lightning talk)
Love your API with Swagger (Gluecon lightning talk)
Tony Tam
 
Swagger for-your-api
Swagger for-your-apiSwagger for-your-api
Swagger for-your-api
Tony Tam
 
Swagger for startups
Swagger for startupsSwagger for startups
Swagger for startups
Tony Tam
 
Data Modeling for NoSQL
Data Modeling for NoSQLData Modeling for NoSQL
Data Modeling for NoSQL
Tony Tam
 
System insight without Interference
System insight without InterferenceSystem insight without Interference
System insight without Interference
Tony Tam
 
Keeping MongoDB Data Safe
Keeping MongoDB Data SafeKeeping MongoDB Data Safe
Keeping MongoDB Data Safe
Tony Tam
 
Scala & Swagger at Wordnik
Scala & Swagger at WordnikScala & Swagger at Wordnik
Scala & Swagger at Wordnik
Tony Tam
 
Introducing Swagger
Introducing SwaggerIntroducing Swagger
Introducing Swagger
Tony Tam
 
Why Wordnik went non-relational
Why Wordnik went non-relationalWhy Wordnik went non-relational
Why Wordnik went non-relational
Tony Tam
 
Building a Directed Graph with MongoDB
Building a Directed Graph with MongoDBBuilding a Directed Graph with MongoDB
Building a Directed Graph with MongoDB
Tony Tam
 
Managing a MongoDB Deployment
Managing a MongoDB DeploymentManaging a MongoDB Deployment
Managing a MongoDB Deployment
Tony Tam
 
Keeping the Lights On with MongoDB
Keeping the Lights On with MongoDBKeeping the Lights On with MongoDB
Keeping the Lights On with MongoDB
Tony Tam
 
Migrating from MySQL to MongoDB at Wordnik
Migrating from MySQL to MongoDB at WordnikMigrating from MySQL to MongoDB at Wordnik
Migrating from MySQL to MongoDB at Wordnik
Tony Tam
 
Ad

Recently uploaded (20)

Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 

Scaling with swagger

  • 1. Scaling with Swagger Tony Tam @fehguy
  • 2. Scaling is the Developer's Job Was: • Write code, make it work • If it get slow, buy: • Bigger server • Bigger database • "Enterprise" software support
  • 3. Needs Harmony Between • Software • Data Tier • Development Infrastructure • Deployment Infrastructure • Team • Ability to manage it all
  • 4. Needs Harmony Between • Software • Data Tier • Development Infrastructure • Deployment Infrastructure • Team • Ability to manage it Best Achieved all with Good Architecture
  • 6. Common Mistakes… • "Let's organize by horizontal!" • "Back end shouldn't care what front end does!" • "Just get it launched and we'll scale with hardware" • "You can scale transparently with technology X" • "Get an Oracle consultant to speed things up"
  • 7. Common Problems • Overly complicated interfaces • Abstracted too many times • "We can switch out entities with a simple configuration!" • Over-abstracted • "We might need to change database vendors so abstract the SQL layer" • Over designed • "We don't know how the client will call, so support all possible calls!"
  • 8. Solutions • Many Possible • Some suck, some good • Let's look at Wordnik
  • 9. Directionally Speaking • Go Vertical! • Ability to understand full lifecycle • APIs as the communication of choice • General convergence on developers • Databases (MongoDB, Cassandra, Dynamo) • API frameworks • IT & QA are disappearing • Wordnik currently has *none* • Team, infrastructure, discipline *win*
  • 10. Directionally Speaking • Go Vertical! • Ability to understand full lifecycle • APIs as the communication of choice • General convergence on developers Still Room • Databases (MongoDB, Cassandra, Dynamo) to specialize • API frameworks • IT & QA are disappearing • Wordnik currently has *none* • Team, infrastructure, discipline *win*
  • 11. Vertical, Explained • Big application => micro services Monolithic application "Isn't this just SOA?"
  • 12. Not SOA • This is different • No proprietary message bus • Decoupled objects • Dedicated storage*** • Speak REST • Develop your services in… • Java • Scala • Ruby • Php
  • 13. Speak REST? • Sounds good but… • REST semantics vary wildly • HATEOAS vs. practical REST? /api/pet.json/1?delete (GET) /api/pet.json/1 (DELETE) All /api/pet.json/1 (POST empty) valid! So…
  • 14. Speak REST? • Sounds good but… • REST semantics vary wildly • HATEOAS vs. practical REST? /api/pet.json/1?delete (GET) Peer All /api/pet.json/1 (DELETE) Review! valid! /api/pet.json/1 (POST empty) Better Docs! So… API API Styleguide Council! !
  • 15. Hello, Swagger • Swagger is… • Spec for declaring an API schema • A framework for auto-generating the spec • A library for client library generation • A JSON-based test framework
  • 16. What is this Resource Declaration? • Listing of all available APIs http://petstore.swagger.wordnik.com/api/resources.json “It’s like a sitemap for your API!”
  • 17. What is this Resource Declaration? • “But I don’t want it all exposed!” • Swagger can filter APIs by permissions Header, Api key, URL, Cookies, Method OAuth
  • 18. What is this Resource Declaration? • Each api is documented http://petstore.swagger.wordnik.com/api/pet.json
  • 19. API Documentation Highlights • Describes • Operations • Models • Permission-based filtering • JSON and XML supported
  • 20. Anatomy of API Documentation
  • 21. Anatomy of API Documentation Based on JSON Schema (Draft) http://tools.ietf.org/html/draft-zyp-json-schema-03
  • 23. API Parameters • Filtering on parameters • Enumerated options w/optional default
  • 25. How does this help? • Generate client libs • Invoke methods not URLs • Pass arguments, not query params • Don't care about how service is developed • Different versions of java? • Different REST frameworks?
  • 26. How does this help? • Generate client libs • Invoke methods not URLs • Pass arguments, not query params • Don'tRESTler? how service is developed care about JAX-RS • Different versions of java? • Different REST frameworks? Client Play! Scalatra doesn't care
  • 27. Example Codegen ./bin/generate-scala-lib.sh http://petstore.swagger.wordnik.com/api "" "com.wordnik" client
  • 29. But What about Speed? • Yes! REST over HTTP is slow • Connection overhead • Marshaling & Unmarshaling overhead • Chatter • JSON/XML need to diet • It's also… • Synchronous • GET/POST/PUT/DELETE don't cut it
  • 30. But What about Speed? • Yes! REST over HTTP is slow • Connection overhead • Your Marshaling & Unmarshaling overhead prod • Chatter Database • JSON/XML need to diet isn't doing • It's also… REST • Synchronous • GET/POST/PUT/DELETE don't cut it
  • 31. Websockets to the Rescue! • It's… • Full Duplex • Persistent connections • Completely Async • But… • Very finicky • Wildly inconsistent server support • Still in draft
  • 32. Websockets to the Rescue! • It's… • Full Duplex • Persistent connections • Completely Async • But… • Very finicky • Wildly inconsistent server support • Still in draft
  • 33. Abstracted by Atmosphere https://github.com/Atmosphere/atmosphere • Fully Sponsored by Wordnik • Abstracts the mess • Support on many containers • Client fallback/draft protocol support
  • 34. Abstracted by Atmosphere https://github.com/Atmosphere/atmosphere • Fully Sponsored by Wordnik • Abstracts the mess • Support on many containers • Client fallback/draft protocolTomcat support Weblogi Jetty c JBoss Resin Netty Glassfis h
  • 35. Swagger + Websockets • Swagger sockets • Same discovery interface • Same client interface • Same codegen • But… • Multiplexed connections • Support for binary protocol • Full Async • Adding "subscribe" to GET/POST/PUT/DELETE
  • 36. Swagger Sockets • Live now on smartmoney.com • Fully OSS • Wire-protocol speed • Format-agnostic • JSON • Binary
  • 37. Summary • Smaller, dedicated units of work • Micro services => micro teams • Full service knowledge • Swagger is the Fabric for your Services • Swagger sockets are like Fiber for your grid's connectivity
  • 38. See More… • http://swagger.wordnik.com/ • https://github.com/wordnik/swagger-core • https://github.com/wordnik/swagger-ui • https://github.com/wordnik/wordnik-oss