SlideShare une entreprise Scribd logo
1  sur  25
Télécharger pour lire hors ligne
APIs/Services for
  Mobile Apps
     (in Ruby)

   Andrei Navarro
Background
● Web development for Startups
  ○ Web Products (w/ APIs)
● .NET, PHP, Ruby (Rails, Ramaze)
● Currently:
  ○ Tech Guy at Scrambled Eggs
  ○ Faculty at Ateneo de Manila
● PHRUG, Startup Weekend
● Geekcamp
History
● 80 - 90s: Computers for "Business" use
● 90s - Early 00s: "dotcom" era; ecommerce
  ○ Web TV
● Mid 00s: "Web 2.0"
History
Recent Years
● Late 00s - 10s: Mobile Era
  ○   Faster mobile internet speed
  ○   Easier access to devices
  ○   Exponential growth in users
  ○   "App" Era
● People becoming App developers instead of
  going into Web
Mobile Apps need Web
● Web developers are still relevant
  ○ Need to provide data/interconnectedness to mobile
    apps
  ○ Moving from Application layer to
    Presentation/Session layer
Similarities with RIA
● Javascript/AJAX makes requests to your
  backend -- which is connected to your
  database
AJAX architecture
Quick Story (Amundsen vs Scott)
● The Antarctic Race
  ○ http://www.slideshare.net/apigee/amundsens-dogs-
    information-halos-and-apis
● Apps are the "South Pole"
● Native Wisdom: Your APIs support and
  strengthen your mobile apps (whether built
  by yourself or by a developer community)
Mobile App Data Architecture
Building APIs
● Just like any other web app
  ○ no view layer (HTML/CSS/JS)
  ○ apps "view" your API
● Transfer is via HTTP/HTTPS
● Plan your format
  ○ JSON, XML, SOAP etc.
  ○ REST/RPC?
  ○ Parsing capability on client end
● Scalability
● Sessions and Authentication
  ○ token-based
  ○ header-based
  ○ devise
Design-by-Contract
● Define your "interface" that will supply the
  mobile app with JSON/XML data
   ○ use mocks!
● When building your API, conform to that
  interface
● Allows parallelization of development
Testing
● Web apps are tested on a browser
● APIs ultimate test is on the target clients
● Development usually happens in parallel --
  and you need to validate your API works
  before app is completed
  ○ rest-client gem
  ○ rest-client chrome/firefox extensions
Building it with Rails
● Rails already supports RESTful architecture
● Rails already supports multiple formats
● Can use RSpec/Test::Unit to validate API
  requests
● Variety of existing gems already tested and
  well integrated with Rails
Issues with Rails
● Issues for APIs (not in general)
● Adds a lot of dependencies that aren't
  needed for your purpose
  ○ Wasted memory
● Cherry pick middleware and modules from
  the stack
  ○ hassle.
● Others
  ○ http://engineering.gomiso.com/2011/05/16/if-youre-
    using-to_json-youre-doing-it-wrong/
Some solutions
● RABL (Ruby API builder language)
  ○ https://github.com/nesquena/rabl
● Rails-API
  ○ https://github.com/rails-api/rails-api
  ○ a subset of rails specifically for building APIs
Microframeworks
● Much lighter than Rails
  ○   Sinatra/Padrino
  ○   Ramaze
  ○   Merb
  ○   Camping
● Build only what you need
  ○ smaller footprint
● You'll need to know Ruby well
  ○ that's actually a good thing
Grape Framework
● https://github.com/intridea/grape
● From Intridea, creators of OmniAuth
● "An opinionated microframework for creating
  REST-like APIs in Ruby"

Generalized
Rapid
API
Erector
Grape Framework
Grape Framework
● Rack-based
   ○ easy deployment over passenger
   ○ run via config.ru
   ○ can sit alongside your Rails app
     ■ mount My::API in config/routes.rb
● Different content-types supported
● Fun HTTP stuff (headers, verbs, status
  codes etc)
● Entities: grouping/presenting your data into
  "Models"
