SlideShare une entreprise Scribd logo
1  sur  83
Craig Ulliott
  likes building things
About me
About me

•   Needs to know how everything works
About me

•   Needs to know how everything works

•   Likes things that scale
About me

•   Needs to know how everything works

•   Likes things that scale

•   Think’s almost everything is inefficient
About me

•   Needs to know how everything works

•   Likes things that scale

•   Think’s almost everything is inefficient

•   Hates people
About me

•   Needs to know how everything works

•   Likes things that scale

•   Think’s almost everything is inefficient

•   Hates people

    •   Just kidding
About me

•   Needs to know how everything works

•   Likes things that scale

•   Think’s almost everything is inefficient

•   Hates people

    •   Just kidding

        •   But people are the cause of all the worlds inefficiencies
About me

•   Needs to know how everything works

•   Likes things that scale

•   Think’s almost everything is inefficient

•   Hates people

    •   Just kidding

        •   But people are the cause of all the worlds inefficiencies


What I do and have done:
Mistakes I’ve Made
Mistakes I’ve Made

Lessons I’ve Learned.
Minimum Viable Product
Minimum Viable Product



• Short sprints (release code regularly)
Minimum Viable Product



• Short sprints (release code regularly)
• Spend an hour thinking about why you’re
  building something, before you spend a
  week thinking about how.
Minimum Viable Product



• Short sprints (release code regularly)
• Spend an hour thinking about why you’re
  building something, before you spend a
  week thinking about how.
• Your developing a business not a website
Surround yourself with business people
Surround yourself with business people



•   If you have a good idea, a strong technical co-
    founder and a business co-founder
    - you will get money / incubated / successful
Surround yourself with business people



•   If you have a good idea, a strong technical co-
    founder and a business co-founder
    - you will get money / incubated / successful

•   I get asked every 3 days if I know any developers
    - why are you guys not meeting each other!
Bootstrap if you can
Bootstrap if you can



•   BUSINESSES that work when they are small are
    easier to scale
Bootstrap if you can



•   BUSINESSES that work when they are small are
    easier to scale

•   The first step to becoming an Entrepreneur is not
    quitting your job
Bootstrap if you can



•   BUSINESSES that work when they are small are
    easier to scale

•   The first step to becoming an Entrepreneur is not
    quitting your job

•   You wont be pragmatic if your worried about
    rent / children / debt / x / y / z
Bootstrap if you can



•   BUSINESSES that work when they are small are
    easier to scale

•   The first step to becoming an Entrepreneur is not
    quitting your job

•   You wont be pragmatic if your worried about
    rent / children / debt / x / y / z

•   Its also a great lesson in finances
Don’t be afraid to share your idea


•   “But someone might steal it.”

•   The hardest thing you will do is going to be getting
    someone genuinely interested in your idea.

•   People that could actually execute your idea are
    too busy with their own ideas.

•   It’s a lot cheaper for someone to take a bet (put all
    the risk) on you, than try and do it themselves.
Fail quickly and fail often
Fail quickly and fail often

one in seven businesses make it...
Fail quickly and fail often

one in seven businesses make it...
               ...so start seven businesses!
WIB APIs in 2009
Some problem’s

•   WIB was completely dependent on lots of
    different social networks

    •   They break and change stuff

    •   Our code becomes complicated (entropy)

•   WIB had a small team

    •   And lots of stuff to do

•   WIB had a lot of members

    •   half a billion db rows & 7000+ queries a second
What is abstraction
a web application is like an onion
The Solution:
       “Network Abstraction Layer”


•   Wrapped Facebook, Myspace, Bebo, Hi5,
    Friendster and Orkut

•   Normalized the I/O

•   Absorbed changes where they happen

•   Handled breakages

•   Data sharing across the whole network
    - Facebook user can see a MySpace user
and it’s really extensible




• We can add functionality and data without
  breaking the other networks
• We can add other networks very easily
It’s also nice and scalable (for a team)



• An API has a defined protocol, so
  developers on our team could work side by
  side on the different networks.
• As long as I/O stays the same, they can
  work independently
And it scales well technically



• Dividing an application into layers makes it
  much easier to scale.
