SlideShare a Scribd company logo
1 of 21
Telephony Applications
                          with
                    MongoDB,
                    OpenShift,
                     & Twilio

Mark Atwood
Developer Evangelist for Red Hat
OpenShift
me@mark.atwood.name
Twitter @fallenpegasus
What is OpenShift?
   Red Hat cloud Platform as a Service
   Free as in beer, Free as in speech
   Languages: Python, Java, Ruby, Node, PHP, & DIY
   Storage: Filesystem, MySQL, Postgres, MongoDB
   No lock-in, no proprietary APIs


   Sign up at http://openshift.redhat.com
   Promo code SEATTLE



    2
What is Twilio?

   A cloudy API for telephony
   REST interface to the PSTN: Voice & SMS
   Pay by the drink




    3
How Twilio voice works

   Someone calls the number
   Twilio answers the phone
   Twilio does HTTP REST to our app
   Our app replies with some "TwiML"
   Twilio does what the app told it to
   Twilio or the caller hangs up the phone




    4
How Twilio SMS works

   Someone texts to the number
   Twilio receives the text & all metadata
   Twilio does HTTP REST to our app
   Our app replies with some "TwiML"
   Twilio does what the app told it to




    5
What is MongoDB?

   If you have to ask that, you shouldn't be here!
   Easy to use JSONic Document Store




    6
What is Python & What is Bottle?

   My favorite programming language
   My favorite web framework
   Supported by OpenShift
   Drivers for MongoDB & for Twilio




    7
A simple app: SMS Group

   SMS group chat


   http://github.com/fallenpegasus/openshift-smsgroup


   +1-XXX-XXX-XXXX


   SMS .join to join
   SMS .leave to leave



    8
Glue it all together

   Get an OpenShift account
   Get a Twilio account
   Spin up "smsgroup" app in OpenShift
   Attach it to your Twilio account
   Play!




    9
Agenda for Demonstration

   Look at the app at twilio.com
   Look at the app at openshift.com
   SSH into the app
   Port forward from local to remote MongoDB
   Run local MongoDB clients




    10
11
Some useful software design guidelines

   Let the language, the libraries, & remote services do the
    boring work
   Don't keep state in the app, use a data layer
   Use queuing to smooth load




    12
Don't keep state in the app

   Keep it in the data layer instead
   OpenShift might restart or scale the instance at any time
   Don't waste time keeping complex data in the instance
   Don't try to write your own database server




    13
Don't keep state in the app

   Keep it in the data layer instead
   OpenShift might restart or scale the instance at any time
   Don't waste time keeping complex data in the instance
   Don't try to write your own database server


   MongoDB is an excellent solution




    14
Use queuing to smooth the load

   Don't depend on "their" capacity
   Getting local storage quickly is easier than provisioning
    more CPU, IO ops, or network bandwidth




    15
Use queuing to smooth the load

   Don't depend on "their" capacity
   Getting local storage quickly is easier than provisioning
    more CPU, IO ops, or network bandwidth


   And it's cheaper




    16
Some Queue options

   roll your own
   SQS
   AQMP
   RabbitMQ
   etc




    17
Queue options

   roll your own
   SQS
   AQMP
   RabbitMQ
   etc


   MongoDB "find_and_modify"




    18
def worker:
 while True:
  time.sleep(1)
  while True:
    msg = mongo_db.sendq.find_and_modify(remove = True)
    if (msg == None): break
    message = twilio_client.sms.message.create(
            to = msg['To'],
            from_ = twilio_fromnum,
            body = msg['Body'])




  19
Conclusion

   Telephony apps are easy and fun
   You can build your own
   Using OpenShift, Twilio, and MongoDB




    20
Questions?




       21

More Related Content

What's hot

What's hot (20)

OpenShift – the open-source PaaS by Marek Jelen
OpenShift – the open-source PaaS by Marek JelenOpenShift – the open-source PaaS by Marek Jelen
OpenShift – the open-source PaaS by Marek Jelen
 
DockerDay2015: Docker Security
DockerDay2015: Docker SecurityDockerDay2015: Docker Security
DockerDay2015: Docker Security
 
DockerDay2015: Keynote
DockerDay2015: KeynoteDockerDay2015: Keynote
DockerDay2015: Keynote
 
Nginx conference 2015
Nginx conference 2015Nginx conference 2015
Nginx conference 2015
 