● Killer feature: API versioning
API Versioning
Traditional Web Development
API Versioning
● Support several versions of Mobile apps
  ○ up to client/user to update
● App store problem
  ○ Dev
  ○ Staging
    ■ App store staging
  ○ Production
    ■ App store production
API Versioning
Recommendations
● MVC-ize your application
  ○ It's just good design.
● Use Devise/Omniauth for authentication
  ○ token-based authentication
● Use oj gem for JSON
  ○ https://github.com/ohler55/oj
  ○ faster Json parser/encoder compared to native ruby
    JSON parsing
● Use ox gem for XML
Questions?
 @dreinavarro

Contenu connexe

Tendances

Everything you need to know about mern stack programming
Everything you need to know about mern stack programmingEverything you need to know about mern stack programming
Everything you need to know about mern stack programmingJAMESJOHN130
 
Intro to Lightning Web Components
Intro to Lightning Web ComponentsIntro to Lightning Web Components
Intro to Lightning Web ComponentsCalvin LaBelle
 
Getting Started with Lightning Web Components | LWC | Salesforce
Getting Started with Lightning Web Components | LWC | SalesforceGetting Started with Lightning Web Components | LWC | Salesforce
Getting Started with Lightning Web Components | LWC | SalesforceRahul Malhotra
 
Product Camp Silicon Valley 2018 - PM Technical Skills
Product Camp Silicon Valley 2018 - PM Technical SkillsProduct Camp Silicon Valley 2018 - PM Technical Skills
Product Camp Silicon Valley 2018 - PM Technical SkillsSandeep Adwankar
 
Decoupled Drupal: What This Means for Developers
Decoupled Drupal: What This Means for DevelopersDecoupled Drupal: What This Means for Developers
Decoupled Drupal: What This Means for DevelopersAcquia
 
Boston, MA Developer Group 2/7/2019 - Introduction to lightning web components
Boston, MA Developer Group 2/7/2019 - Introduction to lightning web componentsBoston, MA Developer Group 2/7/2019 - Introduction to lightning web components
Boston, MA Developer Group 2/7/2019 - Introduction to lightning web componentsBingWang77
 
Introduction to Modern and Emerging Web Technologies
Introduction to Modern and Emerging Web TechnologiesIntroduction to Modern and Emerging Web Technologies
Introduction to Modern and Emerging Web TechnologiesSuresh Patidar
 
Website development & it's trends
Website development & it's trendsWebsite development & it's trends
Website development & it's trendsSunCart Store
 
Amir Zuker: Building web apps with web assembly and blazor - Architecture Nex...
Amir Zuker: Building web apps with web assembly and blazor - Architecture Nex...Amir Zuker: Building web apps with web assembly and blazor - Architecture Nex...
Amir Zuker: Building web apps with web assembly and blazor - Architecture Nex...CodeValue
 
10 top web development frameworks (new version 21 11)
10 top web development frameworks (new version 21 11)10 top web development frameworks (new version 21 11)
10 top web development frameworks (new version 21 11)Mandar Majmudar
 
Top Web Development Frameworks Comparison: All You Need To Know
Top Web Development Frameworks Comparison: All You Need To KnowTop Web Development Frameworks Comparison: All You Need To Know
Top Web Development Frameworks Comparison: All You Need To KnowPixel Crayons
 
Intro to lwc - dev week slides
Intro to lwc - dev week slidesIntro to lwc - dev week slides
Intro to lwc - dev week slidesSara Sali
 
PLASTIC 2011: "Enterprise JavaScript with Jangaroo"
PLASTIC 2011: "Enterprise JavaScript with Jangaroo"PLASTIC 2011: "Enterprise JavaScript with Jangaroo"
PLASTIC 2011: "Enterprise JavaScript with Jangaroo"Frank Wienberg
 
Silverlight - What Is It And How Can We Use It
Silverlight - What Is It And How Can We Use ItSilverlight - What Is It And How Can We Use It
Silverlight - What Is It And How Can We Use ItVenketash (Pat) Ramadass
 
Silverlight abhinav - slideshare
Silverlight   abhinav - slideshareSilverlight   abhinav - slideshare
Silverlight abhinav - slideshareabhinav4133
 
