Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Evolving API Complexity In A System

Evolving API Complexity In A System

A look at how our API's relationship with its clients and how the handling business logic has evolved over time.

Jonathan White

October 09, 2013
Tweet

Other Decks in Programming

Transcript

  1. WHAT IS BELLY? Customer loyalty platform One Card for any

    location across the network. Unique rewards. More then just buy 10 get 1 free.
  2. ORIGINS OF THE API Built to support in store clients

    A lot of additional data in responses to improve speed and performance in store
  3. WHAT CALLS ARE AT THE API? Purely crud to objects

    (create, update, destroy, index, show) Data specific to the devices (present the data exactly how the devices want to use it) -- stackmob, parse, etc Business Logic specific (intelligent joins and nested models)
  4. PURE CRUD PROS: Easy on API Minimizing the need to

    version CONS: Hardest on clients Business logic is distributed
  5. DEVICE SPECIFIC DATA SETS PROS: Easy on clients Minimizing the

    need to version CONS: Not reusable at API May change with client updates, creating a versioning mess (code debt)
  6. BUSINESS LOGIC SPECIFIC DATA PROS: Business logic is in 1

    place CONS: Hard on clients API versions change with business rules. Clients may be out of date
  7. HOW MOBILE DEALS WITH NOT HAVING A PERFECT API Merging

    data from multiple API calls to populate a single UI Not efficient for mobile data Creative UI/UX workarounds to hide complexity
  8. HOW WE’VE DEALT WITH IT Mainly a business logic oriented

    model, but still evolving. Creating new solutions to work for our heavy usage api-clients (mobile)
  9. MAKING THINGS BETTER Creating API endpoints that represent mobile models

    directly, and don’t rely on independent calls from a mobile device. Faster development on devices. UIs that match data
  10. MAKING THINGS BETTER 2 Empowers engineers to move at their

    own pace Polyglots make for better engineers Reducing failure cases on device