OpenShift Anywhere given at Infrastructure.Next Talk at #Scale12X
OpenShift Anywhere given at Infrastructure.Next Talk at #Scale12XOpenShift Anywhere given at Infrastructure.Next Talk at #Scale12X
OpenShift Anywhere given at Infrastructure.Next Talk at #Scale12X
 
Docker @ RelateIQ Presentation
Docker @ RelateIQ PresentationDocker @ RelateIQ Presentation
Docker @ RelateIQ Presentation
 
Docker at Spotify - Dockercon14
Docker at Spotify - Dockercon14Docker at Spotify - Dockercon14
Docker at Spotify - Dockercon14
 
Shipping NodeJS with Docker and CoreOS
Shipping NodeJS with Docker and CoreOSShipping NodeJS with Docker and CoreOS
Shipping NodeJS with Docker and CoreOS
 
OpenWhisk and IBM cloud functions
OpenWhisk and IBM cloud functionsOpenWhisk and IBM cloud functions
OpenWhisk and IBM cloud functions
 
Immutable infrastructure with Docker and EC2
Immutable infrastructure with Docker and EC2Immutable infrastructure with Docker and EC2
Immutable infrastructure with Docker and EC2
 
DockerDay2015: Docker orchestration for sysadmin
DockerDay2015: Docker orchestration for sysadminDockerDay2015: Docker orchestration for sysadmin
DockerDay2015: Docker orchestration for sysadmin
 
Your Java Journey into the Serverless World
Your Java Journey into the Serverless WorldYour Java Journey into the Serverless World
Your Java Journey into the Serverless World
 
Docker for PHP Developers (NomadPHP)
Docker for PHP Developers (NomadPHP)Docker for PHP Developers (NomadPHP)
Docker for PHP Developers (NomadPHP)
 
5 Popular Choices for NoSQL on a Microsoft Platform - All Things Open - Octob...
5 Popular Choices for NoSQL on a Microsoft Platform - All Things Open - Octob...5 Popular Choices for NoSQL on a Microsoft Platform - All Things Open - Octob...
5 Popular Choices for NoSQL on a Microsoft Platform - All Things Open - Octob...
 
Architecting a Cloud Native Internet Archive
Architecting a Cloud Native Internet ArchiveArchitecting a Cloud Native Internet Archive
Architecting a Cloud Native Internet Archive
 
Introduction to Containers and Docker for PHP developers
Introduction to Containers and Docker for PHP developersIntroduction to Containers and Docker for PHP developers
Introduction to Containers and Docker for PHP developers
 
DockerCon Keynote Ben Golub
DockerCon Keynote Ben GolubDockerCon Keynote Ben Golub
DockerCon Keynote Ben Golub
 
Docker for Developers
Docker for DevelopersDocker for Developers
Docker for Developers
 
Docker worshop @Twitter - How to use your own private registry
Docker worshop @Twitter - How to use your own private registryDocker worshop @Twitter - How to use your own private registry
Docker worshop @Twitter - How to use your own private registry
 
Monitoring Docker Environments with Outlyer
Monitoring Docker Environments with OutlyerMonitoring Docker Environments with Outlyer
Monitoring Docker Environments with Outlyer
 

Viewers also liked

Viewers also liked (20)

A SOA approximation on symfony
A SOA approximation on symfonyA SOA approximation on symfony
A SOA approximation on symfony
 
Working with Asynchronous Events
Working with Asynchronous EventsWorking with Asynchronous Events
Working with Asynchronous Events
 
Theres a rabbit on my symfony
Theres a rabbit on my symfonyTheres a rabbit on my symfony
Theres a rabbit on my symfony
 
Juc boston2014.pptx
Juc boston2014.pptxJuc boston2014.pptx
Juc boston2014.pptx
 
PHP is the King, nodejs the prince and python the fool
PHP is the King, nodejs the prince and python the foolPHP is the King, nodejs the prince and python the fool
PHP is the King, nodejs the prince and python the fool
 
Asynchronous processing with PHP and Symfony2. Do it simple
Asynchronous processing with PHP and Symfony2. Do it simpleAsynchronous processing with PHP and Symfony2. Do it simple
Asynchronous processing with PHP and Symfony2. Do it simple
 
Scaling applications with RabbitMQ at SunshinePHP
Scaling applications with RabbitMQ   at SunshinePHPScaling applications with RabbitMQ   at SunshinePHP
Scaling applications with RabbitMQ at SunshinePHP
 
