SlideShare a Scribd company logo
Scala & Swagger at Wordnik Tony Tam @fehguy
Agenda Who is Wordnik? Why bother with this Scala thing? What did we get from it? What is Swagger Why it should matter to you
Wordnik Tech Overview API based infrastructure Micro service oriented architecture Business by Scala, Java, MongoDB Beauty by Javascript, Ruby 20M API calls daily Powered by Swagger, inside & out 20B+ hot documents in MongoDB
Why Bother with Scala? Not just looking for next new thing “I was just getting good at ${language.name}!” Technology selection has consequences .netvs OSS Flash vs. HTML5 Java is… Stable Fast Widely accepted
Why Bother with Scala? Look at the scenery One size does NOT fit all Rise of Ruby, Javascript, node.js, etc. Hey, they did lots of things right Focus on making things easy
So What is it? JVM-based language Started by Martin Odersky Functional & OO Typesafe Fully compatible with Java IncludesDizzying Syntax
Java Pain Points DRY is difficult with Java Interfaces are great Implementation? Many ways to peel the onion!	 Easy to follow Often explosive LOC!
Example Our REST service Back-end returns different object implementations depending on operation
Example Many operations produce models with similar attributes Resulting in a mess     of classes
Example An Interface… An Implementation…
Example Another Impl…
Example And another…
Example Implementation is duplicated everywhere Annotations are duplicated everywhere Am I lazy to complain? Consistency Matters!
Simplified with Scala Objects can have Traits Like java interfaces + ruby mixins Creates “proper” subtypes Compiler built, concrete classes The “Word” trait… The corresponding impl…
Simplified with Scala More traits.  Reuse these across your codebase! The other Impls:
Simplified with Scala Big deal? Just the beginning of the good stuff Scala syntax In Java, strict syntax is enforced In Scala: “it’s OK unless it’s not”
XML in Scala Support is baked in Declaring XML
XML in Scala Parsing XML is easy
Text Processing But first, the match statement Like switch:
Text Processing But much more powerful
Text Processing Pattern matching + “match” statement Extract name in different formats
Text Processing (Erin,McKean) (Joe,Hyrkin) (Anthony,L.,Tam) Kumanan
Summary of Scala @ Wordnik Lost NONE of our Java codebase Code reuse is up Code consistency is up Flexibility is up LOC is down Readability is…
Why Swagger? Integration with REST APIs is troublesome and inconsistent Different vendors have different REST semantics Client libraries vary wildly by vendor, language Documentation for developers is an afterthought Input parameters, allowable values, models, responses are found via trial & error Internally a PITA YOUR API is too hard to develop against!
How Does it Work? Your server produces a Resource List All available APIs http://petstore.swagger.wordnik.com/api/resources.json “It’s like a sitemap for your API!”
How Does it Work? Each API declares itself Available operations Parameters Type (path, query, body) Allowable values/data types Input/output models Error responses with descriptions
API Response http://petstore.swagger.wordnik.com/api/pet.json
API Response Knowing input/output models is helpful! Based on JSON Schema (Draft) http://tools.ietf.org/html/draft-zyp-json-schema-03
But what’s the benefit? A Sandbox!
Client Library Generation Code generation based on Resource Spec Template-based Framework Consume REST Methods, Models, Parameters Produce client libraries “Know before you go HTTP” Required values, fields are known by the client Only expose what’s allowed! Swagger filtering removes methods/models you don’t have access to
Client Library Generation Super user access Ordinary dev access
Test Framework JSON-driven tests for your Client + API Expected data Test Suites
Test Framework
Easy to add For Java/Scala via JAX-RS… Add swagger-core.jar Annotate your models per your @Providerclass Annotate your resources
Easy to add For node.js via express Require swagger.js Declare your swagger specs, models Could use AST/DSL to do automatically Add your operations, configure and start
Easy DIY The Swagger spec is Language Agnostic! ANY swagger-compliant server can… Use the Swagger client lib generator Use the test framework Use the sandbox UI More server support from Wordnik Play, Rails .net, others community developed
Where to go Next Try Swagger swagger.wordnik.com See it in action developer.wordnik.com/docs Download the source/samples swagger.wordnik.com/downloads Discuss it groups.google.com/group/wordnik-api #swagger_doc on freenode
Questions?

