SlideShare uma empresa Scribd logo
1 de 89
Baixar para ler offline
DEVELOPING WITH CLOUD
         SERVICES
Chris Richardson

Author of POJOs in Action
Founder of the original CloudFoundry.com

  @crichardson
chris.richardson@springsource.com
http://plainoldobjects.com
Presentation goal

  How to build robust,
scalable applications with
     Cloud Services

                         @crichardson
About Chris




              @crichardson
(About Chris)




                @crichardson
About Chris()




                @crichardson
About Chris




              @crichardson
About Chris




http://www.theregister.co.uk/2009/08/19/springsource_cloud_foundry/




                                                                      @crichardson
vmc push About-Chris


    Developer Advocate for
      CloudFoundry.com

Signup at http://cloudfoundry.com


                              @crichardson
Agenda


• Why   use cloud services?

• Developing    location-based applications

• Building   SMS and telephony enabled applications

• Developing    robust, fault tolerant applications


                                                      @crichardson
Three phases of every galactic
          civilization
Survival
Inquiry
Sophistication


                             @crichardson
Three phases of every galactic
          civilization
How can we eat?
Why do we eat?
Where shall we have lunch?


                             @crichardson
Where shall we
 have lunch?

            @crichardson
Solved by VoteMeetEat.com

•What restaurants are nearby?
•Which friends are close by?
•Where do your friends prefer to eat?




                                         To sign up text
                                        "register" to 510-
                                           XXX-YYYY
                                                    @crichardson
VoteMeetEat.com

Friend and restaurant location databases
                   +
                  SMS
                   +
               Voice calls
                             To sign up text
                            "register" to 510-
                               XXX-YYYY
                                        @crichardson
Key story: registration




             5
551212


                           @crichardson
Key story: registration

            +5105551212




                          @crichardson
Key story: voting
        555 1212




                    @crichardson
Key story: announce location




                          @crichardson
VOTEMEETEAT.COM

 To sign up text
"register" to 510-
   XXX-YYYY
High-level architecture
                        DIY = DIFFICULT

          Telephony                    Friend Geo
          Integration                   Database
Mobile                      VoteMeet
Phone                          Eat

                                       Restaurant
                                       Database
  Do we really want to
     build all this?
                                            @crichardson
Use cloud-based services


•   Highly scalable services

•   Someone else’s headache to develop and maintain

•   Provided by IaaS/PaaS

•   Provided by 3rd party



                                                      @crichardson
Cloud Foundry services




                         @crichardson
Thousands of 3rd party services




 http://www.slideshare.net/jmusser/j-musser-apishotnotgluecon2012
         http://www.programmableweb.com/apis/directory
                                                                    @crichardson
Cloud service trends

• Predominantly     REST

• Predominantly     JSON

•> billion API calls/day: Twitter, Google, Facebook, Netflix,
 Accuweather, ...

• Increasing   number of API-only companies

        http://www.slideshare.net/jmusser/j-musser-apishotnotgluecon2012
                                                                           @crichardson
Diverse




          @crichardson
Benefits of cloud services

• Someone      else’s headache to develop and operate

• Focus   on your core business problem

• Get   up and running quickly

• Elasticity

• Capex        Opex

                                                        @crichardson
Drawbacks of cloud services



• Complexity   and drawbacks of a distributed system

• You   are dependent on service provider




                                                       @crichardson
Risks of cloud services




 Urban Airship’s Strategic Partnership With
   SimpleGeo Turns Into An Acquisition
                                         @crichardson
Cloud Services-based
             architecture

           Twilio
                                  MongoDB
Mobile
Phone               VoteMeetEat


                                  Factual.Com



                                        @crichardson
DEMO



       @crichardson
Agenda


• Why   use cloud services?

• Developing    location-based applications

• Building   SMS and telephony enabled applications

• Developing    robust, fault tolerant applications


                                                      @crichardson
Location-based services are hot!




                             @crichardson
Client-side APIs for finding
                location
W3C Geolocation API




                                    @crichardson
BUT what about the server-side?



                            @crichardson
Lots of really difficult problems

• Scalable, spatial database – CRUD records, find nearby
• Data management – database of places, street information
• Forward geo-coding: address lat/lon
• Reverse geo-coding: lat/lon   address
• Maps
• Directions


    Easier to use Geo-aaS
                                                       @crichardson
Examples of Geo-aaS

•   Maps                             • Freely available geographic
•   Forward and reverse geocoding      database
•   Directions                       • Various APIs including
•   Elevation                          reverse geocoding
•   Places



• Business+review database          • Places database
• Neighborhood database             • Reverse geocoding


                                                     Beware the terms of
                                                          service
                                                               @crichardson
VoteMeetEat.com & Geo

trait FriendService {
    def addOrUpdate(request : AddOrUpdateUserRequest)
    def findNearbyFriends(request : NearbyFriendsRequest) :
                FindNearbyFriendsResponse
}


trait RestaurantService {
  def findNearbyRestaurants(location: Location) :
                  FindNearbyRestaurantResponse
}



                                                      @crichardson
Implementing the friends
             database
trait FriendService {
    def addOrUpdate(request : AddOrUpdateUserRequest)
    def findNearbyFriends(request : NearbyFriendsRequest) :
                FindNearbyFriendsResponse
}

                                                      @crichardson
MongoDB

• Document-oriented       database

• Very   fast, highly scalable and available

• Rich
     query language that supports location-
 based queries

• Provided      by CloudFoundry.com


                                               @crichardson
Storing friends in MongoDB
             MongoDB server

         Database: VoteMeetEat
        Collection: friendRecord

  {
      "_id": "+15105551212",
      "name": "Chris R.",
      "location": {
         "x": -122.25206103187264,
         "y": 37.847427441773796
      }
  }




                                     @crichardson
Spring Data for MongoDB


• Provides   MongoTemplate

• Analogous    to JdbcTemplate

• Hides   boilerplate code

• Domain     object   Document mapping


                                         @crichardson
Using Spring data: creating an
     index on location attribute
@Component
class MongoFriendService extends FriendService {

  @Autowired
  var mongoTemplate: MongoTemplate = _

  @PostConstruct                              Collection name
  def createGeoIndex {
    val dbo = new BasicDBObject
    dbo.put("location", "2d")
    mongoTemplate.getCollection("friendRecord").ensureIndex(dbo)
  }




                             Create geospatial 2d index
                                                             @crichardson
Using Spring Data: adding record
@Component
class MongoFriendService extends FriendService {

  override def addOrUpdate(request: AddOrUpdateUserRequest) = {
    val name = request.name
    val phoneNumber = request.phoneNumber
    val fr = new FriendRecord(phoneNumber, name,
              new Point(request.longitude, request.latitude))
    mongoTemplate.save(fr)
  }


              case class FriendRecord(id : String,
                            name : String,
                            location : Point)

                                                        @crichardson
Using Spring Data: finding nearby
               friends
@Component
class MongoFriendService extends FriendService {


  override def findNearbyFriends(request: NearbyFriendsRequest) = {
    val location = new Point(request.longitude, request.latitude)
    val distance = new Distance(3, Metrics.MILES)
    val query = NearQuery.near(location).maxDistance(distance)

      val result = mongoTemplate.geoNear(query, classOf[FriendRecord])

      val nearby = result.getContent.map(_.getContent)
      FindNearbyFriendsResponse(nearby.map(f => FriendInfo(f.name, f.id)))
  }




                                                                         @crichardson
MongoDB and Cloud Foundry


$ vmc create-service mongodb vme-mongo




                                   @crichardson
Binding a service to an application
   $ vmc push vme-user --path web/target/
   Application Deployed URL [cer-spring.cloudfoundry.com]:
   Detected a Java SpringSource Spring Application, is this correct? [Yn]:
   Memory Reservation (64M, 128M, 256M, 512M, 1G) [512M]:
    Creating Application: OK
Would you like to bind anyany services to 'vme-user'? [yN]: y
    Would you like to bind services to 'vme-user'? [yN]: y
Would you like to use an an existing provisioned [yN]: y
    Would you like to use existing provisioned service? service? [yN]:        y
The The following provisioned services are available
     following provisioned services are available
1: vme-mongo
   1: vme-mongo
2: mysql-135e0
   2: mysql-135e0
Please select one you wish to use: use: 1
   Please select one you wish to 1
Binding Service [vme-mongo]: OK OK
   Binding Service [vme-mongo]:
   Uploading Application:
     Checking for available resources: OK
     Processing resources: OK
     Packing application: OK
     Uploading (12K): OK
   Push Status: OK


                                                                       @crichardson
Connecting to MongoDB
	 <bean id="mongoTemplate"
       class="org.springframework.data.mongodb.core.MongoTemplate">
	 	 <constructor-arg ref="mongoFactory" />
	 </bean>
                                         Outside of Cloud Foundry

	 <beans profile="default">
	 	 <mongo:db-factory id="mongoFactory" dbname="surveygeo" />
	 </beans>

                                          Inside Cloud Foundry

	 <beans profile="cloud">
	 	 <cloud:mongo-db-factory id="mongoFactory" />
	 </beans>

                                                           @crichardson
Implementing the restaurant
            database
trait RestaurantService {
  def findNearbyRestaurants(location: Location) :
                            FindNearbyRestaurantResponse
}



                                                      @crichardson
Using Factual


• Geographic     database as a Service

• Including      1.2M restaurants in the US

• Pricing: 10K   calls day free, pay per use



                                               @crichardson
Factual API

• RESTful/JSON     interface

  • Uses   2-legged OAuth 1.0.

  • Geo    and text filters