• Mainly because the independent layers can
  be scaled (or re-written) independently,
  without breaking other components.
WIB APIs in 2011
WIB APIs in 2011
WIB Today

                           Where I’ve Been . com



                                             The website does not
                                            connect directly to the
                                                  database
 Facebook

  Twitter
                           WIB oAuth 2 REST API
Foursquare

And others...
                Database         Database          Database
Advantages of a single API


•   Saves Time (money) and it’s Extensible (future proof)


•   Teams can work on their own platforms

    •   Website, iPhone, Android, Facebook App et.al.


•   Federate out content (or build developer network)
How to build an API
(an opinionated approach)
how to build stuff in general
how to build stuff in general



• Developers cost
how to build stuff in general



• Developers cost


• Servers cost
Use Ruby on Rails
Use Ruby on Rails

• It allows you to build reliable, powerful,
  readable code
Use Ruby on Rails

• It allows you to build reliable, powerful,
  readable code
• With RoR you can build a business in a
  week and host it for free
Use Ruby on Rails

• It allows you to build reliable, powerful,
  readable code
• With RoR you can build a business in a
  week and host it for free




               Even monkeys use tools!
Why Ruby on Rails is good for an API
Why Ruby on Rails is good for an API
        Especially if you’re a startup
Why Ruby on Rails is good for an API
              Especially if you’re a startup

•   RESTful out of the box
Why Ruby on Rails is good for an API
              Especially if you’re a startup

•   RESTful out of the box

•   Normalized data
Why Ruby on Rails is good for an API
               Especially if you’re a startup

•   RESTful out of the box

•   Normalized data

    •   Encourages powerful abstraction
Why Ruby on Rails is good for an API
               Especially if you’re a startup

•   RESTful out of the box

•   Normalized data

    •   Encourages powerful abstraction

•   It’s easy and quick to develop
Why Ruby on Rails is good for an API
               Especially if you’re a startup

•   RESTful out of the box

•   Normalized data

    •   Encourages powerful abstraction

•   It’s easy and quick to develop

•   Its easy to write tests
Why Ruby on Rails is good for an API
               Especially if you’re a startup

•   RESTful out of the box

•   Normalized data

    •   Encourages powerful abstraction

•   It’s easy and quick to develop

•   Its easy to write tests

•   Scales horizontally (until you’ve already “made it”)
    - the bottleneck will be your DB
RESTful web service


•   REST is how the web already works
    (makes it a pretty well known standard)

•   URL’s are self explanatory (easy to work with)

•   Closely matches the underlying data/objects

    •   Makes it easy to build in a DRY way

    •   Developers can get started very quickly
HTTP methods



•   POST : Create something new

•   GET : Retrieve something that already exists

•   PUT : Update something that already exists

•   DELETE : Remove something that already exists
Authorization and Authentication



• Authentication
 • Who is this
• Authorization
 • Can the Authenticated entity access this
    resource
oAuth1 vs oAuth2


• oAuth 2 is slightly less secure
• But it makes everyone’s lives SO much
  easier
• Build a “trusted” clients paradigm for
  internal use
  - login, register, reset password etc
HTTP Request

       Authentication
                                   Web server



                                   Framework




                                  Authentication
It makes things really easy for
         developers
                                  Authorization
lots of libraries and examples
              exist

                                  API Controller
Access Tokens

•   Different tokens for user+client and client


•   Store useful info in them, allows you to
    calculate on the fly instead of store in the db



        c1234-g7rCEVB867rbe4B-1234567
Access Tokens

•   Different tokens for user+client and client


•   Store useful info in them, allows you to
    calculate on the fly instead of store in the db



        c1234-g7rCEVB867rbe4B-1234567

        client_id = 12345
Access Tokens

•   Different tokens for user+client and client


•   Store useful info in them, allows you to
    calculate on the fly instead of store in the db



        c1234-g7rCEVB867rbe4B-1234567

                                   user_id = 1234576
Access Tokens

•   Different tokens for user+client and client


•   Store useful info in them, allows you to
    calculate on the fly instead of store in the db



        c1234-g7rCEVB867rbe4B-1234567

                  hash(client_secret+user_id)