More Related Content

What's hot

Do's and Don'ts of APIs
Do's and Don'ts of APIsDo's and Don'ts of APIs
Do's and Don'ts of APIs
Jason Harmon
 
API Virtualization: Mocking on Steroids
API Virtualization: Mocking on SteroidsAPI Virtualization: Mocking on Steroids
API Virtualization: Mocking on Steroids
SmartBear
 
Api Design
Api DesignApi Design
Api Design
Jason Harmon
 
Exposing Salesforce REST Services Using Swagger
Exposing Salesforce REST Services Using SwaggerExposing Salesforce REST Services Using Swagger
Exposing Salesforce REST Services Using Swagger
Salesforce Developers
 
apidays LIVE London 2021 - Consumer-first APIs in Open Banking by Chris Dudle...
apidays LIVE London 2021 - Consumer-first APIs in Open Banking by Chris Dudle...apidays LIVE London 2021 - Consumer-first APIs in Open Banking by Chris Dudle...
apidays LIVE London 2021 - Consumer-first APIs in Open Banking by Chris Dudle...
apidays
 
Evaluating and Testing Web APIs
Evaluating and Testing Web APIsEvaluating and Testing Web APIs
Evaluating and Testing Web APIsSmartBear
 
The API-Application Semantic Gap
The API-Application Semantic GapThe API-Application Semantic Gap
The API-Application Semantic Gap
3scale
 
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
 
API 101 - Understanding APIs
API 101 - Understanding APIsAPI 101 - Understanding APIs
API 101 - Understanding APIs
3scale
 
Punta Dreamin 17 Generic Apex and Tooling Api
Punta Dreamin 17 Generic Apex and Tooling ApiPunta Dreamin 17 Generic Apex and Tooling Api
Punta Dreamin 17 Generic Apex and Tooling Api
Adam Olshansky
 
Implement Web API with Swagger
Implement Web API with SwaggerImplement Web API with Swagger
Implement Web API with Swagger
Jiang Wu
 
API for Beginners
API for BeginnersAPI for Beginners
API for Beginners
Gustavo De Vita
 
Api Design Anti-Patterns
Api Design Anti-PatternsApi Design Anti-Patterns
Api Design Anti-Patterns
Jason Harmon
 
Swagger in the API Lifecycle
Swagger in the API LifecycleSwagger in the API Lifecycle
Swagger in the API Lifecycle
Ole Lensmar
 
API design principles for accelerated development
API design principles for accelerated developmentAPI design principles for accelerated development
API design principles for accelerated development
Jonathan LeBlanc
 
Swagger for-your-api
Swagger for-your-apiSwagger for-your-api
Swagger for-your-api
Tony Tam
 
Level 3 REST Makes Your API Browsable
Level 3 REST Makes Your API BrowsableLevel 3 REST Makes Your API Browsable
Level 3 REST Makes Your API Browsable
Matt Bishop
 
apidays LIVE New York 2021 - Designing API's: Less Data is More! by Damir Svr...
apidays LIVE New York 2021 - Designing API's: Less Data is More! by Damir Svr...apidays LIVE New York 2021 - Designing API's: Less Data is More! by Damir Svr...
apidays LIVE New York 2021 - Designing API's: Less Data is More! by Damir Svr...
apidays
 
Emulators as an Emerging Best Practice for API providers
Emulators as an Emerging Best Practice for API providersEmulators as an Emerging Best Practice for API providers
Emulators as an Emerging Best Practice for API providers
Postman
 

What's hot (20)

Do's and Don'ts of APIs
Do's and Don'ts of APIsDo's and Don'ts of APIs
Do's and Don'ts of APIs
 