  • Pagination

• Libraries   for various languages

                                       @crichardson
Restaurant Service
@Service
class FactualRestaurantService extends RestaurantService {

  @Value("${factual_consumer_key}") var consumerKey: String = _
  @Value("${factual_consumer_secret}") var consumerSecret: String = _

  var factual: Factual = _

  @PostConstruct
                                                           5 restaurants within 1km
  def initialize {
    factual = new Factual(consumerKey, consumerSecret, true)
  }

  override def findNearbyRestaurants(location: Location) = {
    ...
    val restaurants = factual.get.fetch("restaurants-us",
         new Query().within(new Circle(location.lat, location.lon, 1000)).limit(5))

      val rs = restaurants.getData.map { map =>
                    RestaurantInfo(map.get("name").asInstanceOf[String])
      }

      FindNearbyRestaurantResponse(rs.toList)

  }
...
                                                                                      @crichardson
Agenda


• Why   use cloud services?

• Developing    location-based applications

• Building   SMS and telephony enabled applications

• Developing    robust, fault tolerant applications


                                                      @crichardson
The telephony and SMS are
                   important
    7/ waking hr !




http://blog.nielsen.com/nielsenwire/online_mobile/new-mobile-obsession-
                                                                          Nielsen
                        u-s-teens-triple-data-usage/




                                                                                    @crichardson
Reporting traffic light problems in London




                                     @crichardson
Google 2-Factor authentication




                           @crichardson
VoteMeetEat.com & Telephony

• Handling   registration SMS

• Sending   SMS notifying users to vote

• Handling   incoming voice call from voters:

 • Text-to-speech    of restaurants options

 • Collecting   digits entered via keypad

• Sending   SMS/Voice notifications of voting results
                                                       @crichardson
DIY telephony = Difficult

                                           aS:
                                        y-a
                                  hon
• Difficult   to setup and operate
                            Telep
• Expensive
                     e S MS/
             to   us
        ter
• Complex SMS protocols
   Bet
•…



                                          @crichardson
Telephony/SMS - aaS


• SMS                         • SMS
• Inbound and outgoing calls • Inbound and outgoing calls
• Recording and transcription • Recording and transcription
                              • Twitter
                              • IM




                                                     @crichardson
Twilio - Telephony and SMS as a
                service
• REST API
  • Allocate phone numbers
  • Make and receive phone calls
  • Send and receive SMS messages
• Pay per use:
  • Phone calls - per-minute
  • SMS – per SMS sent or received
  • Phone number – per month
• Examples
  •   OpenVBX is a web-based, open source phone system
  •   StubHub – notifies sellers of a pending sale via phone
  •   SurveyMonkey – interactive polling
  •   Salesforce – SMS-based voting for 19,000 conference attendees

                                                                      @crichardson
Using Twilio                      Manage resources
                                                        Send SMS
                                                   Initiate voice calls


                                     REST API

         Voice
         SMS
                                                       Your
                    Twilio         HTTP GET/         Application
                                     POST



                                     TwiML doc
  Phone number
                             Handle incoming SMS and voice calls
SMS URL + VOICE URL                Respond to user input
                                                            @crichardson
Handling SMS registration
                          User
                          texts
                        ‘register’




                        System
             5          replies
551212


                            @crichardson
Handling SMS registration

               HTTP POST
               http://≪smsUrl≫?From=≪PhoneNumber≫
SMS                                           SMS
      Twilio                             REGISTRATION

               <Response>
                <Sms>To complete registration please
                      go to http://...
                </Sms>
               </Response>
                                                @crichardson
Handling SMS registration




                      TwiML document
                       describing the
                         response

                             @crichardson
Inviting users to vote
                    System sends
                         text



   5551212




                           @crichardson
Inviting users to vote
POST /2010-04-01/Accounts/≪AccountSID≫/SMS/Messages
 From=+15105551212
&To=+14155551212
&Body=≪MESSAGE≫
Authorization: Basic ....




                Basic auth using Twilio
               AccountSid+AuthToken
                                                  @crichardson
Sending SMS using the Spring
            RestTemplate

@Component
class TwilioService {

	   def sendSms(recipient : String, message : String) = {
	   	   val response = postToTwilio("SMS/Messages",
	   	       Map("From" -> twilioPhoneNumber, "To" -> recipient, "Body" -> message))
	   	   (response  "SMSMessage"  "Sid").text
	   }




                                                                          @crichardson
Sending SMS using the Spring
@Component
              RestTemplate
class TwilioService {

                                                                     TODO
    def postToTwilio(resourcePath : String, requestParams : Map[String, String]) = {
	
	    val entity = makeEntity(requestParams)

	    try {
	      val response = restTemplate.postForObject(twilioUrl +
                                                    "/Accounts/{accountSid}/{resource}",
	                                                entity, classOf[String],
                                                 accountSid, resourcePath)
	       XML.loadString(response)
	    } catch {
	       case e : HttpClientErrorException if e.getStatusCode == HttpStatus.BAD_REQUEST =>
	         val body = e.getResponseBodyAsString()
	         val xmlBody = XML.loadString(body)
	         val code = Integer.parseInt((xmlBody  "Code").text)
	         val message = (xmlBody  "Message").text
	         throw new TwilioRestException(message, code)
	    }
}
                                                                                @crichardson
Voting: user calls number
            555 1212




                            @crichardson
Voting
                HTTP POST
                http://≪voiceUrl≫?From=≪PhoneNumber≫

                                          Survey Management
Call            <Response>
       Twilio    <Say> Chris would like to meet and eat. </Say>
                 <Gather action="handleresponse.html"
                         method="POST" numDigits="1">
                  <Say>Press 1 for ....</Say>
                  <Say>Press 2 for ....</Say>
                 </Gather>
                </Response>                            @crichardson
Voting
                  HTTP POST
                  http://....handleresponse.html?
                  From=≪PhoneNumber≫&Digits=≪...≫
                                            Survey Management
Digits
                  <Response>
         Twilio       <Say>Thank you for choosing.
                         The most popular place so far is ...
                       </Say>
                      <Pause/>
                      <Say>You will hear from us soon. Good bye</Say>
                      <Hangup/>
                  </Response>
                                                           @crichardson
Voting code 1
@Controller
class TwilioController {
  @Autowired
  var surveyManagementService: SurveyManagementService = _

 @RequestMapping(value = Array("/begincall.html"))
 @ResponseBody
 def beginCall(@RequestParam("From") callerId: String) = {
   surveyManagementService.findSurveyByCallerId(callerId) match {
     case None =>
       <Response>
         <Say>Sorry don't recognize your number</Say>
         <Hangup/>
       </Response>
     case Some(survey) =>
       <Response>
         <Say>{ survey.prompt }</Say>
         <Gather action="handleresponse.html" method="POST" numDigits="1">
           {
             for ((choice, index) <- survey.choices zipWithIndex)
               yield <Say>Press { index } for { choice }</Say>
           }
         </Gather>
         <Say>We are sorry you could not decide</Say>
         <Hangup/>
       </Response>
   }                                                                         @crichardson
 }
Voting code 2
class TwilioController {
  ...
  @RequestMapping(value = Array("/handleresponse.html"))
  @ResponseBody
  def handleUserResponse(@RequestParam("From") callerId: String,
                         @RequestParam("Digits") digits: Int) = {
    val survey = surveyManagementService.recordVote(callerId, digits)
    <Response>
       <Say>Thank you for choosing. The most popular place so far is
                    { survey.map(_.mostPopularChoice) getOrElse "oops" }
        </Say>
       <Pause/>
       <Say>You will hear from us soon. Good bye</Say>
       <Hangup/>
    </Response>
  }
}


                                                                    @crichardson
Agenda


• Why   use cloud services?

• Developing    location-based applications

• Building   SMS and telephony enabled applications

• Developing    robust, fault tolerant applications


                                                      @crichardson
The need for parallelism
                                  Service B
               b = serviceB()


                                              Call in parallel
                 c = serviceC()
Service A                         Service C



            d = serviceD(b, c)
                                  Service D


                                                      @crichardson
Futures are a great concurrency
              abstraction
•   Object that will contain the result of a concurrent computation -
    http://en.wikipedia.org/wiki/Futures_and_promises

•   Various implementations
                                     Future<Integer> result =
                                        executorService.submit(new Callable<Integer>() {... });
    •   Java 7 Futures = ok

    •   Guava ListenableFutures = better

    •   Scala’s composable Futures = really good

    •   Java 8 CompletableFuture = great
                                                                                  @crichardson
Using futures to parallelize requests
    trait FriendService {

        def findNearbyFriends(request : NearbyFriendsRequest) :
                              Future[FindNearbyFriendsResponse]
    }
                     trait RestaurantService {
          Client
                         def findNearbyRestaurants(location: Location) :
           Side                      Future[FindNearbyRestaurantResponse]
         Proxies     }




val f1 = friendsService.findNearbyFriends(NearbyFriendsRequest.fromLocation(vmeRecord.location))
val f2 = restaurantService.findNearbyRestaurants(vmeRecord.location)

val nearbyFriends = f1.get(2, TimeUnit.SECONDS)
val nearbyRestaurants = f2.get(2, TimeUnit.SECONDS)



                                                                 Two calls execute concurrently
                                                                                      @crichardson
Using external web services =
       Distributed system

         Twilio
                                MongoDB
Mobile
Phone             VoteMeetEat


                                Factual.Com



                                      @crichardson
Internally = Distributed System
       Survey
     management

                                User
                             management

     Registration
        SMS

                    Rabbit
                     MQ
     Registration
      web app

                                VME
                             management
       VME
      web app