Access Tokens

•   Different tokens for user+client and client


•   Store useful info in them, allows you to
    calculate on the fly instead of store in the db



        c1234-g7rCEVB867rbe4B-1234567
SSL


iPhone
           WiFi    laptop running squid           internet




 •   Require it, otherwise developers will expose all
     sort of stuff (like keys)

 •   Important if you want to be taken seriously by
     developer community
SSL


iPhone
           WiFi     laptop running squid           internet


               looking at all the traffic is easy



 •   Require it, otherwise developers will expose all
     sort of stuff (like keys)

 •   Important if you want to be taken seriously by
     developer community
Standardized Errors


• Assume success=true
• Always send back errors in the same way,
  so client libraries can be smart

    {
        "error": {
           "type": "ObjectException",
           "message": "Object does not exist"
        }
    }
Limit how much data gets send back

• Mobile developers care a lot about this
• allow customizations:
  fields=name,gender
DRY Definitions
HTTP Request
                           Logging

Errors:                                                  Web server
  •       GetExceptional
          $20 a month (whats your time worth?)

Performance:                                             Framework
  •       New Relic

API Requests

  •       Something simple near the top of your stack      Logging
          (remember, storage is cheap)



                                                        API Controller
GetExceptional
GetExceptional - Backtraces
New Relic
New Relic
Roll your own
Roll your own
JSON



•   It’s smaller than XML

•   Developers write bad xml parsers, that rely on the
    order of the XML nodes

•   Facebook use it, and they set the standard
    - you want your API to be sexy don’t you?
Returning Data

• Standarized
  - objects
  - arrays of objects
  - nested objects
Standardize object output
DRY Documentation never goes out of date




• Build it off the
  - models
  - connections
  - methods
Testing



• Write tests on your API
 • Even if you hate tests
   • It’s easy
    • You can generate most of them just
       like the documentation
Tie it all together


•   A good API is a series of simple layers

•   Keep it DRY

    •   Use the data structure for more dynamic code

•   Standards are your friend

•   There are plenty of examples out there
    - Facebook, Foursquare, Twitter etc
Thanks




• Hope this was useful

Contenu connexe

Tendances

Triple Your Post Frequency
Triple Your Post FrequencyTriple Your Post Frequency
Triple Your Post Frequency
Zemanta
 
Write A Better FM - Ohio Linux 2011
Write A Better FM - Ohio Linux 2011Write A Better FM - Ohio Linux 2011
Write A Better FM - Ohio Linux 2011
Rich Bowen
 

Tendances (20)

Untangling the web week 2 - SEO
Untangling the web week 2 - SEOUntangling the web week 2 - SEO
Untangling the web week 2 - SEO
 
Funtional Ruby - Mikhail Bortnyk
Funtional Ruby - Mikhail BortnykFuntional Ruby - Mikhail Bortnyk
Funtional Ruby - Mikhail Bortnyk
 
Triple your blog post frequency
Triple your blog post frequencyTriple your blog post frequency
Triple your blog post frequency
 
Achieving Beautiful Typography in eBooks
Achieving Beautiful Typography in eBooksAchieving Beautiful Typography in eBooks
Achieving Beautiful Typography in eBooks
 
Surviving a Hackathon and Beyond
Surviving a Hackathon and BeyondSurviving a Hackathon and Beyond
Surviving a Hackathon and Beyond
 
MWUG wp-myths
MWUG wp-mythsMWUG wp-myths
MWUG wp-myths
 
Untangling spring week2
Untangling spring week2Untangling spring week2
Untangling spring week2
 
Html5 web sockets - Brad Drysdale - London Web 2011-10-20
Html5 web sockets - Brad Drysdale - London Web 2011-10-20Html5 web sockets - Brad Drysdale - London Web 2011-10-20
Html5 web sockets - Brad Drysdale - London Web 2011-10-20
 
Write a better FM
Write a better FMWrite a better FM
Write a better FM
 
Killer Docs for Killer Devs
Killer Docs for Killer DevsKiller Docs for Killer Devs
Killer Docs for Killer Devs
 