Exciting features in visual studio 2017
Exciting features in visual studio 2017Exciting features in visual studio 2017
Exciting features in visual studio 2017Md. Mahedee Hasan
 
Migrating to HTML5, Migrating Silverlight to HTML5, Migration Applications t...
Migrating to HTML5,  Migrating Silverlight to HTML5, Migration Applications t...Migrating to HTML5,  Migrating Silverlight to HTML5, Migration Applications t...
Migrating to HTML5, Migrating Silverlight to HTML5, Migration Applications t...Idexcel Technologies
 
Top 5 Front End Development Tools For 2021
Top 5 Front End Development Tools For 2021Top 5 Front End Development Tools For 2021
Top 5 Front End Development Tools For 2021ForceBolt
 

Tendances (19)

Everything you need to know about mern stack programming
Everything you need to know about mern stack programmingEverything you need to know about mern stack programming
Everything you need to know about mern stack programming
 
Intro to Lightning Web Components
Intro to Lightning Web ComponentsIntro to Lightning Web Components
Intro to Lightning Web Components
 
Getting Started with Lightning Web Components | LWC | Salesforce
Getting Started with Lightning Web Components | LWC | SalesforceGetting Started with Lightning Web Components | LWC | Salesforce
Getting Started with Lightning Web Components | LWC | Salesforce
 
Product Camp Silicon Valley 2018 - PM Technical Skills
Product Camp Silicon Valley 2018 - PM Technical SkillsProduct Camp Silicon Valley 2018 - PM Technical Skills
Product Camp Silicon Valley 2018 - PM Technical Skills
 
Decoupled Drupal: What This Means for Developers
Decoupled Drupal: What This Means for DevelopersDecoupled Drupal: What This Means for Developers
Decoupled Drupal: What This Means for Developers
 
Boston, MA Developer Group 2/7/2019 - Introduction to lightning web components
Boston, MA Developer Group 2/7/2019 - Introduction to lightning web componentsBoston, MA Developer Group 2/7/2019 - Introduction to lightning web components
Boston, MA Developer Group 2/7/2019 - Introduction to lightning web components
 
Introduction to Modern and Emerging Web Technologies
Introduction to Modern and Emerging Web TechnologiesIntroduction to Modern and Emerging Web Technologies
Introduction to Modern and Emerging Web Technologies
 
Website development & it's trends
Website development & it's trendsWebsite development & it's trends
Website development & it's trends
 
Amir Zuker: Building web apps with web assembly and blazor - Architecture Nex...
Amir Zuker: Building web apps with web assembly and blazor - Architecture Nex...Amir Zuker: Building web apps with web assembly and blazor - Architecture Nex...
Amir Zuker: Building web apps with web assembly and blazor - Architecture Nex...
 
10 top web development frameworks (new version 21 11)
10 top web development frameworks (new version 21 11)10 top web development frameworks (new version 21 11)
10 top web development frameworks (new version 21 11)
 
Top 10 web application development frameworks 2016
Top 10 web application development frameworks 2016Top 10 web application development frameworks 2016
Top 10 web application development frameworks 2016
 
Top Web Development Frameworks Comparison: All You Need To Know
Top Web Development Frameworks Comparison: All You Need To KnowTop Web Development Frameworks Comparison: All You Need To Know
Top Web Development Frameworks Comparison: All You Need To Know
 
Intro to lwc - dev week slides
Intro to lwc - dev week slidesIntro to lwc - dev week slides
Intro to lwc - dev week slides
 
PLASTIC 2011: "Enterprise JavaScript with Jangaroo"
PLASTIC 2011: "Enterprise JavaScript with Jangaroo"PLASTIC 2011: "Enterprise JavaScript with Jangaroo"
PLASTIC 2011: "Enterprise JavaScript with Jangaroo"
 
Silverlight - What Is It And How Can We Use It
Silverlight - What Is It And How Can We Use ItSilverlight - What Is It And How Can We Use It
Silverlight - What Is It And How Can We Use It
 
