With developers, an awesome product isn’t everything, or at least we found that out. More than a product you need a platform. But what is a platform? Learn tips and tricks about building a public API using the latest and greatest tools: OpenAPI, Python 3 and asyncio.
This presentation was given by Optimizely engineers Nick DiRienzo & Vinay Tota at PyBay 2017.
27. Getting Optimizely Results
1. Get Experiment data
2. Get Layer data (whatever that is)
3. Get Project Settings
4. Get results data
28. 1. Get Experiment data
2. Get Layer data (whatever that is)
3. Get Project Settings
4. Get results data
GET /v2/experiments/:id/results
Getting Optimizely Results
29. Easy to use APIs
What makes an API “good”?
Ensured Trust
55. Easy to use APIs
What makes an API “good”?
Ensured Trust Documentation
56. How can we provide
“good” APIs?
How can we provide
“good” APIs?
57. Getting Optimizely Results
1. Get Experiment data
2. Get Layer data (whatever that is)
3. Get Project Settings
4. Get results data
58. 1. Get Experiment data
2. Get Layer data (whatever that is)
3. Get Project Settings
4. Get results data
/v2/experiments/:id/results
Getting Optimizely Results
63. We’ve got data all over
Experiments Projects Results
API
Gateway
64. Benefits of an API gateway
Operations through the API look a lot like
their web UI counterparts
65. Benefits of an API gateway
Operations through the API look a lot like
their web UI counterparts
Allows us to orchestrate APIs instead of
data models
66. Benefits of an API gateway
Operations through the API look a lot like
their web UI counterparts
Allows us to orchestrate APIs instead of
data models
Pulls problems away from business logic
into a higher-level
67. Benefits of an API gateway
Operations through the API look a lot like
their web UI counterparts
Allows us to orchestrate APIs instead of
data models
Pulls problems away from business logic
into a higher-level
Internal and external consumers go
through the same application
70. We need to do a bunch of things in parallel...
71. Pyramid and Multiprocessing
with multiprocessing.Pool() as pool, multiprocessing.Manager() as manager:
response_queue = manager.Queue()
try:
# send our requests get back responses from the response_queue
finally:
pool.join()
pool.terminate()
72. Pyramid and Multiprocessing
with multiprocessing.Pool() as pool, multiprocessing.Manager() as manager:
response_queue = manager.Queue()
try:
# send our requests get back responses from the response_queue
finally:
pool.join()
pool.terminate()
73. Pyramid and Multiprocessing
with multiprocessing.Pool() as pool, multiprocessing.Manager() as manager:
response_queue = manager.Queue()
try:
# send our requests get back responses from the response_queue
finally:
pool.join()
pool.terminate()
74. Pyramid and Multiprocessing
with multiprocessing.Pool() as pool, multiprocessing.Manager() as manager:
response_queue = manager.Queue()
try:
# send our requests get back responses from the response_queue
finally:
pool.join()
pool.terminate()
139. Code is Social
• Better make sure it actually works!
• Pull Request Open 3+ weeks
140. Code is Social
• Better make sure it actually works!
• Pull Request Open 3+ weeks
• Everyone on team added as a reviewer
141. Code is Social
• Better make sure it actually works!
• Pull Request Open 3+ weeks
• Everyone on team added as a reviewer
• 63 comments on Pull Request
142. Code is Social
• Better make sure it actually works!
• Pull Request Open 3+ weeks
• Everyone on team added as a reviewer
• 63 comments on Pull Request
• Meetings for questions/concerns