Triple Your Post Frequency
Triple Your Post FrequencyTriple Your Post Frequency
Triple Your Post Frequency
 
WordPress Rest API
WordPress Rest APIWordPress Rest API
WordPress Rest API
 
11 Amazing things I Learnt At Word Camp Sydney 2014
11 Amazing things I Learnt At Word Camp Sydney 201411 Amazing things I Learnt At Word Camp Sydney 2014
11 Amazing things I Learnt At Word Camp Sydney 2014
 
Blogging
BloggingBlogging
Blogging
 
CPL12-Agile-planning
CPL12-Agile-planningCPL12-Agile-planning
CPL12-Agile-planning
 
Write A Better FM - Ohio Linux 2011
Write A Better FM - Ohio Linux 2011Write A Better FM - Ohio Linux 2011
Write A Better FM - Ohio Linux 2011
 
How to Increase Community Online
How to Increase Community OnlineHow to Increase Community Online
How to Increase Community Online
 
Rethinking Scala Presented in San Francisco May 7, 2014
Rethinking Scala Presented in San Francisco May 7, 2014Rethinking Scala Presented in San Francisco May 7, 2014
Rethinking Scala Presented in San Francisco May 7, 2014
 
SEO Horror Stories
SEO Horror StoriesSEO Horror Stories
SEO Horror Stories
 
Using HipChat For Real Time Communication in Social Media - Thad West
Using HipChat For Real Time Communication in Social Media - Thad WestUsing HipChat For Real Time Communication in Social Media - Thad West
Using HipChat For Real Time Communication in Social Media - Thad West
 

En vedette (9)

Technology Instuction
Technology InstuctionTechnology Instuction
Technology Instuction
 
Art Of Liu Mao Shan現代感的國畫
Art Of Liu Mao Shan現代感的國畫Art Of Liu Mao Shan現代感的國畫
Art Of Liu Mao Shan現代感的國畫
 
Blaireail
BlaireailBlaireail
Blaireail
 
Henryail
HenryailHenryail
Henryail
 
The Farmers Robert Duncan Ari
The Farmers Robert Duncan AriThe Farmers Robert Duncan Ari
The Farmers Robert Duncan Ari
 
Mirandanet Seminar 22nd September 2009
Mirandanet Seminar   22nd September 2009Mirandanet Seminar   22nd September 2009
Mirandanet Seminar 22nd September 2009
 
Integrating Tech Ppt
Integrating Tech PptIntegrating Tech Ppt
Integrating Tech Ppt
 
Skateboardingail
SkateboardingailSkateboardingail
Skateboardingail
 
Presentation made at Devoxx'09
Presentation made at Devoxx'09Presentation made at Devoxx'09
Presentation made at Devoxx'09
 

Similaire à Social dev camp_2011

The business case for contributing code
The business case for contributing codeThe business case for contributing code
The business case for contributing code
Zivtech, LLC
 
Austin NoSQL 2011-07-06
Austin NoSQL 2011-07-06Austin NoSQL 2011-07-06
Austin NoSQL 2011-07-06
jimbojsb
 

Similaire à Social dev camp_2011 (20)

Serverless Toronto helps Startups
Serverless Toronto helps StartupsServerless Toronto helps Startups
Serverless Toronto helps Startups
 
Seven Jobs You Should Be Running #sqlsat126
Seven Jobs You Should Be Running #sqlsat126Seven Jobs You Should Be Running #sqlsat126
Seven Jobs You Should Be Running #sqlsat126
 
Inside Wordnik's Architecture
Inside Wordnik's ArchitectureInside Wordnik's Architecture
Inside Wordnik's Architecture
 
The business case for contributing code
The business case for contributing codeThe business case for contributing code
The business case for contributing code
 
Velocity Conference NYC 2014 - Real World DevOps
Velocity Conference NYC 2014 - Real World DevOpsVelocity Conference NYC 2014 - Real World DevOps
Velocity Conference NYC 2014 - Real World DevOps
 
6 reasons Jubilee could be a Rubyist's new best friend
6 reasons Jubilee could be a Rubyist's new best friend6 reasons Jubilee could be a Rubyist's new best friend
6 reasons Jubilee could be a Rubyist's new best friend
 