Service Oriented Architecture for Distributed Identity Management System
Service Oriented Architecture for Distributed Identity Management SystemService Oriented Architecture for Distributed Identity Management System
Service Oriented Architecture for Distributed Identity Management System
 
Scaling Symfony2 apps with RabbitMQ - Symfony UK Meetup
Scaling Symfony2 apps with RabbitMQ - Symfony UK MeetupScaling Symfony2 apps with RabbitMQ - Symfony UK Meetup
Scaling Symfony2 apps with RabbitMQ - Symfony UK Meetup
 
Interoperability With RabbitMq
Interoperability With RabbitMqInteroperability With RabbitMq
Interoperability With RabbitMq
 
Scalable Event Analytics with MongoDB & Ruby on Rails
Scalable Event Analytics with MongoDB & Ruby on RailsScalable Event Analytics with MongoDB & Ruby on Rails
Scalable Event Analytics with MongoDB & Ruby on Rails
 
Tips and Tricks for your Service Oriented Architecture @ CakeFest 2013 in San...
Tips and Tricks for your Service Oriented Architecture @ CakeFest 2013 in San...Tips and Tricks for your Service Oriented Architecture @ CakeFest 2013 in San...
Tips and Tricks for your Service Oriented Architecture @ CakeFest 2013 in San...
 
Services Oriented Architecture with PHP and MySQL
Services Oriented Architecture with PHP and MySQLServices Oriented Architecture with PHP and MySQL
Services Oriented Architecture with PHP and MySQL
 
