Scaling telephony
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
1,299
On Slideshare
865
From Embeds
434
Number of Embeds
4

Actions

Shares
Downloads
13
Comments
0
Likes
0

Embeds 434

http://in.pycon.org 407
http://eventifier.co 11
http://eventifier.com 8
https://twitter.com 8

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Scaling Telephony with Python:The Plivo Learnings Nishad Musthafa Plivo Inc Saturday, July 6, 13
  • 2. About me • First engineer at Plivo • Dig open source • Zen of python • twitter.com/_nishad Saturday, July 6, 13
  • 3. Plivo Open Source github.com/plivo/plivoframework/ ESL Saturday, July 6, 13
  • 4. How does plivo work? • Plivo gets a call. • Plivo needs to know what to do ? • Plivo uses a callback like http:// customercallback.com/ Saturday, July 6, 13
  • 5. Initial setup Media Server DB Customer API calls Callbacks Saturday, July 6, 13
  • 6. Issues with this setup • Business logic vs Telephony • Code updates • Scaling Issues Saturday, July 6, 13
  • 7. Solution Media Server DBCustomer API calls Callbacks Django Saturday, July 6, 13
  • 8. Did that solve it? Yes Did we go ahead and use it? Not quiet. Saturday, July 6, 13
  • 9. There are still issues • Performance issues with Django • Security issues Saturday, July 6, 13
  • 10. Enter proxy • A lightweight proxy server written in flask • This acts as both an in and out proxy • Has the goodness of gevent Saturday, July 6, 13
  • 11. Solution Media Server DB Customer API calls Proxy DjangoCallbacks Saturday, July 6, 13
  • 12. So far so good • Added a django based UI for our existing customers to add and manipulate their user related data. • There was no current need for an api for manipulation of these data or so we thought. Saturday, July 6, 13
  • 13. New Customer Alert!! • We had a new customer who urgently needed a bunch of api’s ready in a week to migrate a large number of minutes to our platform. • We didn’t have any API’s • We had one week. It wasn’t a friendly mail. It was an ultimatum Saturday, July 6, 13
  • 14. Tasty Pie to the rescue • Tasty pie from toast driven is an excellent framework to create an API from your django models.We also did evaluate piston. But there were basic issues there. Saturday, July 6, 13
  • 15. Piston is lacking • /Account/id/Subaccount/ • /Account/subaccountid/ • The above two are apis on the same model • Piston doesn’t let you do this. Saturday, July 6, 13
  • 16. Tasty Pie Basics Resource Retrieve List Retrieve Detail Saturday, July 6, 13
  • 17. Tasty Pie Basics Create Update Delete Saturday, July 6, 13
  • 18. Tasty Pie Best Practices • Derive ModelResource to create a Resource type that’s specific to your use case. Eg: Error returning. • Dehydrate: Use the Resource’s dehydrate function to add data that isn’t available in the models. Eg: cost as a sum of 2 fields • Filters:The build_filters function allows you specify filters based on fields of models. Be careful using them. Saturday, July 6, 13
  • 19. Speedups • Johnny Cache • Django celery Saturday, July 6, 13
  • 20. One week later Saturday, July 6, 13
  • 21. Questions anyone? Saturday, July 6, 13
  • 22. Thank you!! Saturday, July 6, 13