Silverlight abhinav - slideshare
Silverlight   abhinav - slideshareSilverlight   abhinav - slideshare
Silverlight abhinav - slideshare
 
Exciting features in visual studio 2017
Exciting features in visual studio 2017Exciting features in visual studio 2017
Exciting features in visual studio 2017
 
Migrating to HTML5, Migrating Silverlight to HTML5, Migration Applications t...
Migrating to HTML5,  Migrating Silverlight to HTML5, Migration Applications t...Migrating to HTML5,  Migrating Silverlight to HTML5, Migration Applications t...
Migrating to HTML5, Migrating Silverlight to HTML5, Migration Applications t...
 
Top 5 Front End Development Tools For 2021
Top 5 Front End Development Tools For 2021Top 5 Front End Development Tools For 2021
Top 5 Front End Development Tools For 2021
 

En vedette

Creating Web APIs with JSON-LD and RDF
Creating Web APIs with JSON-LD and RDFCreating Web APIs with JSON-LD and RDF
Creating Web APIs with JSON-LD and RDFdonaldlsmithjr
 
Building a repository of biomedical ontologies with Neo4j
Building a repository of biomedical ontologies with Neo4jBuilding a repository of biomedical ontologies with Neo4j
Building a repository of biomedical ontologies with Neo4jSimon Jupp
 
JSON Schema: Your API's Secret Weapon
JSON Schema: Your API's Secret WeaponJSON Schema: Your API's Secret Weapon
JSON Schema: Your API's Secret WeaponPete Gamache
 
Managing Genetic Ancestry at Scale with Neo4j and Kafka - StampedeCon 2015
Managing Genetic Ancestry at Scale with Neo4j and Kafka - StampedeCon 2015Managing Genetic Ancestry at Scale with Neo4j and Kafka - StampedeCon 2015
Managing Genetic Ancestry at Scale with Neo4j and Kafka - StampedeCon 2015StampedeCon
 
Neo4j - 5 cool graph examples
Neo4j - 5 cool graph examplesNeo4j - 5 cool graph examples
Neo4j - 5 cool graph examplesPeter Neubauer
 

En vedette (7)

Creating Web APIs with JSON-LD and RDF
Creating Web APIs with JSON-LD and RDFCreating Web APIs with JSON-LD and RDF
Creating Web APIs with JSON-LD and RDF
 
Introdução ao Neo4j
Introdução ao Neo4jIntrodução ao Neo4j
Introdução ao Neo4j
 
Building a repository of biomedical ontologies with Neo4j
Building a repository of biomedical ontologies with Neo4jBuilding a repository of biomedical ontologies with Neo4j
Building a repository of biomedical ontologies with Neo4j
 
JSON Schema: Your API's Secret Weapon
JSON Schema: Your API's Secret WeaponJSON Schema: Your API's Secret Weapon
JSON Schema: Your API's Secret Weapon
 
Managing Genetic Ancestry at Scale with Neo4j and Kafka - StampedeCon 2015
Managing Genetic Ancestry at Scale with Neo4j and Kafka - StampedeCon 2015Managing Genetic Ancestry at Scale with Neo4j and Kafka - StampedeCon 2015
Managing Genetic Ancestry at Scale with Neo4j and Kafka - StampedeCon 2015
 
Neo4j - 5 cool graph examples
Neo4j - 5 cool graph examplesNeo4j - 5 cool graph examples
Neo4j - 5 cool graph examples
 
Models for hierarchical data
Models for hierarchical dataModels for hierarchical data
Models for hierarchical data
 

Similaire à APIs for mobile

Introducing chrome apps (ogura)
Introducing chrome apps (ogura)Introducing chrome apps (ogura)
Introducing chrome apps (ogura)Kazuhiro Ogura
 
Refactoring to a Single Page Application
Refactoring to a Single Page ApplicationRefactoring to a Single Page Application
Refactoring to a Single Page ApplicationCodemotion
 
GlueCon 2015 - How REST APIs can glue all types of devices together
GlueCon 2015 - How REST APIs can glue all types of devices togetherGlueCon 2015 - How REST APIs can glue all types of devices together
GlueCon 2015 - How REST APIs can glue all types of devices togetherRestlet
 
