I Love APIs Europe 2015: Developer Sessions

download I Love APIs Europe 2015: Developer Sessions

of 157

  • date post

    20-Aug-2015
  • Category

    Technology

  • view

    966
  • download

    0

Embed Size (px)

Transcript of I Love APIs Europe 2015: Developer Sessions

  1. 1. Vibrant Ecosystems: Adoption in Private or Partner Developer Programs Kay Lummitsch, API Technology Evangelist - Swisscom! Steve Rowland, SVP WW Sales & Operations - Apigee!
  2. 2. Building predictive apps with & -services architecture Alan Ho!
  3. 3. @karlunho Alan Ho
  4. 4. Context is King Apps 4
  5. 5. Technology Choices Today 5 Datawarehouse RDBMS J2EE AppServer
  6. 6. What is Context ? 6 Historical ! Events! Recent! Events! Now!
  7. 7. Lambda Architecture 7 Batch Storage Near RT Storage Batch Processing (MR) Near RealTime Processing Query DB Batch Layer! Serving Layer! Speed Layer! APIs Direct Mail Email Web Mobile Outreach Req / Res Processing Historical Events Recent Events
  8. 8. Netix Example 8
  9. 9. Oine = Batch Layer Nearline = Speed Layer Online = Serving Layer
  10. 10. Batch Layer (Oine) Singular Value Decomposition Batch like operations High algorithm complexity Results Flow into Cassandra
  11. 11. Speed Layer (Near Line) 11 Medium request/response! Medium data! Medium algorithm complexity! Intermediate caching, incremental learning algos!
  12. 12. Serving layer (Online) Fast request/response, performance is key high availability/SLA Fallback mechanism to Nearline/Oine operations Low algorithm complexity
  13. 13. Final Thoughts:! ! Very complete system! Very custom and high performance! Lots of specialized systems for specialized tasks! Not practical for most enterprises!
  14. 14. Data Scientists & Developers 14 Direct Mail Email Web Mobile Outreach How can they work independently ?
  15. 15. App Explosion 15 How can I embed predictive in all apps ?
  16. 16. Micro-services 16
  17. 17. Micro-services Best Practice 17 Isolation REST API HTTP:///
  18. 18. Isolation at all tiers 18 Batch Storage Near RT Storage Batch Processing (MR) Near RealTime Processing Query DB Serving Layer! APIs Direct Mail Email Web Mobile Outreach Req / Res Processing Historical Events Recent Events Batch Processing (MR) Near RealTime Processing Req / Res Processing Batch Processing (MR) Near RealTime Processing Req / Res Processing Batch Processing (MR) Near RealTime Processing Req / Res Processing Batch Storage Near RT Storage Query DB Batch Storage Near RT Storage Query DB
  19. 19. API at all tiers 19 Batch Layer! Serving Layer! Speed Layer! Direct Mail Email Web Mobile Outreach /Scores! /Counts! /Recommendations! Historical Events Recent Events
  20. 20. Insights Deep Dive
  21. 21. Recommendations Example 21
  22. 22. Recommendation Architecture 22 Hadoop In-Memory Insights (GRASP) Node.js Node.js API BaaS (APIs)Direct Mail Email Web Mobile Outreach (Batch Scores) (Counters) (Query) Historical Events Realtime Events (Context)Backend (Mashup) 3 4 5 1 26 Node.js
  23. 23. Batch Layer Uses R for building predictive models Algorithms based on Event Sequences Lots and lots of tooling 23 Hadoop Insights (GRASP) API BaaS (Batch Scores) 1 Apigee UI
  24. 24. 24 R Code!
  25. 25. 25 Scored Export to Serving Layer!
  26. 26. Speed Layer Easy to program via node.js Low algorithm complexity Storm is overkill for most Apigee customers Simple aggregates via C* counters good enough Good for capturing locations, activity stream, etc. 26 Node.js API BaaS Apigee UI
  27. 27. BaaS Node.js Counter Example var event = new Usergrid.Counter(event_options, function (error, result) { }); // Then we POST the event to increment the counter var counter_options = { name: productName + .add_to_cart', value: 1 } event.increment (counter_options, function (error, result) 27 curl -X GET https://api.usergrid.com/my-org/my-app/counters? counter=appleIpad3.add_to_cart Input code: Output code:!
  28. 28. Microservices Layer API Layer (Swagger) Context Injection Service Orchestration Fallback logic 28 Node.jsNode.js API BaaS Direct Mail Email Web Mobile Outreach (Context)Backend
  29. 29. Swagger Based API Design 29
  30. 30. Node.js Code 30
  31. 31. APIs are Everywhere 31 Hadoop In-Memory Insights Node.js Node.jsAPI BaaS Direct Mail Email Web Mobile Outreach Historical Events Realtime Events Backend Hive RHadoop Node.js Storm Spark
  32. 32. Thank you 32
  33. 33. LUNCH General Hall / Main Concourse (Sessions resume at 14:00)
  34. 34. Model-Driven APIs with 127 Greg Brail!
  35. 35. Overview A bit about API design Some ways to turn APIs into code A dierent approach Introducing Apigee 127 35
  36. 36. API Design 36
  37. 37. REST 37
  38. 38. API Design is Important We have been talking API design for a long time We have an approach that we like and often recommend We believe that it is important to design APIs carefully, up front
  39. 39. My Perspective on API Design URIs are important Verbs should be used in a consistent way Follow common usage Links can be helpful 39
  40. 40. 40
  41. 41. Turning Designs into APIs 41
  42. 42. An API Design Story I designed a lovely, consistent API In a Google Doc The team implemented it In Java I veried that the implementation matched the doc Using my eyeballs We wrote docs Using information from both places
  43. 43. There must be a better way 43
  44. 44. Modern Web / API Frameworks Write code Get an API up quickly API design and code are the same Examples: Express for Node.js Ruby on Rails Lots of others 44
  45. 45. Another approach: Code First 45 @Path("/my-resource") @Api(value="/my-resource, description="Rest api for do operations on admin", produces=MediaType.APPLICATION_JSON) @Produces({ MediaType.APPLICATION_JSON }) class MyResource{ @ApiOperation(value = "Get specific element", httpMethod = "GET", notes = "Fetch the selement of the collection", response = Response.class) @ApiResponses(value = { @ApiResponse(code = 200, message = Element found"), @ApiResponse(code = 404, message = Element not found"), @ApiResponse(code = 500, message = Server error due to encoding"), @ApiResponse(code = 400, message = "Bad request: decoding error"), @ApiResponse(code = 412, message = Prereq: Required data not found") }) public Response get( @ApiParam(value = "UUID of the element", required = true) @PathParam("uuid") String uuid) { Generate
  46. 46. A New Approach 46
  47. 47. Why Cant We Do This? 1. Design the API 2. Annotate it with policies 3. Wire it to some back end 4. Run it
  48. 48. Swagger 2.0 Swagger 2.0 Describes the shape of the API URIs Verbs Query parameters Headers Request and response formats 48
  49. 49. Building a Model in Swagger 2.0 Specify API design using YAML URI Paths Verbs Parameters Request format (optional) Response format (optional) Error responses (optional) 49
  50. 50. Plugging in Code Point each API operation to some code In our project it is a Node.js module 50
  51. 51. Annotating the Model The API denition can have policies OAuth Quota Spike arresting Caching Each operation can have parameters Quota OAuth scope Etc. 51
  52. 52. Introducing Apigee 127 52
  53. 53. Introduction to 127 $ npm install -g apigee-127 http://github.com/apigee-127
  54. 54. Enterprise APIs, Fast We Handle These: Swagger Tools Message validation & routing Authorization (OAuth 2.0) Volos.js Caching (Apigee Swagger 2.0 Extension) Quota (Apigee Swagger 2.0 Extension) Analytics (Apigee Swagger 2.0 Extension) Developers Handle This: Business logic 54 Controller Controller.js
  55. 55. Design-First Approach 55 Add Annotations Implement Controllers Add Annotations Business Logic Policies: Authorization (OAuth) Caching Quota Spike Arrest Analytics Implement Controllers Controllers in JavaScript via Node.js Future ideas: Declarative pipelines Other languages
  56. 56. How it Works 56 No code generation Model is built at start-up time A127 middleware applied as dened in Swagger: Caching, Quota, OAuth, Spike Arrest, Analytics, etc. Paths and parameters Model Denitions Vendor Extensions (middleware) Interprets Swagger
  57. 57. Execution Options 57 Anywhere / PaaS 127 On-Premises 127 On Edge 127 Anywhere / PaaS 127 On-Premises + Edge 127 127
  58. 58. Thank you
  59. 59. APIs and Internet of Things Ed Anu VP Product Strategy Apigee John Calagaz, Chief Technology Ocer Centralite
  60. 60. IoT is more than sensors, beacons, Arduinos, and Raspberry Pis 60
  61. 61. App to Device Connection - Smartphone & Tire Sensor
  62. 62. Device To Device Connection - Tire Sensor & Air Compressor 62 AIR $ 1
  63. 63. The I in IoT is for Internet 63 AIR $ 1
  64. 64. Why does this matter? 64
  65. 65. IoT Seeks Network Value Metcalfes Law Value=O(n2)
  66. 66. Why is this hard? 66
  67. 67. Building The Network Via The Ecosystem 67
  68. 68. The number of connected devices is set to dramatically increase 68
  69. 69. Too Many Devices, Too Few Developers Connected Devices Software Developers 2013: 6 Billion 2018: 20 Billion 333% Increase Source: Business Insider Intelligence - The Internet Of Everything: 2014 2013: 18 Million 2019: 26 Million 45% Increase Source: Evans Data Corporation - Global Developer Population and Demographic Study 2013
  70. 70. MISSING: 34 Million Software Developers 70
  71. 71. This is a scale problem 71
  72. 72. IoT systems are a complex combination of web, app and embedded systems.
  73. 73. 73 Things Language Internet Languages
  74. 74. What happens when development is so fragmented? 74
  75. 75. The Promise: Everything is Connected
  76. 76. Experiences become fragmented 76
  77. 77. The Reality: Unnerving