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?

More Related Content

What's hot

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 Rails3Wen-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 MongoDBMongoDB
 
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 RailsAvi 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
 

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
 
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
 
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
 
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
 
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...
 
Working with LoopBack Models
Working with LoopBack ModelsWorking with LoopBack Models
Working with LoopBack Models
 
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
 
Ruby and Distributed Storage Systems
Ruby and Distributed Storage SystemsRuby and Distributed Storage Systems
Ruby and Distributed Storage Systems
 
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
 
Apache Jackrabbit Oak on MongoDB
Apache Jackrabbit Oak on MongoDBApache Jackrabbit Oak on MongoDB
Apache Jackrabbit Oak on MongoDB
 
Building better SQL Server Databases
Building better SQL Server DatabasesBuilding better SQL Server Databases
Building better SQL Server Databases
 
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
 
Web Development using Ruby on Rails
Web Development using Ruby on RailsWeb Development using Ruby on Rails
Web Development using Ruby on Rails
 
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
 
spray: REST on Akka (Scala Days)
spray: REST on Akka (Scala Days)spray: REST on Akka (Scala Days)
spray: REST on Akka (Scala Days)
 
Introduction to CQ5
Introduction to CQ5Introduction to CQ5
Introduction to CQ5
 
Seattle StrongLoop Node.js Workshop
Seattle StrongLoop Node.js WorkshopSeattle StrongLoop Node.js Workshop
Seattle StrongLoop Node.js Workshop
 
Day 4 - Models
Day 4 - ModelsDay 4 - Models
Day 4 - Models
 
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!"
 
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
 

Similar to Scaling with swagger

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
 
Api crash
Api crashApi crash
Api crash
Hoang Nguyen
 
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
 

Similar to Scaling with swagger (20)

Inside Wordnik's Architecture
Inside Wordnik's ArchitectureInside Wordnik's Architecture
Inside Wordnik's Architecture
 
Middleware in Golang: InVision's Rye
Middleware in Golang: InVision's RyeMiddleware in Golang: InVision's Rye
Middleware in Golang: InVision's Rye
 
SGCE 2015 REST APIs
SGCE 2015 REST APIsSGCE 2015 REST APIs
SGCE 2015 REST APIs
 
APIs distribuidos con alta escalabilidad
APIs distribuidos con alta escalabilidadAPIs distribuidos con alta escalabilidad
APIs distribuidos con alta escalabilidad
 
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
 
Api crash
Api crashApi crash
Api crash
 
Api crash
Api crashApi crash
Api crash
 
Api crash
Api crashApi crash
Api crash
 
Api crash
Api crashApi crash
Api crash
 
Api crash
Api crashApi crash
Api crash
 
Api crash
Api crashApi crash
Api crash
 
Api crash
Api crashApi crash
Api crash
 
Be faster then rabbits
Be faster then rabbitsBe faster then rabbits
Be faster then rabbits
 
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)
 
Why ruby and rails
Why ruby and railsWhy ruby and rails
Why ruby and rails
 
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
 
Fastest to Mobile with Scalatra + Swagger
Fastest to Mobile with Scalatra + SwaggerFastest to Mobile with Scalatra + Swagger
Fastest to Mobile with Scalatra + Swagger
 
The Characteristics of a Successful SPA
The Characteristics of a Successful SPAThe Characteristics of a Successful SPA
The Characteristics of a Successful SPA
 
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
 
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
 

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

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
 
API Design first with Swagger
API Design first with SwaggerAPI Design first with Swagger
API Design first with Swagger
 
Developing Faster with Swagger
Developing Faster with SwaggerDeveloping Faster with Swagger
Developing Faster with Swagger
 
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
 
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)
 
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)
 
Swagger for-your-api
Swagger for-your-apiSwagger for-your-api
Swagger for-your-api
 
Swagger for startups
Swagger for startupsSwagger for startups
Swagger for startups
 
Data Modeling for NoSQL
Data Modeling for NoSQLData Modeling for NoSQL
Data Modeling for NoSQL
 
System insight without Interference
System insight without InterferenceSystem insight without Interference
System insight without Interference
 
Keeping MongoDB Data Safe
Keeping MongoDB Data SafeKeeping MongoDB Data Safe
Keeping MongoDB Data Safe
 
Scala & Swagger at Wordnik
Scala & Swagger at WordnikScala & Swagger at Wordnik
Scala & Swagger at Wordnik
 
Introducing Swagger
Introducing SwaggerIntroducing Swagger
Introducing Swagger
 
Why Wordnik went non-relational
Why Wordnik went non-relationalWhy Wordnik went non-relational
Why Wordnik went non-relational
 
Building a Directed Graph with MongoDB
Building a Directed Graph with MongoDBBuilding a Directed Graph with MongoDB
Building a Directed Graph with MongoDB
 
Managing a MongoDB Deployment
Managing a MongoDB DeploymentManaging a MongoDB Deployment
Managing a MongoDB Deployment
 
Keeping the Lights On with MongoDB
Keeping the Lights On with MongoDBKeeping the Lights On with MongoDB
Keeping the Lights On with MongoDB
 
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
 

Recently uploaded

Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 

Recently uploaded (20)

Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 

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