I Love APIs 2015: The "State" of your API: Common Use Cases for Storing Data

14
1 State of your API Steven Richardson, Carlos Eberhardt, David Allen

Transcript of I Love APIs 2015: The "State" of your API: Common Use Cases for Storing Data

Page 1: I Love APIs 2015: The "State" of your API: Common Use Cases for Storing Data

1

State of your API !Steven Richardson, Carlos Eberhardt,

David Allen

Page 2: I Love APIs 2015: The "State" of your API: Common Use Cases for Storing Data

Storing State: So Many Options Options are good, too many can be confusing. How do you decide which store to use for state?

Today we’ll provide guidelines! Why should you trust us?

We are not crackpots! - Steve – 4 years building solutions for enterprise customers. - David – super smart dude who happens to really know Edge. - Carlos – over 3 years talking to customers and prospects across a variety of verticals.

Page 3: I Love APIs 2015: The "State" of your API: Common Use Cases for Storing Data

What is State?

3 ©2015 Apigee. All Rights Reserved.

•  Pattern of Application Behavior •  State is information that is available to your API at a defined moment

Page 4: I Love APIs 2015: The "State" of your API: Common Use Cases for Storing Data

Common Reasons for State

• Application Scoped Configuration • Business Rules • Extended Authentication • Performance Tuning • Storing Server Credentials • Support Complex Workflows • Simulate Transactions

4 ©2015 Apigee. All Rights Reserved.

Page 5: I Love APIs 2015: The "State" of your API: Common Use Cases for Storing Data

Good reasons to keep state

• Application Scoped Configuration • Extended Authentication and Identification • Performance tuning • Storing Server Credentials

5 ©2015 Apigee. All Rights Reserved.

Page 6: I Love APIs 2015: The "State" of your API: Common Use Cases for Storing Data

Common States

• Organization • Environment • Proxy • Developer • Client Application • Product • Request

6 ©2015 Apigee. All Rights Reserved.

Page 7: I Love APIs 2015: The "State" of your API: Common Use Cases for Storing Data

Available state stores to Edge

• Custom Properties • Cache • Key Value Map • JS resource • Vault • BaaS

7 ©2015 Apigee. All Rights Reserved.

Page 8: I Love APIs 2015: The "State" of your API: Common Use Cases for Storing Data

Combo power - which stores to use when

8 ©2015 Apigee. All Rights Reserved.

KVM Best used when managing Simple Global Properties that will change

Cache Best used for growing state full information

JS Resource Best used for JSON configuration or configuration that doesn’t change often

Vault Best used when using a node container to store credentials

BaaS Data shaping, and enrichment

Page 9: I Love APIs 2015: The "State" of your API: Common Use Cases for Storing Data

Common examples

9 ©2015 Apigee. All Rights Reserved.

Page 10: I Love APIs 2015: The "State" of your API: Common Use Cases for Storing Data

BaaS Example – Enhanced Retail

10 ©2015 Apigee. All Rights Reserved.

Product System

BaaS

API

-  “Like” Product -  Recommendations -  Social Sharing -  Etc.

01001000 01010100 01010100

Users Likes Social Info

Page 11: I Love APIs 2015: The "State" of your API: Common Use Cases for Storing Data

CAP Theorem

11 ©2015 Apigee. All Rights Reserved.

RDBMS

JS Resource

KMS / Vault

Cache

Consistency

Fault Tolerance Availability

Page 12: I Love APIs 2015: The "State" of your API: Common Use Cases for Storing Data

When to go outside the Edge

• Transactional data-store •  If data has a life-cycle outside of Edge •  If you need atomic consistency

12 ©2015 Apigee. All Rights Reserved.

Page 13: I Love APIs 2015: The "State" of your API: Common Use Cases for Storing Data

Understanding State

13

•  State can be useful •  Understand what’s available to avoid pitfalls •  Leverage the community at community.apigee.com

Page 14: I Love APIs 2015: The "State" of your API: Common Use Cases for Storing Data

Questions?

14 ©2015 Apigee. All Rights Reserved.