API Virtualization: Mocking on Steroids
API Virtualization: Mocking on SteroidsAPI Virtualization: Mocking on Steroids
API Virtualization: Mocking on Steroids
 
Api Design
Api DesignApi Design
Api Design
 
Exposing Salesforce REST Services Using Swagger
Exposing Salesforce REST Services Using SwaggerExposing Salesforce REST Services Using Swagger
Exposing Salesforce REST Services Using Swagger
 
apidays LIVE London 2021 - Consumer-first APIs in Open Banking by Chris Dudle...
apidays LIVE London 2021 - Consumer-first APIs in Open Banking by Chris Dudle...apidays LIVE London 2021 - Consumer-first APIs in Open Banking by Chris Dudle...
apidays LIVE London 2021 - Consumer-first APIs in Open Banking by Chris Dudle...
 
Evaluating and Testing Web APIs
Evaluating and Testing Web APIsEvaluating and Testing Web APIs
Evaluating and Testing Web APIs
 
The API-Application Semantic Gap
The API-Application Semantic GapThe API-Application Semantic Gap
The API-Application Semantic Gap
 
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)
 
API 101 - Understanding APIs
API 101 - Understanding APIsAPI 101 - Understanding APIs
API 101 - Understanding APIs
 
Punta Dreamin 17 Generic Apex and Tooling Api
Punta Dreamin 17 Generic Apex and Tooling ApiPunta Dreamin 17 Generic Apex and Tooling Api
Punta Dreamin 17 Generic Apex and Tooling Api
 
Implement Web API with Swagger
Implement Web API with SwaggerImplement Web API with Swagger
Implement Web API with Swagger
 
API for Beginners
API for BeginnersAPI for Beginners
API for Beginners
 
Api Design Anti-Patterns
Api Design Anti-PatternsApi Design Anti-Patterns
Api Design Anti-Patterns
 
Swagger in the API Lifecycle
Swagger in the API LifecycleSwagger in the API Lifecycle
Swagger in the API Lifecycle
 
API design principles for accelerated development
API design principles for accelerated developmentAPI design principles for accelerated development
API design principles for accelerated development
 
Swagger for-your-api
Swagger for-your-apiSwagger for-your-api
Swagger for-your-api
 
Level 3 REST Makes Your API Browsable
Level 3 REST Makes Your API BrowsableLevel 3 REST Makes Your API Browsable
Level 3 REST Makes Your API Browsable
 
apidays LIVE New York 2021 - Designing API's: Less Data is More! by Damir Svr...
apidays LIVE New York 2021 - Designing API's: Less Data is More! by Damir Svr...apidays LIVE New York 2021 - Designing API's: Less Data is More! by Damir Svr...
apidays LIVE New York 2021 - Designing API's: Less Data is More! by Damir Svr...
 
How to define an api
How to define an apiHow to define an api
How to define an api
 
Emulators as an Emerging Best Practice for API providers
Emulators as an Emerging Best Practice for API providersEmulators as an Emerging Best Practice for API providers
Emulators as an Emerging Best Practice for API providers
 

Similar to Scala & Swagger at Wordnik

JAVA J2EE Training in Coimbatore - Fundamentals of Java J2EE
JAVA J2EE Training in Coimbatore - Fundamentals of Java J2EE JAVA J2EE Training in Coimbatore - Fundamentals of Java J2EE
JAVA J2EE Training in Coimbatore - Fundamentals of Java J2EE
abile technologies
 
Rails Vs CakePHP
Rails Vs CakePHPRails Vs CakePHP
Rails Vs CakePHP
Gautam Rege
 
Ibm_interconnect_restapi_workshop
Ibm_interconnect_restapi_workshopIbm_interconnect_restapi_workshop
Ibm_interconnect_restapi_workshop
Shubhra Kar
 
Play Framework: Intro & High-Level Overview
Play Framework: Intro & High-Level OverviewPlay Framework: Intro & High-Level Overview
Play Framework: Intro & High-Level Overview
Josh Padnick
 