Mean Stack - An Overview
Mean Stack - An OverviewMean Stack - An Overview
Mean Stack - An OverviewNaveen Pete
 
Programming for non tech entrepreneurs
Programming for non tech entrepreneursProgramming for non tech entrepreneurs
Programming for non tech entrepreneursRodrigo Gil
 
Defrag 2014 - Blend Web IDEs, Open Source and PaaS to Create and Deploy APIs
Defrag 2014 - Blend Web IDEs, Open Source and PaaS to Create and Deploy APIsDefrag 2014 - Blend Web IDEs, Open Source and PaaS to Create and Deploy APIs
Defrag 2014 - Blend Web IDEs, Open Source and PaaS to Create and Deploy APIsRestlet
 
QCon SF 2014 - Create and Deploy APIs using Web IDEs, Open Source Frameworks ...
QCon SF 2014 - Create and Deploy APIs using Web IDEs, Open Source Frameworks ...QCon SF 2014 - Create and Deploy APIs using Web IDEs, Open Source Frameworks ...
QCon SF 2014 - Create and Deploy APIs using Web IDEs, Open Source Frameworks ...Restlet
 
Progressive web applications
Progressive web applicationsProgressive web applications
Progressive web applicationsTom Martin
 
Client vs Server Templating: Speed up initial load for SPA with Angular as an...
Client vs Server Templating: Speed up initial load for SPA with Angular as an...Client vs Server Templating: Speed up initial load for SPA with Angular as an...
Client vs Server Templating: Speed up initial load for SPA with Angular as an...David Amend
 
Rho mobile v4 - DroidCon Paris 18 june 2013
Rho mobile v4 - DroidCon Paris 18 june 2013Rho mobile v4 - DroidCon Paris 18 june 2013
Rho mobile v4 - DroidCon Paris 18 june 2013Paris Android User Group
 
Hybridmobileapps 130130213844-phpapp02
Hybridmobileapps 130130213844-phpapp02Hybridmobileapps 130130213844-phpapp02
Hybridmobileapps 130130213844-phpapp02weeyee
 
SumitK's mobile app dev using drupal as base ststem
SumitK's mobile app dev using drupal as base ststemSumitK's mobile app dev using drupal as base ststem
SumitK's mobile app dev using drupal as base ststemSumit Kataria
 
From RPG OA to Node.js: Approaches to Application Modernization - Greg Patterson
From RPG OA to Node.js: Approaches to Application Modernization - Greg PattersonFrom RPG OA to Node.js: Approaches to Application Modernization - Greg Patterson
From RPG OA to Node.js: Approaches to Application Modernization - Greg PattersonFresche Solutions
 
Android Development...Using Web Technologies
Android Development...Using Web TechnologiesAndroid Development...Using Web Technologies
Android Development...Using Web TechnologiesCommonsWare
 
Creating a custom API for a headless Drupal
Creating a custom API for a headless DrupalCreating a custom API for a headless Drupal
Creating a custom API for a headless DrupalExove
 
The Importance Things of Full Stack Development
The Importance Things of Full Stack DevelopmentThe Importance Things of Full Stack Development
The Importance Things of Full Stack DevelopmentMike Taylor
 
Post-relational databases: What's wrong with web development? v3
Post-relational databases: What's wrong with web development? v3Post-relational databases: What's wrong with web development? v3
Post-relational databases: What's wrong with web development? v3Dobrica Pavlinušić
 
Google App Engine Overview and Update
Google App Engine Overview and UpdateGoogle App Engine Overview and Update
Google App Engine Overview and UpdateChris Schalk
 

Similaire à APIs for mobile (20)

Introducing chrome apps (ogura)
Introducing chrome apps (ogura)Introducing chrome apps (ogura)
Introducing chrome apps (ogura)
 
Refactoring to a SPA
Refactoring to a SPARefactoring to a SPA
Refactoring to a SPA
 