JSON all the way
JSON all the wayJSON all the way
JSON all the way
 
Lean Startup with WebObjects
Lean Startup with WebObjectsLean Startup with WebObjects
Lean Startup with WebObjects
 
Community and Github: 7/27/2011
Community and Github: 7/27/2011Community and Github: 7/27/2011
Community and Github: 7/27/2011
 
Scaling a High Traffic Web Application: Our Journey from Java to PHP
Scaling a High Traffic Web Application: Our Journey from Java to PHPScaling a High Traffic Web Application: Our Journey from Java to PHP
Scaling a High Traffic Web Application: Our Journey from Java to PHP
 
Scaling High Traffic Web Applications
Scaling High Traffic Web ApplicationsScaling High Traffic Web Applications
Scaling High Traffic Web Applications
 
Wp 3hr-course
Wp 3hr-courseWp 3hr-course
Wp 3hr-course
 
Scaling with swagger
Scaling with swaggerScaling with swagger
Scaling with swagger
 
Surviving in a Microservices environment -abridged
Surviving in a Microservices environment -abridgedSurviving in a Microservices environment -abridged
Surviving in a Microservices environment -abridged
 
Austin NoSQL 2011-07-06
Austin NoSQL 2011-07-06Austin NoSQL 2011-07-06
Austin NoSQL 2011-07-06
 
DevDay 2013 - Building Startups and Minimum Viable Products
DevDay 2013 - Building Startups and Minimum Viable ProductsDevDay 2013 - Building Startups and Minimum Viable Products
DevDay 2013 - Building Startups and Minimum Viable Products
 
Build your own analytics power tools
Build your own analytics power toolsBuild your own analytics power tools
Build your own analytics power tools
 
Devconf 2011 - PHP - How Yii framework is developed
Devconf 2011 - PHP - How Yii framework is developedDevconf 2011 - PHP - How Yii framework is developed
Devconf 2011 - PHP - How Yii framework is developed
 
SharePoint Saturday Utah - The Art of the Possible Keynote
SharePoint Saturday Utah - The Art of the Possible KeynoteSharePoint Saturday Utah - The Art of the Possible Keynote
SharePoint Saturday Utah - The Art of the Possible Keynote
 
Enabling your DevOps culture with AWS-webinar
Enabling your DevOps culture with AWS-webinarEnabling your DevOps culture with AWS-webinar
Enabling your DevOps culture with AWS-webinar
 

Dernier

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Dernier (20)

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
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
 
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
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
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
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