Ashok_Vardhan_Cheemakurthy
Ashok_Vardhan_CheemakurthyAshok_Vardhan_Cheemakurthy
Ashok_Vardhan_CheemakurthyASHOK VARDHAN CH
 
Introduction to Scala JS
Introduction to Scala JSIntroduction to Scala JS
Introduction to Scala JS
Knoldus Inc.
 
Documenting Your API
Documenting Your APIDocumenting Your API
Documenting Your API
Mailjet
 
Overview of Java
Overview of JavaOverview of Java
Overview of Java
josemachoco
 
Isomorphic javascript - Uppsala.js #8
Isomorphic javascript - Uppsala.js #8Isomorphic javascript - Uppsala.js #8
Isomorphic javascript - Uppsala.js #8
Alexander Aivars
 
December 4 SDForum Java Sig Presentation
December 4 SDForum Java Sig PresentationDecember 4 SDForum Java Sig Presentation
December 4 SDForum Java Sig Presentation
Jonathan Abrams
 
API workshop: Introduction to APIs (TC Camp)
API workshop: Introduction to APIs (TC Camp)API workshop: Introduction to APIs (TC Camp)
API workshop: Introduction to APIs (TC Camp)
Tom Johnson
 
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and ArquillianDeveloper Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Ray Ploski
 
Class 6: Introduction to web technology entrepreneurship
Class 6: Introduction to web technology entrepreneurshipClass 6: Introduction to web technology entrepreneurship
Class 6: Introduction to web technology entrepreneurshipallanchao
 
Wso2 product release webinar introducing jaggery
Wso2 product release webinar   introducing jaggeryWso2 product release webinar   introducing jaggery
Wso2 product release webinar introducing jaggeryWSO2
 
What Web Framework To Use?
What Web Framework To Use?What Web Framework To Use?
What Web Framework To Use?
Kasra Khosravi
 
Why Scala Presentation
Why Scala  PresentationWhy Scala  Presentation
Why Scala Presentationguestc185e0e
 
Scala
ScalaScala
Scala
sryx
 
Things you must know on ruby on rails single page application
Things you must know on ruby on rails single page applicationThings you must know on ruby on rails single page application
Things you must know on ruby on rails single page application
Andolasoft Inc
 
Web Dev 21-01-2024.pptx
Web Dev 21-01-2024.pptxWeb Dev 21-01-2024.pptx
Web Dev 21-01-2024.pptx
PARDHIVANNABATTULA
 
What is a good technology stack today?
What is a good technology stack today?What is a good technology stack today?
What is a good technology stack today?
Netlight Consulting
 

Similar to Scala & Swagger at Wordnik (20)

JAVA J2EE Training in Coimbatore - Fundamentals of Java J2EE
JAVA J2EE Training in Coimbatore - Fundamentals of Java J2EE JAVA J2EE Training in Coimbatore - Fundamentals of Java J2EE
JAVA J2EE Training in Coimbatore - Fundamentals of Java J2EE
 
Rails Vs CakePHP
Rails Vs CakePHPRails Vs CakePHP
Rails Vs CakePHP
 
Ibm_interconnect_restapi_workshop
Ibm_interconnect_restapi_workshopIbm_interconnect_restapi_workshop
Ibm_interconnect_restapi_workshop
 
Play Framework: Intro & High-Level Overview
Play Framework: Intro & High-Level OverviewPlay Framework: Intro & High-Level Overview
Play Framework: Intro & High-Level Overview
 
Ashok_Vardhan_Cheemakurthy
Ashok_Vardhan_CheemakurthyAshok_Vardhan_Cheemakurthy
Ashok_Vardhan_Cheemakurthy
 
Introduction to Scala JS
Introduction to Scala JSIntroduction to Scala JS
Introduction to Scala JS
 
Documenting Your API
Documenting Your APIDocumenting Your API
Documenting Your API
 