Refactoring to a Single Page Application
Refactoring to a Single Page ApplicationRefactoring to a Single Page Application
Refactoring to a Single Page Application
 
GlueCon 2015 - How REST APIs can glue all types of devices together
GlueCon 2015 - How REST APIs can glue all types of devices togetherGlueCon 2015 - How REST APIs can glue all types of devices together
GlueCon 2015 - How REST APIs can glue all types of devices together
 
Mean Stack - An Overview
Mean Stack - An OverviewMean Stack - An Overview
Mean Stack - An Overview
 
Programming for non tech entrepreneurs
Programming for non tech entrepreneursProgramming for non tech entrepreneurs
Programming for non tech entrepreneurs
 
Defrag 2014 - Blend Web IDEs, Open Source and PaaS to Create and Deploy APIs
Defrag 2014 - Blend Web IDEs, Open Source and PaaS to Create and Deploy APIsDefrag 2014 - Blend Web IDEs, Open Source and PaaS to Create and Deploy APIs
Defrag 2014 - Blend Web IDEs, Open Source and PaaS to Create and Deploy APIs
 
QCon SF 2014 - Create and Deploy APIs using Web IDEs, Open Source Frameworks ...
QCon SF 2014 - Create and Deploy APIs using Web IDEs, Open Source Frameworks ...QCon SF 2014 - Create and Deploy APIs using Web IDEs, Open Source Frameworks ...
QCon SF 2014 - Create and Deploy APIs using Web IDEs, Open Source Frameworks ...
 
Webdevelopment
WebdevelopmentWebdevelopment
Webdevelopment
 
Progressive web applications
Progressive web applicationsProgressive web applications
Progressive web applications
 
Client vs Server Templating: Speed up initial load for SPA with Angular as an...
Client vs Server Templating: Speed up initial load for SPA with Angular as an...Client vs Server Templating: Speed up initial load for SPA with Angular as an...
Client vs Server Templating: Speed up initial load for SPA with Angular as an...
 
Rho mobile v4 - DroidCon Paris 18 june 2013
Rho mobile v4 - DroidCon Paris 18 june 2013Rho mobile v4 - DroidCon Paris 18 june 2013
Rho mobile v4 - DroidCon Paris 18 june 2013
 
Hybridmobileapps 130130213844-phpapp02
Hybridmobileapps 130130213844-phpapp02Hybridmobileapps 130130213844-phpapp02
Hybridmobileapps 130130213844-phpapp02
 
SumitK's mobile app dev using drupal as base ststem
SumitK's mobile app dev using drupal as base ststemSumitK's mobile app dev using drupal as base ststem
SumitK's mobile app dev using drupal as base ststem
 
From RPG OA to Node.js: Approaches to Application Modernization - Greg Patterson
From RPG OA to Node.js: Approaches to Application Modernization - Greg PattersonFrom RPG OA to Node.js: Approaches to Application Modernization - Greg Patterson
From RPG OA to Node.js: Approaches to Application Modernization - Greg Patterson
 
Android Development...Using Web Technologies
Android Development...Using Web TechnologiesAndroid Development...Using Web Technologies
Android Development...Using Web Technologies
 
Creating a custom API for a headless Drupal
Creating a custom API for a headless DrupalCreating a custom API for a headless Drupal
Creating a custom API for a headless Drupal
 
The Importance Things of Full Stack Development
The Importance Things of Full Stack DevelopmentThe Importance Things of Full Stack Development
The Importance Things of Full Stack Development
 
Post-relational databases: What's wrong with web development? v3
Post-relational databases: What's wrong with web development? v3Post-relational databases: What's wrong with web development? v3
Post-relational databases: What's wrong with web development? v3
 
Google App Engine Overview and Update
Google App Engine Overview and UpdateGoogle App Engine Overview and Update
Google App Engine Overview and Update
 

Dernier

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 

Dernier (20)

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