                                          @crichardson
Handling failure

Service A                   Service B




            Errors happen
        in distributed systems




                                        @crichardson
About Netflix

         > 1B API calls/day

1 API call   average 6 service calls

    Fault tolerance is essential




                  http://techblog.netflix.com/2012/02/fault-tolerance-in-high-volume.html
                                                                                 @crichardson
Use network timeouts and retries

            Never wait forever
  Network errors can be transient                                       retry




                       http://techblog.netflix.com/2012/02/fault-tolerance-in-high-volume.html
                                                                                @crichardson
Use per-dependency bounded thread pool

                   Service A

     Runnable 1               Task 1

     Runnable 2               Task 2
                                                                                   Service B
      Runnable ...            Task ...

    bounded queue         bounded thread pool


       Fails fast if         Limits number of
service is slow or down     outstanding requests



                                                   http://techblog.netflix.com/2012/02/fault-tolerance-in-high-volume.html
                                                                                                             @crichardson
Use a circuit breaker

         High error rate      stop calling temporarily

            Down     wait for it to come back up

             Slow    gives it a chance to recover

Closed
           errors      Open
           timeout
 success     Half    fail
             open                 http://techblog.netflix.com/2012/02/fault-tolerance-in-high-volume.html
                                                                                            @crichardson
On failure
          Return cached data
Avoid
Failing
          Return default data


               Fail fast




                     http://techblog.netflix.com/2012/02/fault-tolerance-in-high-volume.html
                                                                               @crichardson
About Netflix Hystrix
•   Open-source library from Netflix

•   Implements                      class MyCommand
                                         extends HystrixCommand[ResultType](...)
    •   Circuit Breaker pattern
                                          override def run() = {
                                            ... Invoke remote service ...
    •   Bounded thread-pool               }
                                    }
    •   Fallback logic
                                    val future = new MyCommand().queue()
                                    ...
    •   ...

•   https://github.com/Netflix/Hystrix
                                                                       @crichardson
Using Hystrix
@Service
class FactualRestaurantService extends RestaurantService {

    @Autowired
    @Qualifier("factualHystrixConfig")
    var factualHystrixConfig: HystrixCommand.Setter = _


    override def findNearbyRestaurants(location: Location) = {

        class FindRestaurantsCommand
                extends HystrixCommand[FindNearbyRestaurantResponse]
                       (factualHystrixConfig
                            .andCommandKey(HystrixCommandKey.Factory.asKey("FindRestaurantsCommand"))) {

            override def run() = {
              val restaurants = factual.fetch("restaurants",
                                   new Query().within(new Circle(location.lat, location.lon, 1000)).limit(5))
              val rs = for (map <- restaurants.getData) yield {
                RestaurantInfo(map.get("name").asInstanceOf[String])
              }
              FindNearbyRestaurantResponse(rs.toList)
            }
        }

        new FindRestaurantsCommand().queue()
    }
}                                                                                                @crichardson
Summary

Cloud services are highly scalable services developed and
                operated by a 3rd party

     Let’s you focus on your core business problem

   Risk: provider is acquired and stops offering service

 Developing an application that reliably consumes cloud
           services requires careful design


                                                      @crichardson
@crichardson chris.richardson@springsource.com
  http://plainoldobjects.com - code and slides