Overview of Java
Overview of JavaOverview of Java
Overview of Java
 
Isomorphic javascript - Uppsala.js #8
Isomorphic javascript - Uppsala.js #8Isomorphic javascript - Uppsala.js #8
Isomorphic javascript - Uppsala.js #8
 
December 4 SDForum Java Sig Presentation
December 4 SDForum Java Sig PresentationDecember 4 SDForum Java Sig Presentation
December 4 SDForum Java Sig Presentation
 
API workshop: Introduction to APIs (TC Camp)
API workshop: Introduction to APIs (TC Camp)API workshop: Introduction to APIs (TC Camp)
API workshop: Introduction to APIs (TC Camp)
 
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and ArquillianDeveloper Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
 
Class 6: Introduction to web technology entrepreneurship
Class 6: Introduction to web technology entrepreneurshipClass 6: Introduction to web technology entrepreneurship
Class 6: Introduction to web technology entrepreneurship
 
Wso2 product release webinar introducing jaggery
Wso2 product release webinar   introducing jaggeryWso2 product release webinar   introducing jaggery
Wso2 product release webinar introducing jaggery
 
What Web Framework To Use?
What Web Framework To Use?What Web Framework To Use?
What Web Framework To Use?
 
Why Scala Presentation
Why Scala  PresentationWhy Scala  Presentation
Why Scala Presentation
 
Scala
ScalaScala
Scala
 
Things you must know on ruby on rails single page application
Things you must know on ruby on rails single page applicationThings you must know on ruby on rails single page application
Things you must know on ruby on rails single page application
 
Web Dev 21-01-2024.pptx
Web Dev 21-01-2024.pptxWeb Dev 21-01-2024.pptx
Web Dev 21-01-2024.pptx
 
What is a good technology stack today?
What is a good technology stack today?What is a good technology stack today?
What is a good technology stack today?
 

More from Tony Tam

API Design first with Swagger
API Design first with SwaggerAPI Design first with Swagger
API Design first 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
 
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
 
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 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
 
Inside Wordnik's Architecture
Inside Wordnik's ArchitectureInside Wordnik's Architecture
Inside Wordnik's Architecture
Tony Tam
 
Scaling with swagger
Scaling with swaggerScaling with swagger
Scaling with swagger
Tony Tam
 
Running MongoDB in the Cloud
Running MongoDB in the CloudRunning MongoDB in the Cloud
Running MongoDB in the Cloud
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 (16)

API Design first with Swagger
API Design first with SwaggerAPI Design first with Swagger
API Design first 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
 
Fastest to Mobile with Scalatra + Swagger
Fastest to Mobile with Scalatra + SwaggerFastest to Mobile with Scalatra + Swagger
Fastest to Mobile with Scalatra + Swagger
 
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 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
 
Inside Wordnik's Architecture
Inside Wordnik's ArchitectureInside Wordnik's Architecture
Inside Wordnik's Architecture
 
Scaling with swagger
Scaling with swaggerScaling with swagger
Scaling with swagger
 
Running MongoDB in the Cloud
Running MongoDB in the CloudRunning MongoDB in the Cloud
Running MongoDB in the Cloud
 
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

Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
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
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
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
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
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
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
UiPathCommunity
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
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
 
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
 

Recently uploaded (20)

Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
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
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
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
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
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
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
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
 
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 -...
 