APIs for mobile

  • 1. APIs/Services for Mobile Apps (in Ruby) Andrei Navarro
  • 2. Background ● Web development for Startups ○ Web Products (w/ APIs) ● .NET, PHP, Ruby (Rails, Ramaze) ● Currently: ○ Tech Guy at Scrambled Eggs ○ Faculty at Ateneo de Manila ● PHRUG, Startup Weekend ● Geekcamp
  • 3. History ● 80 - 90s: Computers for "Business" use ● 90s - Early 00s: "dotcom" era; ecommerce ○ Web TV ● Mid 00s: "Web 2.0"
  • 5. Recent Years ● Late 00s - 10s: Mobile Era ○ Faster mobile internet speed ○ Easier access to devices ○ Exponential growth in users ○ "App" Era ● People becoming App developers instead of going into Web
  • 6. Mobile Apps need Web ● Web developers are still relevant ○ Need to provide data/interconnectedness to mobile apps ○ Moving from Application layer to Presentation/Session layer
  • 7. Similarities with RIA ● Javascript/AJAX makes requests to your backend -- which is connected to your database
  • 9. Quick Story (Amundsen vs Scott) ● The Antarctic Race ○ http://www.slideshare.net/apigee/amundsens-dogs- information-halos-and-apis ● Apps are the "South Pole" ● Native Wisdom: Your APIs support and strengthen your mobile apps (whether built by yourself or by a developer community)
  • 10. Mobile App Data Architecture
  • 11. Building APIs ● Just like any other web app ○ no view layer (HTML/CSS/JS) ○ apps "view" your API ● Transfer is via HTTP/HTTPS ● Plan your format ○ JSON, XML, SOAP etc. ○ REST/RPC? ○ Parsing capability on client end ● Scalability ● Sessions and Authentication ○ token-based ○ header-based ○ devise
  • 12. Design-by-Contract ● Define your "interface" that will supply the mobile app with JSON/XML data ○ use mocks! ● When building your API, conform to that interface ● Allows parallelization of development
  • 13. Testing ● Web apps are tested on a browser ● APIs ultimate test is on the target clients ● Development usually happens in parallel -- and you need to validate your API works before app is completed ○ rest-client gem ○ rest-client chrome/firefox extensions
  • 14. Building it with Rails ● Rails already supports RESTful architecture ● Rails already supports multiple formats ● Can use RSpec/Test::Unit to validate API requests ● Variety of existing gems already tested and well integrated with Rails
  • 15. Issues with Rails ● Issues for APIs (not in general) ● Adds a lot of dependencies that aren't needed for your purpose ○ Wasted memory ● Cherry pick middleware and modules from the stack ○ hassle. ● Others ○ http://engineering.gomiso.com/2011/05/16/if-youre- using-to_json-youre-doing-it-wrong/
  • 16. Some solutions ● RABL (Ruby API builder language) ○ https://github.com/nesquena/rabl ● Rails-API ○ https://github.com/rails-api/rails-api ○ a subset of rails specifically for building APIs
  • 17. Microframeworks ● Much lighter than Rails ○ Sinatra/Padrino ○ Ramaze ○ Merb ○ Camping ● Build only what you need ○ smaller footprint ● You'll need to know Ruby well ○ that's actually a good thing
  • 18. Grape Framework ● https://github.com/intridea/grape ● From Intridea, creators of OmniAuth ● "An opinionated microframework for creating REST-like APIs in Ruby" Generalized Rapid API Erector
  • 20. Grape Framework ● Rack-based ○ easy deployment over passenger ○ run via config.ru ○ can sit alongside your Rails app ■ mount My::API in config/routes.rb ● Different content-types supported ● Fun HTTP stuff (headers, verbs, status codes etc) ● Entities: grouping/presenting your data into "Models" ● Killer feature: API versioning
  • 22. API Versioning ● Support several versions of Mobile apps ○ up to client/user to update ● App store problem ○ Dev ○ Staging ■ App store staging ○ Production ■ App store production
  • 24. Recommendations ● MVC-ize your application ○ It's just good design. ● Use Devise/Omniauth for authentication ○ token-based authentication ● Use oj gem for JSON ○ https://github.com/ohler55/oj ○ faster Json parser/encoder compared to native ruby JSON parsing ● Use ox gem for XML