            Questions?
    Sign up for CloudFoundry.com
                                                 @crichardson

Mais conteúdo relacionado

Mais procurados

Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...
Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...
Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...Lucas Jellema
 
Windows Azure: Lessons From the Field
Windows Azure: Lessons From the FieldWindows Azure: Lessons From the Field
Windows Azure: Lessons From the FieldMichael Collier
 
Responsive & Responsible: Implementing Responsive Design at Scale
Responsive & Responsible: Implementing Responsive Design at ScaleResponsive & Responsible: Implementing Responsive Design at Scale
Responsive & Responsible: Implementing Responsive Design at Scalescottjehl
 
How AOL Advertising Uses NoSQL to Make Millions of Smart Targeting Decisions ...
How AOL Advertising Uses NoSQL to Make Millions of Smart Targeting Decisions ...How AOL Advertising Uses NoSQL to Make Millions of Smart Targeting Decisions ...
How AOL Advertising Uses NoSQL to Make Millions of Smart Targeting Decisions ...DATAVERSITY
 
Developing Applications on AWS with .NET Core - DEV330 - re:Invent 2017
Developing Applications on AWS with .NET Core - DEV330 - re:Invent 2017Developing Applications on AWS with .NET Core - DEV330 - re:Invent 2017
Developing Applications on AWS with .NET Core - DEV330 - re:Invent 2017Amazon Web Services
 
2014 sept 4_hadoop_security
2014 sept 4_hadoop_security2014 sept 4_hadoop_security
2014 sept 4_hadoop_securityAdam Muise
 
Frank Mantek Google G Data
Frank Mantek Google G DataFrank Mantek Google G Data
Frank Mantek Google G Datadeimos
 
Netflix on Cloud - combined slides for Dev and Ops
Netflix on Cloud - combined slides for Dev and OpsNetflix on Cloud - combined slides for Dev and Ops
Netflix on Cloud - combined slides for Dev and OpsAdrian Cockcroft
 
RedisConf18 - The Versatility of Redis - Powering our critical business using...
RedisConf18 - The Versatility of Redis - Powering our critical business using...RedisConf18 - The Versatility of Redis - Powering our critical business using...
RedisConf18 - The Versatility of Redis - Powering our critical business using...Redis Labs
 
Global Netflix - HPTS Workshop - Scaling Cassandra benchmark to over 1M write...
Global Netflix - HPTS Workshop - Scaling Cassandra benchmark to over 1M write...Global Netflix - HPTS Workshop - Scaling Cassandra benchmark to over 1M write...
Global Netflix - HPTS Workshop - Scaling Cassandra benchmark to over 1M write...Adrian Cockcroft
 
Migrating Netflix from Datacenter Oracle to Global Cassandra
Migrating Netflix from Datacenter Oracle to Global CassandraMigrating Netflix from Datacenter Oracle to Global Cassandra
Migrating Netflix from Datacenter Oracle to Global CassandraAdrian Cockcroft
 
High Performance Web Applications
High Performance Web ApplicationsHigh Performance Web Applications
High Performance Web ApplicationsAmazon Web Services
 
Performance architecture for cloud connect
Performance architecture for cloud connectPerformance architecture for cloud connect
Performance architecture for cloud connectAdrian Cockcroft
 
202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...
202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...
202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...Amazon Web Services Japan
 
Cloud Architecture Tutorial - Platform Component Architecture (2of3)
Cloud Architecture Tutorial - Platform Component Architecture (2of3)Cloud Architecture Tutorial - Platform Component Architecture (2of3)
Cloud Architecture Tutorial - Platform Component Architecture (2of3)Adrian Cockcroft
 
Using Compass to Diagnose Performance Problems in Your Cluster
Using Compass to Diagnose Performance Problems in Your ClusterUsing Compass to Diagnose Performance Problems in Your Cluster
Using Compass to Diagnose Performance Problems in Your ClusterMongoDB
 
Windows Azure for Developers - Building Block Services
Windows Azure for Developers - Building Block ServicesWindows Azure for Developers - Building Block Services
Windows Azure for Developers - Building Block ServicesMichael Collier
 
CMP209_Getting started with Docker on AWS
CMP209_Getting started with Docker on AWSCMP209_Getting started with Docker on AWS
CMP209_Getting started with Docker on AWSAmazon Web Services
 

Mais procurados (20)

Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...
Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...
Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...
 
Windows Azure: Lessons From the Field
Windows Azure: Lessons From the FieldWindows Azure: Lessons From the Field
Windows Azure: Lessons From the Field
 
Responsive & Responsible: Implementing Responsive Design at Scale
Responsive & Responsible: Implementing Responsive Design at ScaleResponsive & Responsible: Implementing Responsive Design at Scale
Responsive & Responsible: Implementing Responsive Design at Scale
 
How AOL Advertising Uses NoSQL to Make Millions of Smart Targeting Decisions ...
How AOL Advertising Uses NoSQL to Make Millions of Smart Targeting Decisions ...How AOL Advertising Uses NoSQL to Make Millions of Smart Targeting Decisions ...
How AOL Advertising Uses NoSQL to Make Millions of Smart Targeting Decisions ...
 
Pci multitenancy exalogic at AMIS25
Pci multitenancy exalogic at AMIS25Pci multitenancy exalogic at AMIS25
Pci multitenancy exalogic at AMIS25
 
Developing Applications on AWS with .NET Core - DEV330 - re:Invent 2017
Developing Applications on AWS with .NET Core - DEV330 - re:Invent 2017Developing Applications on AWS with .NET Core - DEV330 - re:Invent 2017
Developing Applications on AWS with .NET Core - DEV330 - re:Invent 2017
 
2014 sept 4_hadoop_security
2014 sept 4_hadoop_security2014 sept 4_hadoop_security
2014 sept 4_hadoop_security
 
Frank Mantek Google G Data
Frank Mantek Google G DataFrank Mantek Google G Data
Frank Mantek Google G Data
 
Netflix on Cloud - combined slides for Dev and Ops
Netflix on Cloud - combined slides for Dev and OpsNetflix on Cloud - combined slides for Dev and Ops
Netflix on Cloud - combined slides for Dev and Ops
 
Netflix in the cloud 2011
Netflix in the cloud 2011Netflix in the cloud 2011
Netflix in the cloud 2011
 
RedisConf18 - The Versatility of Redis - Powering our critical business using...
RedisConf18 - The Versatility of Redis - Powering our critical business using...RedisConf18 - The Versatility of Redis - Powering our critical business using...
RedisConf18 - The Versatility of Redis - Powering our critical business using...
 
Global Netflix - HPTS Workshop - Scaling Cassandra benchmark to over 1M write...
Global Netflix - HPTS Workshop - Scaling Cassandra benchmark to over 1M write...Global Netflix - HPTS Workshop - Scaling Cassandra benchmark to over 1M write...
Global Netflix - HPTS Workshop - Scaling Cassandra benchmark to over 1M write...
 
Migrating Netflix from Datacenter Oracle to Global Cassandra
Migrating Netflix from Datacenter Oracle to Global CassandraMigrating Netflix from Datacenter Oracle to Global Cassandra
Migrating Netflix from Datacenter Oracle to Global Cassandra
 
High Performance Web Applications
High Performance Web ApplicationsHigh Performance Web Applications
High Performance Web Applications
 
Performance architecture for cloud connect
Performance architecture for cloud connectPerformance architecture for cloud connect
Performance architecture for cloud connect
 
202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...
202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...
202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...
 
Cloud Architecture Tutorial - Platform Component Architecture (2of3)
Cloud Architecture Tutorial - Platform Component Architecture (2of3)Cloud Architecture Tutorial - Platform Component Architecture (2of3)
Cloud Architecture Tutorial - Platform Component Architecture (2of3)
 
Using Compass to Diagnose Performance Problems in Your Cluster
Using Compass to Diagnose Performance Problems in Your ClusterUsing Compass to Diagnose Performance Problems in Your Cluster
Using Compass to Diagnose Performance Problems in Your Cluster
 
Windows Azure for Developers - Building Block Services
Windows Azure for Developers - Building Block ServicesWindows Azure for Developers - Building Block Services
Windows Azure for Developers - Building Block Services
 
CMP209_Getting started with Docker on AWS
CMP209_Getting started with Docker on AWSCMP209_Getting started with Docker on AWS
CMP209_Getting started with Docker on AWS
 

Destaque

Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)Chris Richardson
 
Decomposing applications for deployability and scalability (SpringOne China 2...
Decomposing applications for deployability and scalability (SpringOne China 2...Decomposing applications for deployability and scalability (SpringOne China 2...
Decomposing applications for deployability and scalability (SpringOne China 2...Chris Richardson
 
Polygot persistence for Java Developers - August 2011 / @Oakjug
Polygot persistence for Java Developers - August 2011 / @OakjugPolygot persistence for Java Developers - August 2011 / @Oakjug
Polygot persistence for Java Developers - August 2011 / @OakjugChris Richardson
 
Developing polyglot applications on Cloud Foundry (#oredev 2012)
Developing polyglot applications on Cloud Foundry (#oredev 2012)Developing polyglot applications on Cloud Foundry (#oredev 2012)
Developing polyglot applications on Cloud Foundry (#oredev 2012)Chris Richardson
 
Developing polyglot persistence applications #javaone 2012
Developing polyglot persistence applications  #javaone 2012Developing polyglot persistence applications  #javaone 2012
Developing polyglot persistence applications #javaone 2012Chris Richardson
 
Decomposing applications for scalability and deployability - svcc sv_code_ca...
Decomposing applications for scalability and deployability  - svcc sv_code_ca...Decomposing applications for scalability and deployability  - svcc sv_code_ca...
Decomposing applications for scalability and deployability - svcc sv_code_ca...Chris Richardson
 
Decomposing applications for scalability and deployability (devnexus 2013)
Decomposing applications for scalability and deployability (devnexus 2013)Decomposing applications for scalability and deployability (devnexus 2013)
Decomposing applications for scalability and deployability (devnexus 2013)Chris Richardson
 
Improving application design with a rich domain model (springone 2007)
Improving application design with a rich domain model (springone 2007)Improving application design with a rich domain model (springone 2007)
Improving application design with a rich domain model (springone 2007)Chris Richardson
 
Developing polyglot persistence applications (SpringOne China 2012)
Developing polyglot persistence applications (SpringOne China 2012)Developing polyglot persistence applications (SpringOne China 2012)
Developing polyglot persistence applications (SpringOne China 2012)Chris Richardson
 
Developing polyglot persistence applications (gluecon 2013)
Developing polyglot persistence applications (gluecon 2013)Developing polyglot persistence applications (gluecon 2013)
Developing polyglot persistence applications (gluecon 2013)Chris Richardson
 
NodeJS: the good parts? A skeptic’s view (jax jax2013)
NodeJS: the good parts? A skeptic’s view (jax jax2013)NodeJS: the good parts? A skeptic’s view (jax jax2013)
NodeJS: the good parts? A skeptic’s view (jax jax2013)Chris Richardson
 
Microservices pattern language (microxchg microxchg2016)
Microservices pattern language (microxchg microxchg2016)Microservices pattern language (microxchg microxchg2016)
Microservices pattern language (microxchg microxchg2016)Chris Richardson
 
Map, Flatmap and Reduce are Your New Best Friends: Simpler Collections, Concu...
Map, Flatmap and Reduce are Your New Best Friends: Simpler Collections, Concu...Map, Flatmap and Reduce are Your New Best Friends: Simpler Collections, Concu...
Map, Flatmap and Reduce are Your New Best Friends: Simpler Collections, Concu...Chris Richardson
 
Map(), flatmap() and reduce() are your new best friends: simpler collections,...
Map(), flatmap() and reduce() are your new best friends: simpler collections,...Map(), flatmap() and reduce() are your new best friends: simpler collections,...
Map(), flatmap() and reduce() are your new best friends: simpler collections,...Chris Richardson
 

Destaque (14)

Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)
 
Decomposing applications for deployability and scalability (SpringOne China 2...
Decomposing applications for deployability and scalability (SpringOne China 2...Decomposing applications for deployability and scalability (SpringOne China 2...
Decomposing applications for deployability and scalability (SpringOne China 2...
 
Polygot persistence for Java Developers - August 2011 / @Oakjug
Polygot persistence for Java Developers - August 2011 / @OakjugPolygot persistence for Java Developers - August 2011 / @Oakjug
Polygot persistence for Java Developers - August 2011 / @Oakjug
 
Developing polyglot applications on Cloud Foundry (#oredev 2012)
Developing polyglot applications on Cloud Foundry (#oredev 2012)Developing polyglot applications on Cloud Foundry (#oredev 2012)
Developing polyglot applications on Cloud Foundry (#oredev 2012)
 
Developing polyglot persistence applications #javaone 2012
Developing polyglot persistence applications  #javaone 2012Developing polyglot persistence applications  #javaone 2012
Developing polyglot persistence applications #javaone 2012
 
Decomposing applications for scalability and deployability - svcc sv_code_ca...
Decomposing applications for scalability and deployability  - svcc sv_code_ca...Decomposing applications for scalability and deployability  - svcc sv_code_ca...
Decomposing applications for scalability and deployability - svcc sv_code_ca...
 
Decomposing applications for scalability and deployability (devnexus 2013)
Decomposing applications for scalability and deployability (devnexus 2013)Decomposing applications for scalability and deployability (devnexus 2013)
Decomposing applications for scalability and deployability (devnexus 2013)
 
Improving application design with a rich domain model (springone 2007)
Improving application design with a rich domain model (springone 2007)Improving application design with a rich domain model (springone 2007)
Improving application design with a rich domain model (springone 2007)
 
Developing polyglot persistence applications (SpringOne China 2012)
Developing polyglot persistence applications (SpringOne China 2012)Developing polyglot persistence applications (SpringOne China 2012)
Developing polyglot persistence applications (SpringOne China 2012)
 
Developing polyglot persistence applications (gluecon 2013)
Developing polyglot persistence applications (gluecon 2013)Developing polyglot persistence applications (gluecon 2013)
Developing polyglot persistence applications (gluecon 2013)
 
NodeJS: the good parts? A skeptic’s view (jax jax2013)
NodeJS: the good parts? A skeptic’s view (jax jax2013)NodeJS: the good parts? A skeptic’s view (jax jax2013)
NodeJS: the good parts? A skeptic’s view (jax jax2013)
 
Microservices pattern language (microxchg microxchg2016)
Microservices pattern language (microxchg microxchg2016)Microservices pattern language (microxchg microxchg2016)
Microservices pattern language (microxchg microxchg2016)
 
Map, Flatmap and Reduce are Your New Best Friends: Simpler Collections, Concu...
Map, Flatmap and Reduce are Your New Best Friends: Simpler Collections, Concu...Map, Flatmap and Reduce are Your New Best Friends: Simpler Collections, Concu...
Map, Flatmap and Reduce are Your New Best Friends: Simpler Collections, Concu...
 
Map(), flatmap() and reduce() are your new best friends: simpler collections,...
Map(), flatmap() and reduce() are your new best friends: simpler collections,...Map(), flatmap() and reduce() are your new best friends: simpler collections,...
Map(), flatmap() and reduce() are your new best friends: simpler collections,...
 

Semelhante a Developing applications with Cloud Services (Devnexus 2013)

Developing applications with Cloud Services (jax jax2013)
Developing applications with Cloud Services (jax jax2013)Developing applications with Cloud Services (jax jax2013)
Developing applications with Cloud Services (jax jax2013)Chris Richardson
 
(MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud
(MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud(MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud
(MBL203) Drones to Cars: Connecting the Devices in Motion to the CloudAmazon Web Services
 
Polyglot persistence for Java developers: time to move out of the relational ...
Polyglot persistence for Java developers: time to move out of the relational ...Polyglot persistence for Java developers: time to move out of the relational ...
Polyglot persistence for Java developers: time to move out of the relational ...Chris Richardson
 
AWS - Database Migration Service - Abdul Rasheed Feroz Khan
AWS - Database Migration Service - Abdul Rasheed Feroz KhanAWS - Database Migration Service - Abdul Rasheed Feroz Khan
AWS - Database Migration Service - Abdul Rasheed Feroz KhanAbdul Rasheed Feroz Khan
 
Real-time Microservices and In-Memory Data Grids
Real-time Microservices and In-Memory Data GridsReal-time Microservices and In-Memory Data Grids
Real-time Microservices and In-Memory Data GridsAli Hodroj
 
Kong Summit 2018 - Microservices: decomposing applications for testability an...
Kong Summit 2018 - Microservices: decomposing applications for testability an...Kong Summit 2018 - Microservices: decomposing applications for testability an...
Kong Summit 2018 - Microservices: decomposing applications for testability an...Chris Richardson
 
#JaxLondon keynote: Developing applications with a microservice architecture
#JaxLondon keynote: Developing applications with a microservice architecture#JaxLondon keynote: Developing applications with a microservice architecture
#JaxLondon keynote: Developing applications with a microservice architectureChris Richardson
 
Developing Applications with a Micro Service Architecture - Chris Richardson
Developing Applications with a Micro Service Architecture - Chris RichardsonDeveloping Applications with a Micro Service Architecture - Chris Richardson
Developing Applications with a Micro Service Architecture - Chris RichardsonJAXLondon2014
 
Connecting Mobile Services to On-Premises Resources Using Hybrid Connections
Connecting Mobile Services to On-Premises Resources Using Hybrid ConnectionsConnecting Mobile Services to On-Premises Resources Using Hybrid Connections
Connecting Mobile Services to On-Premises Resources Using Hybrid ConnectionsDaniel Toomey
 
Microservices + Events + Docker = A Perfect Trio by Docker Captain Chris Rich...
Microservices + Events + Docker = A Perfect Trio by Docker Captain Chris Rich...Microservices + Events + Docker = A Perfect Trio by Docker Captain Chris Rich...
Microservices + Events + Docker = A Perfect Trio by Docker Captain Chris Rich...Docker, Inc.
 
Cloud and azure and rock and roll
Cloud and azure and rock and rollCloud and azure and rock and roll
Cloud and azure and rock and rollDavid Giard
 
Cloud and azure and rock and roll
Cloud and azure and rock and rollCloud and azure and rock and roll
Cloud and azure and rock and rollDavid Giard
 
Intro to cloud and azure
Intro to cloud and azureIntro to cloud and azure
Intro to cloud and azureDavid Giard
 
Confluent-Ably-AWS-ID-2023 - GSlide.pptx
Confluent-Ably-AWS-ID-2023 - GSlide.pptxConfluent-Ably-AWS-ID-2023 - GSlide.pptx
Confluent-Ably-AWS-ID-2023 - GSlide.pptxAhmed791434
 
Microservices + Events + Docker = A Perfect Trio (dockercon)
Microservices + Events + Docker = A Perfect Trio (dockercon)Microservices + Events + Docker = A Perfect Trio (dockercon)
Microservices + Events + Docker = A Perfect Trio (dockercon)Chris Richardson
 
Microservices and the Cloud based future of integration final
Microservices and the Cloud based future of integration finalMicroservices and the Cloud based future of integration final
Microservices and the Cloud based future of integration finalBizTalk360
 
Introduction to Azure PaaS services (Nick Trogh at Codit Azure PaaS Event)
Introduction to Azure PaaS services (Nick Trogh at Codit Azure PaaS Event) Introduction to Azure PaaS services (Nick Trogh at Codit Azure PaaS Event)
Introduction to Azure PaaS services (Nick Trogh at Codit Azure PaaS Event) Codit
 
Introduction to Amazon CloudFront - Pop-up Loft Tel Aviv
Introduction to Amazon CloudFront - Pop-up Loft Tel AvivIntroduction to Amazon CloudFront - Pop-up Loft Tel Aviv
Introduction to Amazon CloudFront - Pop-up Loft Tel AvivAmazon Web Services
 

Semelhante a Developing applications with Cloud Services (Devnexus 2013) (20)

Developing applications with Cloud Services (jax jax2013)
Developing applications with Cloud Services (jax jax2013)Developing applications with Cloud Services (jax jax2013)
Developing applications with Cloud Services (jax jax2013)
 
(MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud
(MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud(MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud
(MBL203) Drones to Cars: Connecting the Devices in Motion to the Cloud
 
Polyglot persistence for Java developers: time to move out of the relational ...
Polyglot persistence for Java developers: time to move out of the relational ...Polyglot persistence for Java developers: time to move out of the relational ...
Polyglot persistence for Java developers: time to move out of the relational ...
 
AWS - Database Migration Service - Abdul Rasheed Feroz Khan
AWS - Database Migration Service - Abdul Rasheed Feroz KhanAWS - Database Migration Service - Abdul Rasheed Feroz Khan
AWS - Database Migration Service - Abdul Rasheed Feroz Khan
 
Real-time Microservices and In-Memory Data Grids
Real-time Microservices and In-Memory Data GridsReal-time Microservices and In-Memory Data Grids
Real-time Microservices and In-Memory Data Grids
 
Kong Summit 2018 - Microservices: decomposing applications for testability an...
Kong Summit 2018 - Microservices: decomposing applications for testability an...Kong Summit 2018 - Microservices: decomposing applications for testability an...
Kong Summit 2018 - Microservices: decomposing applications for testability an...
 
#JaxLondon keynote: Developing applications with a microservice architecture
#JaxLondon keynote: Developing applications with a microservice architecture#JaxLondon keynote: Developing applications with a microservice architecture
#JaxLondon keynote: Developing applications with a microservice architecture
 
Developing Applications with a Micro Service Architecture - Chris Richardson
Developing Applications with a Micro Service Architecture - Chris RichardsonDeveloping Applications with a Micro Service Architecture - Chris Richardson
Developing Applications with a Micro Service Architecture - Chris Richardson
 
Connecting Mobile Services to On-Premises Resources Using Hybrid Connections
Connecting Mobile Services to On-Premises Resources Using Hybrid ConnectionsConnecting Mobile Services to On-Premises Resources Using Hybrid Connections
Connecting Mobile Services to On-Premises Resources Using Hybrid Connections
 
Microservices + Events + Docker = A Perfect Trio by Docker Captain Chris Rich...
Microservices + Events + Docker = A Perfect Trio by Docker Captain Chris Rich...Microservices + Events + Docker = A Perfect Trio by Docker Captain Chris Rich...
Microservices + Events + Docker = A Perfect Trio by Docker Captain Chris Rich...
 
Cloud and azure and rock and roll
Cloud and azure and rock and rollCloud and azure and rock and roll
Cloud and azure and rock and roll
 
Cloud and azure and rock and roll
Cloud and azure and rock and rollCloud and azure and rock and roll
Cloud and azure and rock and roll
 
Intro to cloud and azure
Intro to cloud and azureIntro to cloud and azure
Intro to cloud and azure
 
Confluent-Ably-AWS-ID-2023 - GSlide.pptx
Confluent-Ably-AWS-ID-2023 - GSlide.pptxConfluent-Ably-AWS-ID-2023 - GSlide.pptx
Confluent-Ably-AWS-ID-2023 - GSlide.pptx
 
Opening Keynote
Opening KeynoteOpening Keynote
Opening Keynote
 
Microservices + Events + Docker = A Perfect Trio (dockercon)
Microservices + Events + Docker = A Perfect Trio (dockercon)Microservices + Events + Docker = A Perfect Trio (dockercon)
Microservices + Events + Docker = A Perfect Trio (dockercon)
 
Microservices and the Cloud based future of integration final
Microservices and the Cloud based future of integration finalMicroservices and the Cloud based future of integration final
Microservices and the Cloud based future of integration final
 
Introduction to Azure PaaS services (Nick Trogh at Codit Azure PaaS Event)
Introduction to Azure PaaS services (Nick Trogh at Codit Azure PaaS Event) Introduction to Azure PaaS services (Nick Trogh at Codit Azure PaaS Event)
Introduction to Azure PaaS services (Nick Trogh at Codit Azure PaaS Event)
 
Introduction to Amazon CloudFront - Pop-up Loft Tel Aviv
Introduction to Amazon CloudFront - Pop-up Loft Tel AvivIntroduction to Amazon CloudFront - Pop-up Loft Tel Aviv
Introduction to Amazon CloudFront - Pop-up Loft Tel Aviv
 
Introduction to CloudFront
Introduction to CloudFrontIntroduction to CloudFront
Introduction to CloudFront
 

Mais de Chris Richardson

The microservice architecture: what, why, when and how?
The microservice architecture: what, why, when and how?The microservice architecture: what, why, when and how?
The microservice architecture: what, why, when and how?Chris Richardson
 
More the merrier: a microservices anti-pattern
More the merrier: a microservices anti-patternMore the merrier: a microservices anti-pattern
More the merrier: a microservices anti-patternChris Richardson
 
YOW London - Considering Migrating a Monolith to Microservices? A Dark Energy...
YOW London - Considering Migrating a Monolith to Microservices? A Dark Energy...YOW London - Considering Migrating a Monolith to Microservices? A Dark Energy...
YOW London - Considering Migrating a Monolith to Microservices? A Dark Energy...Chris Richardson
 
Dark Energy, Dark Matter and the Microservices Patterns?!
Dark Energy, Dark Matter and the Microservices Patterns?!Dark Energy, Dark Matter and the Microservices Patterns?!
Dark Energy, Dark Matter and the Microservices Patterns?!Chris Richardson
 
Dark energy, dark matter and microservice architecture collaboration patterns
Dark energy, dark matter and microservice architecture collaboration patternsDark energy, dark matter and microservice architecture collaboration patterns
Dark energy, dark matter and microservice architecture collaboration patternsChris Richardson
 
Scenarios_and_Architecture_SkillsMatter_April_2022.pdf
Scenarios_and_Architecture_SkillsMatter_April_2022.pdfScenarios_and_Architecture_SkillsMatter_April_2022.pdf
Scenarios_and_Architecture_SkillsMatter_April_2022.pdfChris Richardson
 
Using patterns and pattern languages to make better architectural decisions
Using patterns and pattern languages to make better architectural decisions Using patterns and pattern languages to make better architectural decisions
Using patterns and pattern languages to make better architectural decisions Chris Richardson
 
iSAQB gathering 2021 keynote - Architectural patterns for rapid, reliable, fr...
iSAQB gathering 2021 keynote - Architectural patterns for rapid, reliable, fr...iSAQB gathering 2021 keynote - Architectural patterns for rapid, reliable, fr...
iSAQB gathering 2021 keynote - Architectural patterns for rapid, reliable, fr...Chris Richardson
 
Events to the rescue: solving distributed data problems in a microservice arc...
Events to the rescue: solving distributed data problems in a microservice arc...Events to the rescue: solving distributed data problems in a microservice arc...
Events to the rescue: solving distributed data problems in a microservice arc...Chris Richardson
 
A pattern language for microservices - June 2021
A pattern language for microservices - June 2021 A pattern language for microservices - June 2021
A pattern language for microservices - June 2021 Chris Richardson
 
QConPlus 2021: Minimizing Design Time Coupling in a Microservice Architecture
QConPlus 2021: Minimizing Design Time Coupling in a Microservice ArchitectureQConPlus 2021: Minimizing Design Time Coupling in a Microservice Architecture
QConPlus 2021: Minimizing Design Time Coupling in a Microservice ArchitectureChris Richardson
 
Mucon 2021 - Dark energy, dark matter: imperfect metaphors for designing micr...
Mucon 2021 - Dark energy, dark matter: imperfect metaphors for designing micr...Mucon 2021 - Dark energy, dark matter: imperfect metaphors for designing micr...
Mucon 2021 - Dark energy, dark matter: imperfect metaphors for designing micr...Chris Richardson
 
Designing loosely coupled services
Designing loosely coupled servicesDesigning loosely coupled services
Designing loosely coupled servicesChris Richardson
 
Microservices - an architecture that enables DevOps (T Systems DevOps day)
Microservices - an architecture that enables DevOps (T Systems DevOps day)Microservices - an architecture that enables DevOps (T Systems DevOps day)
Microservices - an architecture that enables DevOps (T Systems DevOps day)Chris Richardson
 
DDD SoCal: Decompose your monolith: Ten principles for refactoring a monolith...
DDD SoCal: Decompose your monolith: Ten principles for refactoring a monolith...DDD SoCal: Decompose your monolith: Ten principles for refactoring a monolith...
DDD SoCal: Decompose your monolith: Ten principles for refactoring a monolith...Chris Richardson
 
Decompose your monolith: Six principles for refactoring a monolith to microse...
Decompose your monolith: Six principles for refactoring a monolith to microse...Decompose your monolith: Six principles for refactoring a monolith to microse...
Decompose your monolith: Six principles for refactoring a monolith to microse...Chris Richardson
 
TDC2020 - The microservice architecture: enabling rapid, reliable, frequent a...
TDC2020 - The microservice architecture: enabling rapid, reliable, frequent a...TDC2020 - The microservice architecture: enabling rapid, reliable, frequent a...
TDC2020 - The microservice architecture: enabling rapid, reliable, frequent a...Chris Richardson
 
Overview of the Eventuate Tram Customers and Orders application
Overview of the Eventuate Tram Customers and Orders applicationOverview of the Eventuate Tram Customers and Orders application
Overview of the Eventuate Tram Customers and Orders applicationChris Richardson
 
An overview of the Eventuate Platform
An overview of the Eventuate PlatformAn overview of the Eventuate Platform
An overview of the Eventuate PlatformChris Richardson
 
#DevNexus202 Decompose your monolith
#DevNexus202 Decompose your monolith#DevNexus202 Decompose your monolith
#DevNexus202 Decompose your monolithChris Richardson
 

Mais de Chris Richardson (20)

The microservice architecture: what, why, when and how?
The microservice architecture: what, why, when and how?The microservice architecture: what, why, when and how?
The microservice architecture: what, why, when and how?
 
More the merrier: a microservices anti-pattern
More the merrier: a microservices anti-patternMore the merrier: a microservices anti-pattern
More the merrier: a microservices anti-pattern
 
YOW London - Considering Migrating a Monolith to Microservices? A Dark Energy...
YOW London - Considering Migrating a Monolith to Microservices? A Dark Energy...YOW London - Considering Migrating a Monolith to Microservices? A Dark Energy...
YOW London - Considering Migrating a Monolith to Microservices? A Dark Energy...
 
Dark Energy, Dark Matter and the Microservices Patterns?!
Dark Energy, Dark Matter and the Microservices Patterns?!Dark Energy, Dark Matter and the Microservices Patterns?!
Dark Energy, Dark Matter and the Microservices Patterns?!
 
Dark energy, dark matter and microservice architecture collaboration patterns
Dark energy, dark matter and microservice architecture collaboration patternsDark energy, dark matter and microservice architecture collaboration patterns
Dark energy, dark matter and microservice architecture collaboration patterns
 
Scenarios_and_Architecture_SkillsMatter_April_2022.pdf
Scenarios_and_Architecture_SkillsMatter_April_2022.pdfScenarios_and_Architecture_SkillsMatter_April_2022.pdf
Scenarios_and_Architecture_SkillsMatter_April_2022.pdf
 
Using patterns and pattern languages to make better architectural decisions
Using patterns and pattern languages to make better architectural decisions Using patterns and pattern languages to make better architectural decisions
Using patterns and pattern languages to make better architectural decisions
 
iSAQB gathering 2021 keynote - Architectural patterns for rapid, reliable, fr...
iSAQB gathering 2021 keynote - Architectural patterns for rapid, reliable, fr...iSAQB gathering 2021 keynote - Architectural patterns for rapid, reliable, fr...
iSAQB gathering 2021 keynote - Architectural patterns for rapid, reliable, fr...
 
Events to the rescue: solving distributed data problems in a microservice arc...
Events to the rescue: solving distributed data problems in a microservice arc...Events to the rescue: solving distributed data problems in a microservice arc...
Events to the rescue: solving distributed data problems in a microservice arc...
 
A pattern language for microservices - June 2021
A pattern language for microservices - June 2021 A pattern language for microservices - June 2021
A pattern language for microservices - June 2021
 
QConPlus 2021: Minimizing Design Time Coupling in a Microservice Architecture
QConPlus 2021: Minimizing Design Time Coupling in a Microservice ArchitectureQConPlus 2021: Minimizing Design Time Coupling in a Microservice Architecture
QConPlus 2021: Minimizing Design Time Coupling in a Microservice Architecture
 
Mucon 2021 - Dark energy, dark matter: imperfect metaphors for designing micr...
Mucon 2021 - Dark energy, dark matter: imperfect metaphors for designing micr...Mucon 2021 - Dark energy, dark matter: imperfect metaphors for designing micr...
Mucon 2021 - Dark energy, dark matter: imperfect metaphors for designing micr...
 
Designing loosely coupled services
Designing loosely coupled servicesDesigning loosely coupled services
Designing loosely coupled services
 
Microservices - an architecture that enables DevOps (T Systems DevOps day)
Microservices - an architecture that enables DevOps (T Systems DevOps day)Microservices - an architecture that enables DevOps (T Systems DevOps day)
Microservices - an architecture that enables DevOps (T Systems DevOps day)
 
DDD SoCal: Decompose your monolith: Ten principles for refactoring a monolith...
DDD SoCal: Decompose your monolith: Ten principles for refactoring a monolith...DDD SoCal: Decompose your monolith: Ten principles for refactoring a monolith...
DDD SoCal: Decompose your monolith: Ten principles for refactoring a monolith...
 
Decompose your monolith: Six principles for refactoring a monolith to microse...
Decompose your monolith: Six principles for refactoring a monolith to microse...Decompose your monolith: Six principles for refactoring a monolith to microse...
Decompose your monolith: Six principles for refactoring a monolith to microse...
 
TDC2020 - The microservice architecture: enabling rapid, reliable, frequent a...
TDC2020 - The microservice architecture: enabling rapid, reliable, frequent a...TDC2020 - The microservice architecture: enabling rapid, reliable, frequent a...
TDC2020 - The microservice architecture: enabling rapid, reliable, frequent a...
 
Overview of the Eventuate Tram Customers and Orders application
Overview of the Eventuate Tram Customers and Orders applicationOverview of the Eventuate Tram Customers and Orders application
Overview of the Eventuate Tram Customers and Orders application
 
An overview of the Eventuate Platform
An overview of the Eventuate PlatformAn overview of the Eventuate Platform
An overview of the Eventuate Platform
 
#DevNexus202 Decompose your monolith
#DevNexus202 Decompose your monolith#DevNexus202 Decompose your monolith
#DevNexus202 Decompose your monolith
 

Último

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 

Último (20)

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 

Developing applications with Cloud Services (Devnexus 2013)

  • 1. DEVELOPING WITH CLOUD SERVICES Chris Richardson Author of POJOs in Action Founder of the original CloudFoundry.com @crichardson chris.richardson@springsource.com http://plainoldobjects.com
  • 2. Presentation goal How to build robust, scalable applications with Cloud Services @crichardson
  • 3. About Chris @crichardson
  • 4. (About Chris) @crichardson
  • 5. About Chris() @crichardson
  • 6. About Chris @crichardson
  • 8. vmc push About-Chris Developer Advocate for CloudFoundry.com Signup at http://cloudfoundry.com @crichardson
  • 9. Agenda • Why use cloud services? • Developing location-based applications • Building SMS and telephony enabled applications • Developing robust, fault tolerant applications @crichardson
  • 10. Three phases of every galactic civilization Survival Inquiry Sophistication @crichardson
  • 11. Three phases of every galactic civilization How can we eat? Why do we eat? Where shall we have lunch? @crichardson
  • 12. Where shall we have lunch? @crichardson
  • 13. Solved by VoteMeetEat.com •What restaurants are nearby? •Which friends are close by? •Where do your friends prefer to eat? To sign up text "register" to 510- XXX-YYYY @crichardson
  • 14. VoteMeetEat.com Friend and restaurant location databases + SMS + Voice calls To sign up text "register" to 510- XXX-YYYY @crichardson
  • 15. Key story: registration 5 551212 @crichardson
  • 16. Key story: registration +5105551212 @crichardson
  • 17. Key story: voting 555 1212 @crichardson
  • 18. Key story: announce location @crichardson
  • 19. VOTEMEETEAT.COM To sign up text "register" to 510- XXX-YYYY
  • 20. High-level architecture DIY = DIFFICULT Telephony Friend Geo Integration Database Mobile VoteMeet Phone Eat Restaurant Database Do we really want to build all this? @crichardson
  • 21. Use cloud-based services • Highly scalable services • Someone else’s headache to develop and maintain • Provided by IaaS/PaaS • Provided by 3rd party @crichardson
  • 22. Cloud Foundry services @crichardson
  • 23. Thousands of 3rd party services http://www.slideshare.net/jmusser/j-musser-apishotnotgluecon2012 http://www.programmableweb.com/apis/directory @crichardson
  • 24. Cloud service trends • Predominantly REST • Predominantly JSON •> billion API calls/day: Twitter, Google, Facebook, Netflix, Accuweather, ... • Increasing number of API-only companies http://www.slideshare.net/jmusser/j-musser-apishotnotgluecon2012 @crichardson
  • 25. Diverse @crichardson
  • 26. Benefits of cloud services • Someone else’s headache to develop and operate • Focus on your core business problem • Get up and running quickly • Elasticity • Capex Opex @crichardson
  • 27. Drawbacks of cloud services • Complexity and drawbacks of a distributed system • You are dependent on service provider @crichardson
  • 28. Risks of cloud services Urban Airship’s Strategic Partnership With SimpleGeo Turns Into An Acquisition @crichardson
  • 29. Cloud Services-based architecture Twilio MongoDB Mobile Phone VoteMeetEat Factual.Com @crichardson
  • 30. DEMO @crichardson
  • 31. Agenda • Why use cloud services? • Developing location-based applications • Building SMS and telephony enabled applications • Developing robust, fault tolerant applications @crichardson
  • 32. Location-based services are hot! @crichardson
  • 33.
  • 34. Client-side APIs for finding location W3C Geolocation API @crichardson
  • 35. BUT what about the server-side? @crichardson
  • 36. Lots of really difficult problems • Scalable, spatial database – CRUD records, find nearby • Data management – database of places, street information • Forward geo-coding: address lat/lon • Reverse geo-coding: lat/lon address • Maps • Directions Easier to use Geo-aaS @crichardson
  • 37. Examples of Geo-aaS • Maps • Freely available geographic • Forward and reverse geocoding database • Directions • Various APIs including • Elevation reverse geocoding • Places • Business+review database • Places database • Neighborhood database • Reverse geocoding Beware the terms of service @crichardson
  • 38. VoteMeetEat.com & Geo trait FriendService { def addOrUpdate(request : AddOrUpdateUserRequest) def findNearbyFriends(request : NearbyFriendsRequest) : FindNearbyFriendsResponse } trait RestaurantService { def findNearbyRestaurants(location: Location) : FindNearbyRestaurantResponse } @crichardson
  • 39. Implementing the friends database trait FriendService { def addOrUpdate(request : AddOrUpdateUserRequest) def findNearbyFriends(request : NearbyFriendsRequest) : FindNearbyFriendsResponse } @crichardson
  • 40. MongoDB • Document-oriented database • Very fast, highly scalable and available • Rich query language that supports location- based queries • Provided by CloudFoundry.com @crichardson
  • 41. Storing friends in MongoDB MongoDB server Database: VoteMeetEat Collection: friendRecord { "_id": "+15105551212", "name": "Chris R.", "location": { "x": -122.25206103187264, "y": 37.847427441773796 } } @crichardson
  • 42. Spring Data for MongoDB • Provides MongoTemplate • Analogous to JdbcTemplate • Hides boilerplate code • Domain object Document mapping @crichardson
  • 43. Using Spring data: creating an index on location attribute @Component class MongoFriendService extends FriendService { @Autowired var mongoTemplate: MongoTemplate = _ @PostConstruct Collection name def createGeoIndex { val dbo = new BasicDBObject dbo.put("location", "2d") mongoTemplate.getCollection("friendRecord").ensureIndex(dbo) } Create geospatial 2d index @crichardson
  • 44. Using Spring Data: adding record @Component class MongoFriendService extends FriendService { override def addOrUpdate(request: AddOrUpdateUserRequest) = { val name = request.name val phoneNumber = request.phoneNumber val fr = new FriendRecord(phoneNumber, name, new Point(request.longitude, request.latitude)) mongoTemplate.save(fr) } case class FriendRecord(id : String, name : String, location : Point) @crichardson
  • 45. Using Spring Data: finding nearby friends @Component class MongoFriendService extends FriendService { override def findNearbyFriends(request: NearbyFriendsRequest) = { val location = new Point(request.longitude, request.latitude) val distance = new Distance(3, Metrics.MILES) val query = NearQuery.near(location).maxDistance(distance) val result = mongoTemplate.geoNear(query, classOf[FriendRecord]) val nearby = result.getContent.map(_.getContent) FindNearbyFriendsResponse(nearby.map(f => FriendInfo(f.name, f.id))) } @crichardson
  • 46. MongoDB and Cloud Foundry $ vmc create-service mongodb vme-mongo @crichardson
  • 47. Binding a service to an application $ vmc push vme-user --path web/target/ Application Deployed URL [cer-spring.cloudfoundry.com]: Detected a Java SpringSource Spring Application, is this correct? [Yn]: Memory Reservation (64M, 128M, 256M, 512M, 1G) [512M]: Creating Application: OK Would you like to bind anyany services to 'vme-user'? [yN]: y Would you like to bind services to 'vme-user'? [yN]: y Would you like to use an an existing provisioned [yN]: y Would you like to use existing provisioned service? service? [yN]: y The The following provisioned services are available following provisioned services are available 1: vme-mongo 1: vme-mongo 2: mysql-135e0 2: mysql-135e0 Please select one you wish to use: use: 1 Please select one you wish to 1 Binding Service [vme-mongo]: OK OK Binding Service [vme-mongo]: Uploading Application: Checking for available resources: OK Processing resources: OK Packing application: OK Uploading (12K): OK Push Status: OK @crichardson
  • 48. Connecting to MongoDB <bean id="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate"> <constructor-arg ref="mongoFactory" /> </bean> Outside of Cloud Foundry <beans profile="default"> <mongo:db-factory id="mongoFactory" dbname="surveygeo" /> </beans> Inside Cloud Foundry <beans profile="cloud"> <cloud:mongo-db-factory id="mongoFactory" /> </beans> @crichardson
  • 49. Implementing the restaurant database trait RestaurantService { def findNearbyRestaurants(location: Location) : FindNearbyRestaurantResponse } @crichardson
  • 50. Using Factual • Geographic database as a Service • Including 1.2M restaurants in the US • Pricing: 10K calls day free, pay per use @crichardson
  • 51. Factual API • RESTful/JSON interface • Uses 2-legged OAuth 1.0. • Geo and text filters • Pagination • Libraries for various languages @crichardson
  • 52. Restaurant Service @Service class FactualRestaurantService extends RestaurantService { @Value("${factual_consumer_key}") var consumerKey: String = _ @Value("${factual_consumer_secret}") var consumerSecret: String = _ var factual: Factual = _ @PostConstruct 5 restaurants within 1km def initialize { factual = new Factual(consumerKey, consumerSecret, true) } override def findNearbyRestaurants(location: Location) = { ... val restaurants = factual.get.fetch("restaurants-us", new Query().within(new Circle(location.lat, location.lon, 1000)).limit(5)) val rs = restaurants.getData.map { map => RestaurantInfo(map.get("name").asInstanceOf[String]) } FindNearbyRestaurantResponse(rs.toList) } ... @crichardson
  • 53. Agenda • Why use cloud services? • Developing location-based applications • Building SMS and telephony enabled applications • Developing robust, fault tolerant applications @crichardson
  • 54. The telephony and SMS are important 7/ waking hr ! http://blog.nielsen.com/nielsenwire/online_mobile/new-mobile-obsession- Nielsen u-s-teens-triple-data-usage/ @crichardson
  • 55. Reporting traffic light problems in London @crichardson
  • 57. VoteMeetEat.com & Telephony • Handling registration SMS • Sending SMS notifying users to vote • Handling incoming voice call from voters: • Text-to-speech of restaurants options • Collecting digits entered via keypad • Sending SMS/Voice notifications of voting results @crichardson
  • 58. DIY telephony = Difficult aS: y-a hon • Difficult to setup and operate Telep • Expensive e S MS/ to us ter • Complex SMS protocols Bet •… @crichardson
  • 59. Telephony/SMS - aaS • SMS • SMS • Inbound and outgoing calls • Inbound and outgoing calls • Recording and transcription • Recording and transcription • Twitter • IM @crichardson
  • 60. Twilio - Telephony and SMS as a service • REST API • Allocate phone numbers • Make and receive phone calls • Send and receive SMS messages • Pay per use: • Phone calls - per-minute • SMS – per SMS sent or received • Phone number – per month • Examples • OpenVBX is a web-based, open source phone system • StubHub – notifies sellers of a pending sale via phone • SurveyMonkey – interactive polling • Salesforce – SMS-based voting for 19,000 conference attendees @crichardson
  • 61. Using Twilio Manage resources Send SMS Initiate voice calls REST API Voice SMS Your Twilio HTTP GET/ Application POST TwiML doc Phone number Handle incoming SMS and voice calls SMS URL + VOICE URL Respond to user input @crichardson
  • 62. Handling SMS registration User texts ‘register’ System 5 replies 551212 @crichardson
  • 63. Handling SMS registration HTTP POST http://≪smsUrl≫?From=≪PhoneNumber≫ SMS SMS Twilio REGISTRATION <Response> <Sms>To complete registration please go to http://... </Sms> </Response> @crichardson
  • 64. Handling SMS registration TwiML document describing the response @crichardson
  • 65. Inviting users to vote System sends text 5551212 @crichardson
  • 66. Inviting users to vote POST /2010-04-01/Accounts/≪AccountSID≫/SMS/Messages From=+15105551212 &To=+14155551212 &Body=≪MESSAGE≫ Authorization: Basic .... Basic auth using Twilio AccountSid+AuthToken @crichardson
  • 67. Sending SMS using the Spring RestTemplate @Component class TwilioService { def sendSms(recipient : String, message : String) = { val response = postToTwilio("SMS/Messages", Map("From" -> twilioPhoneNumber, "To" -> recipient, "Body" -> message)) (response "SMSMessage" "Sid").text } @crichardson
  • 68. Sending SMS using the Spring @Component RestTemplate class TwilioService { TODO def postToTwilio(resourcePath : String, requestParams : Map[String, String]) = { val entity = makeEntity(requestParams) try { val response = restTemplate.postForObject(twilioUrl + "/Accounts/{accountSid}/{resource}", entity, classOf[String], accountSid, resourcePath) XML.loadString(response) } catch { case e : HttpClientErrorException if e.getStatusCode == HttpStatus.BAD_REQUEST => val body = e.getResponseBodyAsString() val xmlBody = XML.loadString(body) val code = Integer.parseInt((xmlBody "Code").text) val message = (xmlBody "Message").text throw new TwilioRestException(message, code) } } @crichardson
  • 69. Voting: user calls number 555 1212 @crichardson
  • 70. Voting HTTP POST http://≪voiceUrl≫?From=≪PhoneNumber≫ Survey Management Call <Response> Twilio <Say> Chris would like to meet and eat. </Say> <Gather action="handleresponse.html" method="POST" numDigits="1"> <Say>Press 1 for ....</Say> <Say>Press 2 for ....</Say> </Gather> </Response> @crichardson
  • 71. Voting HTTP POST http://....handleresponse.html? From=≪PhoneNumber≫&Digits=≪...≫ Survey Management Digits <Response> Twilio <Say>Thank you for choosing. The most popular place so far is ... </Say> <Pause/> <Say>You will hear from us soon. Good bye</Say> <Hangup/> </Response> @crichardson
  • 72. Voting code 1 @Controller class TwilioController { @Autowired var surveyManagementService: SurveyManagementService = _ @RequestMapping(value = Array("/begincall.html")) @ResponseBody def beginCall(@RequestParam("From") callerId: String) = { surveyManagementService.findSurveyByCallerId(callerId) match { case None => <Response> <Say>Sorry don't recognize your number</Say> <Hangup/> </Response> case Some(survey) => <Response> <Say>{ survey.prompt }</Say> <Gather action="handleresponse.html" method="POST" numDigits="1"> { for ((choice, index) <- survey.choices zipWithIndex) yield <Say>Press { index } for { choice }</Say> } </Gather> <Say>We are sorry you could not decide</Say> <Hangup/> </Response> } @crichardson }
  • 73. Voting code 2 class TwilioController { ... @RequestMapping(value = Array("/handleresponse.html")) @ResponseBody def handleUserResponse(@RequestParam("From") callerId: String, @RequestParam("Digits") digits: Int) = { val survey = surveyManagementService.recordVote(callerId, digits) <Response> <Say>Thank you for choosing. The most popular place so far is { survey.map(_.mostPopularChoice) getOrElse "oops" } </Say> <Pause/> <Say>You will hear from us soon. Good bye</Say> <Hangup/> </Response> } } @crichardson
  • 74. Agenda • Why use cloud services? • Developing location-based applications • Building SMS and telephony enabled applications • Developing robust, fault tolerant applications @crichardson
  • 75. The need for parallelism Service B b = serviceB() Call in parallel c = serviceC() Service A Service C d = serviceD(b, c) Service D @crichardson
  • 76. Futures are a great concurrency abstraction • Object that will contain the result of a concurrent computation - http://en.wikipedia.org/wiki/Futures_and_promises • Various implementations Future<Integer> result = executorService.submit(new Callable<Integer>() {... }); • Java 7 Futures = ok • Guava ListenableFutures = better • Scala’s composable Futures = really good • Java 8 CompletableFuture = great @crichardson
  • 77. Using futures to parallelize requests trait FriendService { def findNearbyFriends(request : NearbyFriendsRequest) : Future[FindNearbyFriendsResponse] } trait RestaurantService { Client def findNearbyRestaurants(location: Location) : Side Future[FindNearbyRestaurantResponse] Proxies } val f1 = friendsService.findNearbyFriends(NearbyFriendsRequest.fromLocation(vmeRecord.location)) val f2 = restaurantService.findNearbyRestaurants(vmeRecord.location) val nearbyFriends = f1.get(2, TimeUnit.SECONDS) val nearbyRestaurants = f2.get(2, TimeUnit.SECONDS) Two calls execute concurrently @crichardson
  • 78. Using external web services = Distributed system Twilio MongoDB Mobile Phone VoteMeetEat Factual.Com @crichardson
  • 79. Internally = Distributed System Survey management User management Registration SMS Rabbit MQ Registration web app VME management VME web app @crichardson
  • 80. Handling failure Service A Service B Errors happen in distributed systems @crichardson
  • 81. About Netflix > 1B API calls/day 1 API call average 6 service calls Fault tolerance is essential http://techblog.netflix.com/2012/02/fault-tolerance-in-high-volume.html @crichardson
  • 82. Use network timeouts and retries Never wait forever Network errors can be transient retry http://techblog.netflix.com/2012/02/fault-tolerance-in-high-volume.html @crichardson
  • 83. Use per-dependency bounded thread pool Service A Runnable 1 Task 1 Runnable 2 Task 2 Service B Runnable ... Task ... bounded queue bounded thread pool Fails fast if Limits number of service is slow or down outstanding requests http://techblog.netflix.com/2012/02/fault-tolerance-in-high-volume.html @crichardson
  • 84. Use a circuit breaker High error rate stop calling temporarily Down wait for it to come back up Slow gives it a chance to recover Closed errors Open timeout success Half fail open http://techblog.netflix.com/2012/02/fault-tolerance-in-high-volume.html @crichardson
  • 85. On failure Return cached data Avoid Failing Return default data Fail fast http://techblog.netflix.com/2012/02/fault-tolerance-in-high-volume.html @crichardson
  • 86. About Netflix Hystrix • Open-source library from Netflix • Implements class MyCommand extends HystrixCommand[ResultType](...) • Circuit Breaker pattern override def run() = { ... Invoke remote service ... • Bounded thread-pool } } • Fallback logic val future = new MyCommand().queue() ... • ... • https://github.com/Netflix/Hystrix @crichardson
  • 87. Using Hystrix @Service class FactualRestaurantService extends RestaurantService { @Autowired @Qualifier("factualHystrixConfig") var factualHystrixConfig: HystrixCommand.Setter = _ override def findNearbyRestaurants(location: Location) = { class FindRestaurantsCommand extends HystrixCommand[FindNearbyRestaurantResponse] (factualHystrixConfig .andCommandKey(HystrixCommandKey.Factory.asKey("FindRestaurantsCommand"))) { override def run() = { val restaurants = factual.fetch("restaurants", new Query().within(new Circle(location.lat, location.lon, 1000)).limit(5)) val rs = for (map <- restaurants.getData) yield { RestaurantInfo(map.get("name").asInstanceOf[String]) } FindNearbyRestaurantResponse(rs.toList) } } new FindRestaurantsCommand().queue() } } @crichardson
  • 88. Summary Cloud services are highly scalable services developed and operated by a 3rd party Let’s you focus on your core business problem Risk: provider is acquired and stops offering service Developing an application that reliably consumes cloud services requires careful design @crichardson
  • 89. @crichardson chris.richardson@springsource.com http://plainoldobjects.com - code and slides Questions? Sign up for CloudFoundry.com @crichardson