Social dev camp_2011

  • 1. Craig Ulliott likes building things
  • 3. About me • Needs to know how everything works
  • 4. About me • Needs to know how everything works • Likes things that scale
  • 5. About me • Needs to know how everything works • Likes things that scale • Think’s almost everything is inefficient
  • 6. About me • Needs to know how everything works • Likes things that scale • Think’s almost everything is inefficient • Hates people
  • 7. About me • Needs to know how everything works • Likes things that scale • Think’s almost everything is inefficient • Hates people • Just kidding
  • 8. About me • Needs to know how everything works • Likes things that scale • Think’s almost everything is inefficient • Hates people • Just kidding • But people are the cause of all the worlds inefficiencies
  • 9. About me • Needs to know how everything works • Likes things that scale • Think’s almost everything is inefficient • Hates people • Just kidding • But people are the cause of all the worlds inefficiencies What I do and have done:
  • 11. Mistakes I’ve Made Lessons I’ve Learned.
  • 13. Minimum Viable Product • Short sprints (release code regularly)
  • 14. Minimum Viable Product • Short sprints (release code regularly) • Spend an hour thinking about why you’re building something, before you spend a week thinking about how.
  • 15. Minimum Viable Product • Short sprints (release code regularly) • Spend an hour thinking about why you’re building something, before you spend a week thinking about how. • Your developing a business not a website
  • 16. Surround yourself with business people
  • 17. Surround yourself with business people • If you have a good idea, a strong technical co- founder and a business co-founder - you will get money / incubated / successful
  • 18. Surround yourself with business people • If you have a good idea, a strong technical co- founder and a business co-founder - you will get money / incubated / successful • I get asked every 3 days if I know any developers - why are you guys not meeting each other!
  • 20. Bootstrap if you can • BUSINESSES that work when they are small are easier to scale
  • 21. Bootstrap if you can • BUSINESSES that work when they are small are easier to scale • The first step to becoming an Entrepreneur is not quitting your job
  • 22. Bootstrap if you can • BUSINESSES that work when they are small are easier to scale • The first step to becoming an Entrepreneur is not quitting your job • You wont be pragmatic if your worried about rent / children / debt / x / y / z
  • 23. Bootstrap if you can • BUSINESSES that work when they are small are easier to scale • The first step to becoming an Entrepreneur is not quitting your job • You wont be pragmatic if your worried about rent / children / debt / x / y / z • Its also a great lesson in finances
  • 24. Don’t be afraid to share your idea • “But someone might steal it.” • The hardest thing you will do is going to be getting someone genuinely interested in your idea. • People that could actually execute your idea are too busy with their own ideas. • It’s a lot cheaper for someone to take a bet (put all the risk) on you, than try and do it themselves.
  • 25. Fail quickly and fail often
  • 26. Fail quickly and fail often one in seven businesses make it...
  • 27. Fail quickly and fail often one in seven businesses make it... ...so start seven businesses!
  • 28. WIB APIs in 2009
  • 29. Some problem’s • WIB was completely dependent on lots of different social networks • They break and change stuff • Our code becomes complicated (entropy) • WIB had a small team • And lots of stuff to do • WIB had a lot of members • half a billion db rows & 7000+ queries a second
  • 30. What is abstraction a web application is like an onion
  • 31. The Solution: “Network Abstraction Layer” • Wrapped Facebook, Myspace, Bebo, Hi5, Friendster and Orkut • Normalized the I/O • Absorbed changes where they happen • Handled breakages • Data sharing across the whole network - Facebook user can see a MySpace user
  • 32. and it’s really extensible • We can add functionality and data without breaking the other networks • We can add other networks very easily
  • 33. It’s also nice and scalable (for a team) • An API has a defined protocol, so developers on our team could work side by side on the different networks. • As long as I/O stays the same, they can work independently
  • 34. And it scales well technically • Dividing an application into layers makes it much easier to scale. • Mainly because the independent layers can be scaled (or re-written) independently, without breaking other components.
  • 35. WIB APIs in 2011
  • 36. WIB APIs in 2011
  • 37. WIB Today Where I’ve Been . com The website does not connect directly to the database Facebook Twitter WIB oAuth 2 REST API Foursquare And others... Database Database Database
  • 38. Advantages of a single API • Saves Time (money) and it’s Extensible (future proof) • Teams can work on their own platforms • Website, iPhone, Android, Facebook App et.al. • Federate out content (or build developer network)
  • 39. How to build an API (an opinionated approach)
  • 40. how to build stuff in general
  • 41. how to build stuff in general • Developers cost
  • 42. how to build stuff in general • Developers cost • Servers cost
  • 43. Use Ruby on Rails
  • 44. Use Ruby on Rails • It allows you to build reliable, powerful, readable code
  • 45. Use Ruby on Rails • It allows you to build reliable, powerful, readable code • With RoR you can build a business in a week and host it for free
  • 46. Use Ruby on Rails • It allows you to build reliable, powerful, readable code • With RoR you can build a business in a week and host it for free Even monkeys use tools!
  • 47. Why Ruby on Rails is good for an API
  • 48. Why Ruby on Rails is good for an API Especially if you’re a startup
  • 49. Why Ruby on Rails is good for an API Especially if you’re a startup • RESTful out of the box
  • 50. Why Ruby on Rails is good for an API Especially if you’re a startup • RESTful out of the box • Normalized data
  • 51. Why Ruby on Rails is good for an API Especially if you’re a startup • RESTful out of the box • Normalized data • Encourages powerful abstraction
  • 52. Why Ruby on Rails is good for an API Especially if you’re a startup • RESTful out of the box • Normalized data • Encourages powerful abstraction • It’s easy and quick to develop
  • 53. Why Ruby on Rails is good for an API Especially if you’re a startup • RESTful out of the box • Normalized data • Encourages powerful abstraction • It’s easy and quick to develop • Its easy to write tests
  • 54. Why Ruby on Rails is good for an API Especially if you’re a startup • RESTful out of the box • Normalized data • Encourages powerful abstraction • It’s easy and quick to develop • Its easy to write tests • Scales horizontally (until you’ve already “made it”) - the bottleneck will be your DB
  • 55. RESTful web service • REST is how the web already works (makes it a pretty well known standard) • URL’s are self explanatory (easy to work with) • Closely matches the underlying data/objects • Makes it easy to build in a DRY way • Developers can get started very quickly
  • 56. HTTP methods • POST : Create something new • GET : Retrieve something that already exists • PUT : Update something that already exists • DELETE : Remove something that already exists
  • 57. Authorization and Authentication • Authentication • Who is this • Authorization • Can the Authenticated entity access this resource
  • 58. oAuth1 vs oAuth2 • oAuth 2 is slightly less secure • But it makes everyone’s lives SO much easier • Build a “trusted” clients paradigm for internal use - login, register, reset password etc
  • 59. HTTP Request Authentication Web server Framework Authentication It makes things really easy for developers Authorization lots of libraries and examples exist API Controller
  • 60. Access Tokens • Different tokens for user+client and client • Store useful info in them, allows you to calculate on the fly instead of store in the db c1234-g7rCEVB867rbe4B-1234567
  • 61. Access Tokens • Different tokens for user+client and client • Store useful info in them, allows you to calculate on the fly instead of store in the db c1234-g7rCEVB867rbe4B-1234567 client_id = 12345
  • 62. Access Tokens • Different tokens for user+client and client • Store useful info in them, allows you to calculate on the fly instead of store in the db c1234-g7rCEVB867rbe4B-1234567 user_id = 1234576
  • 63. Access Tokens • Different tokens for user+client and client • Store useful info in them, allows you to calculate on the fly instead of store in the db c1234-g7rCEVB867rbe4B-1234567 hash(client_secret+user_id)
  • 64. Access Tokens • Different tokens for user+client and client • Store useful info in them, allows you to calculate on the fly instead of store in the db c1234-g7rCEVB867rbe4B-1234567
  • 65. SSL iPhone WiFi laptop running squid internet • Require it, otherwise developers will expose all sort of stuff (like keys) • Important if you want to be taken seriously by developer community
  • 66. SSL iPhone WiFi laptop running squid internet looking at all the traffic is easy • Require it, otherwise developers will expose all sort of stuff (like keys) • Important if you want to be taken seriously by developer community
  • 67. Standardized Errors • Assume success=true • Always send back errors in the same way, so client libraries can be smart { "error": { "type": "ObjectException", "message": "Object does not exist" } }
  • 68. Limit how much data gets send back • Mobile developers care a lot about this • allow customizations: fields=name,gender
  • 70. HTTP Request Logging Errors: Web server • GetExceptional $20 a month (whats your time worth?) Performance: Framework • New Relic API Requests • Something simple near the top of your stack Logging (remember, storage is cheap) API Controller
  • 77. JSON • It’s smaller than XML • Developers write bad xml parsers, that rely on the order of the XML nodes • Facebook use it, and they set the standard - you want your API to be sexy don’t you?
  • 78. Returning Data • Standarized - objects - arrays of objects - nested objects
  • 80. DRY Documentation never goes out of date • Build it off the - models - connections - methods
  • 81. Testing • Write tests on your API • Even if you hate tests • It’s easy • You can generate most of them just like the documentation
  • 82. Tie it all together • A good API is a series of simple layers • Keep it DRY • Use the data structure for more dynamic code • Standards are your friend • There are plenty of examples out there - Facebook, Foursquare, Twitter etc
  • 83. Thanks • Hope this was useful

Notes de l'éditeur

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n
  73. \n
  74. \n
  75. \n
  76. \n
  77. \n
  78. \n
  79. \n
  80. \n
  81. \n
  82. \n
  83. \n