Enterprise PHP Architecture through Design Patterns and Modularization (Midwe...
Enterprise PHP Architecture through Design Patterns and Modularization (Midwe...Enterprise PHP Architecture through Design Patterns and Modularization (Midwe...
Enterprise PHP Architecture through Design Patterns and Modularization (Midwe...
 
Speed up your Symfony2 application and build awesome features with Redis
Speed up your Symfony2 application and build awesome features with RedisSpeed up your Symfony2 application and build awesome features with Redis
Speed up your Symfony2 application and build awesome features with Redis
 
KSDG BaaS Intro
KSDG BaaS IntroKSDG BaaS Intro
KSDG BaaS Intro
 
SOA with PHP and Symfony
SOA with PHP and SymfonySOA with PHP and Symfony
SOA with PHP and Symfony
 
Thrift vs Protocol Buffers vs Avro - Biased Comparison
Thrift vs Protocol Buffers vs Avro - Biased ComparisonThrift vs Protocol Buffers vs Avro - Biased Comparison
Thrift vs Protocol Buffers vs Avro - Biased Comparison
 
Clean architecture with ddd layering in php
Clean architecture with ddd layering in phpClean architecture with ddd layering in php
Clean architecture with ddd layering in php
 
Enterprise PHP (PHP London Conference 2008)
Enterprise PHP (PHP London Conference 2008)Enterprise PHP (PHP London Conference 2008)
Enterprise PHP (PHP London Conference 2008)
 

Similar to Telephony with OpenShift Twilio and MongoDB

Intalio create and cloudfoudry - short
Intalio create and cloudfoudry - shortIntalio create and cloudfoudry - short
Intalio create and cloudfoudry - short
hmalphettes
 
Enterprise software needs a PaaS
Enterprise software needs a PaaSEnterprise software needs a PaaS
Enterprise software needs a PaaS
hmalphettes
 
Workshop For pycon13
Workshop For pycon13Workshop For pycon13
Workshop For pycon13
Steven Pousty
 
Intro to Open Cloud Initiative
Intro to Open Cloud InitiativeIntro to Open Cloud Initiative
Intro to Open Cloud Initiative
John Mark Walker
 
Open shift for java(ee) developers
Open shift for java(ee) developersOpen shift for java(ee) developers
Open shift for java(ee) developers
Shekhar Gulati
 
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdfNode.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
lubnayasminsebl
 
The New IT - Your Milestone Plan
The New IT -  Your Milestone PlanThe New IT -  Your Milestone Plan
The New IT - Your Milestone Plan
WSO2
 
The New IT - Your Milestone Plan
The New IT - Your Milestone Plan The New IT - Your Milestone Plan
The New IT - Your Milestone Plan
WSO2
 

Similar to Telephony with OpenShift Twilio and MongoDB (20)

Hands on-intro to Node-RED
Hands on-intro to Node-REDHands on-intro to Node-RED
Hands on-intro to Node-RED
 
Intalio create and cloudfoudry - short
Intalio create and cloudfoudry - shortIntalio create and cloudfoudry - short
Intalio create and cloudfoudry - short
 
Enterprise software needs a PaaS
Enterprise software needs a PaaSEnterprise software needs a PaaS
Enterprise software needs a PaaS
 
Proposal
ProposalProposal
Proposal
 
Workshop For pycon13
Workshop For pycon13Workshop For pycon13
Workshop For pycon13
 
Free Mongo on OpenShift
Free Mongo on OpenShiftFree Mongo on OpenShift
Free Mongo on OpenShift
 
NodeJS
NodeJSNodeJS
NodeJS
 
Intro to Open Cloud Initiative
Intro to Open Cloud InitiativeIntro to Open Cloud Initiative
Intro to Open Cloud Initiative
 
Develop modern apps using Spring ecosystem at time of BigData
Develop modern apps using Spring ecosystem at time of BigData Develop modern apps using Spring ecosystem at time of BigData
Develop modern apps using Spring ecosystem at time of BigData
 
NodeJS vs Python.pptx
NodeJS vs Python.pptxNodeJS vs Python.pptx
NodeJS vs Python.pptx
 
IBM Bootcamp - Text to Speech API Lab
IBM Bootcamp - Text to Speech API LabIBM Bootcamp - Text to Speech API Lab
IBM Bootcamp - Text to Speech API Lab
 
Node.JS Vs PHP: Which Is The Top Server-Side Programming Language?
Node.JS Vs PHP: Which Is The Top Server-Side Programming Language?Node.JS Vs PHP: Which Is The Top Server-Side Programming Language?
Node.JS Vs PHP: Which Is The Top Server-Side Programming Language?
 
SpringOne 2016 in a nutshell
SpringOne 2016 in a nutshellSpringOne 2016 in a nutshell
SpringOne 2016 in a nutshell
 
Internationalizing The New York Times
Internationalizing The New York TimesInternationalizing The New York Times
Internationalizing The New York Times
 
Open shift for java(ee) developers
Open shift for java(ee) developersOpen shift for java(ee) developers
Open shift for java(ee) developers
 
PHP Vs NodeJS for Backend Web Development.pdf
PHP Vs NodeJS for Backend Web Development.pdfPHP Vs NodeJS for Backend Web Development.pdf
PHP Vs NodeJS for Backend Web Development.pdf
 
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdfNode.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
 
IBM Bluemix™ Architecture & Deep Dive
IBM Bluemix™ Architecture & Deep DiveIBM Bluemix™ Architecture & Deep Dive
IBM Bluemix™ Architecture & Deep Dive
 
The New IT - Your Milestone Plan
The New IT -  Your Milestone PlanThe New IT -  Your Milestone Plan
The New IT - Your Milestone Plan
 
The New IT - Your Milestone Plan
The New IT - Your Milestone Plan The New IT - Your Milestone Plan
The New IT - Your Milestone Plan
 

More from Mark Atwood

Openshift + Openstack + Fedora = Awesome
Openshift + Openstack + Fedora = AwesomeOpenshift + Openstack + Fedora = Awesome
Openshift + Openstack + Fedora = Awesome
Mark Atwood
 
NoSQL Part 3, or A Modest Proposal for a Heretical Key Valuestore
NoSQL Part 3, or A Modest Proposal for a Heretical Key ValuestoreNoSQL Part 3, or A Modest Proposal for a Heretical Key Valuestore
NoSQL Part 3, or A Modest Proposal for a Heretical Key Valuestore
Mark Atwood
 
Memcached, presented to LCA2010
Memcached, presented to LCA2010Memcached, presented to LCA2010
Memcached, presented to LCA2010
Mark Atwood
 

More from Mark Atwood (7)

How to get one of those Open Source jobs
How to get one of those Open Source jobsHow to get one of those Open Source jobs
How to get one of those Open Source jobs
 
Why is Open Source so Good: Thirty Years of Lessons Learned
Why is Open Source so Good: Thirty Years of Lessons LearnedWhy is Open Source so Good: Thirty Years of Lessons Learned
Why is Open Source so Good: Thirty Years of Lessons Learned
 
AMD Fusion12 Developer Summit: Introducing Red Hat OpenShift
AMD Fusion12 Developer Summit: Introducing Red Hat OpenShiftAMD Fusion12 Developer Summit: Introducing Red Hat OpenShift
AMD Fusion12 Developer Summit: Introducing Red Hat OpenShift
 
Openshift + Openstack + Fedora = Awesome
Openshift + Openstack + Fedora = AwesomeOpenshift + Openstack + Fedora = Awesome
Openshift + Openstack + Fedora = Awesome
 
NoSQL Part 3, or A Modest Proposal for a Heretical Key Valuestore
NoSQL Part 3, or A Modest Proposal for a Heretical Key ValuestoreNoSQL Part 3, or A Modest Proposal for a Heretical Key Valuestore
NoSQL Part 3, or A Modest Proposal for a Heretical Key Valuestore
 
Eucalyptus: Our Story. Presented at LCA2011
Eucalyptus: Our Story. Presented at LCA2011Eucalyptus: Our Story. Presented at LCA2011
Eucalyptus: Our Story. Presented at LCA2011
 
Memcached, presented to LCA2010
Memcached, presented to LCA2010Memcached, presented to LCA2010
Memcached, presented to LCA2010
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 

Telephony with OpenShift Twilio and MongoDB

  • 1. Telephony Applications with MongoDB, OpenShift, & Twilio Mark Atwood Developer Evangelist for Red Hat OpenShift me@mark.atwood.name Twitter @fallenpegasus
  • 2. What is OpenShift?  Red Hat cloud Platform as a Service  Free as in beer, Free as in speech  Languages: Python, Java, Ruby, Node, PHP, & DIY  Storage: Filesystem, MySQL, Postgres, MongoDB  No lock-in, no proprietary APIs  Sign up at http://openshift.redhat.com  Promo code SEATTLE 2
  • 3. What is Twilio?  A cloudy API for telephony  REST interface to the PSTN: Voice & SMS  Pay by the drink 3
  • 4. How Twilio voice works  Someone calls the number  Twilio answers the phone  Twilio does HTTP REST to our app  Our app replies with some "TwiML"  Twilio does what the app told it to  Twilio or the caller hangs up the phone 4
  • 5. How Twilio SMS works  Someone texts to the number  Twilio receives the text & all metadata  Twilio does HTTP REST to our app  Our app replies with some "TwiML"  Twilio does what the app told it to 5
  • 6. What is MongoDB?  If you have to ask that, you shouldn't be here!  Easy to use JSONic Document Store 6
  • 7. What is Python & What is Bottle?  My favorite programming language  My favorite web framework  Supported by OpenShift  Drivers for MongoDB & for Twilio 7
  • 8. A simple app: SMS Group  SMS group chat  http://github.com/fallenpegasus/openshift-smsgroup  +1-XXX-XXX-XXXX  SMS .join to join  SMS .leave to leave 8
  • 9. Glue it all together  Get an OpenShift account  Get a Twilio account  Spin up "smsgroup" app in OpenShift  Attach it to your Twilio account  Play! 9
  • 10. Agenda for Demonstration  Look at the app at twilio.com  Look at the app at openshift.com  SSH into the app  Port forward from local to remote MongoDB  Run local MongoDB clients 10
  • 11. 11
  • 12. Some useful software design guidelines  Let the language, the libraries, & remote services do the boring work  Don't keep state in the app, use a data layer  Use queuing to smooth load 12
  • 13. Don't keep state in the app  Keep it in the data layer instead  OpenShift might restart or scale the instance at any time  Don't waste time keeping complex data in the instance  Don't try to write your own database server 13
  • 14. Don't keep state in the app  Keep it in the data layer instead  OpenShift might restart or scale the instance at any time  Don't waste time keeping complex data in the instance  Don't try to write your own database server  MongoDB is an excellent solution 14
  • 15. Use queuing to smooth the load  Don't depend on "their" capacity  Getting local storage quickly is easier than provisioning more CPU, IO ops, or network bandwidth 15
  • 16. Use queuing to smooth the load  Don't depend on "their" capacity  Getting local storage quickly is easier than provisioning more CPU, IO ops, or network bandwidth  And it's cheaper 16
  • 17. Some Queue options  roll your own  SQS  AQMP  RabbitMQ  etc 17
  • 18. Queue options  roll your own  SQS  AQMP  RabbitMQ  etc  MongoDB "find_and_modify" 18
  • 19. def worker: while True: time.sleep(1) while True: msg = mongo_db.sendq.find_and_modify(remove = True) if (msg == None): break message = twilio_client.sms.message.create( to = msg['To'], from_ = twilio_fromnum, body = msg['Body']) 19
  • 20. Conclusion  Telephony apps are easy and fun  You can build your own  Using OpenShift, Twilio, and MongoDB 20

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n