Scala & Swagger at Wordnik

  • 1. Scala & Swagger at Wordnik Tony Tam @fehguy
  • 2. Agenda Who is Wordnik? Why bother with this Scala thing? What did we get from it? What is Swagger Why it should matter to you
  • 3. Wordnik Tech Overview API based infrastructure Micro service oriented architecture Business by Scala, Java, MongoDB Beauty by Javascript, Ruby 20M API calls daily Powered by Swagger, inside & out 20B+ hot documents in MongoDB
  • 4. Why Bother with Scala? Not just looking for next new thing “I was just getting good at ${language.name}!” Technology selection has consequences .netvs OSS Flash vs. HTML5 Java is… Stable Fast Widely accepted
  • 5. Why Bother with Scala? Look at the scenery One size does NOT fit all Rise of Ruby, Javascript, node.js, etc. Hey, they did lots of things right Focus on making things easy
  • 6. So What is it? JVM-based language Started by Martin Odersky Functional & OO Typesafe Fully compatible with Java IncludesDizzying Syntax
  • 7. Java Pain Points DRY is difficult with Java Interfaces are great Implementation? Many ways to peel the onion! Easy to follow Often explosive LOC!
  • 8. Example Our REST service Back-end returns different object implementations depending on operation
  • 9. Example Many operations produce models with similar attributes Resulting in a mess of classes
  • 10. Example An Interface… An Implementation…
  • 13. Example Implementation is duplicated everywhere Annotations are duplicated everywhere Am I lazy to complain? Consistency Matters!
  • 14. Simplified with Scala Objects can have Traits Like java interfaces + ruby mixins Creates “proper” subtypes Compiler built, concrete classes The “Word” trait… The corresponding impl…
  • 15. Simplified with Scala More traits. Reuse these across your codebase! The other Impls:
  • 16. Simplified with Scala Big deal? Just the beginning of the good stuff Scala syntax In Java, strict syntax is enforced In Scala: “it’s OK unless it’s not”
  • 17. XML in Scala Support is baked in Declaring XML
  • 18. XML in Scala Parsing XML is easy
  • 19. Text Processing But first, the match statement Like switch:
  • 20. Text Processing But much more powerful
  • 21. Text Processing Pattern matching + “match” statement Extract name in different formats
  • 22. Text Processing (Erin,McKean) (Joe,Hyrkin) (Anthony,L.,Tam) Kumanan
  • 23. Summary of Scala @ Wordnik Lost NONE of our Java codebase Code reuse is up Code consistency is up Flexibility is up LOC is down Readability is…
  • 24. Why Swagger? Integration with REST APIs is troublesome and inconsistent Different vendors have different REST semantics Client libraries vary wildly by vendor, language Documentation for developers is an afterthought Input parameters, allowable values, models, responses are found via trial & error Internally a PITA YOUR API is too hard to develop against!
  • 25. How Does it Work? Your server produces a Resource List All available APIs http://petstore.swagger.wordnik.com/api/resources.json “It’s like a sitemap for your API!”
  • 26. How Does it Work? Each API declares itself Available operations Parameters Type (path, query, body) Allowable values/data types Input/output models Error responses with descriptions
  • 28. API Response Knowing input/output models is helpful! Based on JSON Schema (Draft) http://tools.ietf.org/html/draft-zyp-json-schema-03
  • 29. But what’s the benefit? A Sandbox!
  • 30. Client Library Generation Code generation based on Resource Spec Template-based Framework Consume REST Methods, Models, Parameters Produce client libraries “Know before you go HTTP” Required values, fields are known by the client Only expose what’s allowed! Swagger filtering removes methods/models you don’t have access to
  • 31. Client Library Generation Super user access Ordinary dev access
  • 32. Test Framework JSON-driven tests for your Client + API Expected data Test Suites
  • 34. Easy to add For Java/Scala via JAX-RS… Add swagger-core.jar Annotate your models per your @Providerclass Annotate your resources
  • 35. Easy to add For node.js via express Require swagger.js Declare your swagger specs, models Could use AST/DSL to do automatically Add your operations, configure and start
  • 36. Easy DIY The Swagger spec is Language Agnostic! ANY swagger-compliant server can… Use the Swagger client lib generator Use the test framework Use the sandbox UI More server support from Wordnik Play, Rails .net, others community developed
  • 37. Where to go Next Try Swagger swagger.wordnik.com See it in action developer.wordnik.com/docs Download the source/samples swagger.wordnik.com/downloads Discuss it groups.google.com/group/wordnik-api #swagger_doc on freenode