{"id":269170,"date":"2023-10-19T13:16:21","date_gmt":"2023-10-19T18:16:21","guid":{"rendered":"https:\/\/www.webscale.com\/?p=269170"},"modified":"2023-12-29T15:30:50","modified_gmt":"2023-12-29T20:30:50","slug":"redefining-distributed-applications-with-cloudflow-dynamic-endpoint-automation-cloud-cost-control-and-operational-simplicity","status":"publish","type":"post","link":"https:\/\/www.webscale.com\/blog\/redefining-distributed-applications-with-cloudflow-dynamic-endpoint-automation-cloud-cost-control-and-operational-simplicity\/","title":{"rendered":"Redefining Distributed Applications with CloudFlow: Dynamic Endpoint Automation, Cloud Cost Control, and Operational Simplicity"},"content":{"rendered":"

\u201cOptimization happens constantly, automatically, and transparently to the operations teams and the end users.\u201d<\/span><\/i><\/p>\n

Traditionally we have hosted applications in centralized locations. (Cloud hosting being the more recent incarnation of that hosting structure). Some of us have run \u201chub and spoke\u201d models with the spokes fostered by legacy CDNs. This model means we have \u201calways on\u201d centralized hosting for the whole application and only some parts of the applications running in distributed locations on CDNs. Ultimately, we have been limited to run on a distributed footprint only those parts of an application that have not resulted in overly burdensome operational overheads for our Development and Ops teams to deploy and manage.<\/span><\/p>\n

Why Not Decentralize the Whole App?<\/b><\/h3>\n

What if we can move to a decentralized hosting model rather than the hub and spoke of cloud + CDN?<\/b><\/p>\n

What are the implications for;<\/span><\/p>\n

    \n
  1. The end-user experience of the application<\/span><\/li>\n
  2. Application deployment and operations overhead<\/span><\/li>\n
  3. The cost of hosting<\/span><\/li>\n<\/ol>\n

    We would expect application distribution to result in one major positive and two serious negatives;<\/span><\/p>\n

      \n
    1. Better performance experience for end users<\/span><\/li>\n
    2. Significantly more complex Operations<\/span>\n
        \n
      1. How can you deploy the application to many locations<\/span><\/li>\n
      2. How can you choose and manage many locations<\/span><\/li>\n<\/ol>\n<\/li>\n
      3. The cost of hosting to increase significantly<\/span>\n
          \n
        1. Your application would be always running in every distributed location all the time.<\/span><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n

          Conducting a CloudFlow Case Study<\/b><\/h2>\n

          The following study was conducted to analyze these three aspects when running a distributed microservice application on the CloudFlow platform.<\/span><\/p>\n

          TL;DR<\/b><\/h3>\n

          With CloudFlow, application distribution means;<\/span><\/p>\n

            \n
          1. Significantly better user experience for end users everywhere<\/span><\/li>\n
          2. No change to operations flows – it feels like working with a centralized application<\/span><\/li>\n
          3. Cost Optimization – AI\/ML driven automation to run only where and when users need the application<\/span><\/li>\n<\/ol>\n

            Deploying a Microservices Application<\/b><\/h3>\n

            We deployed a microservices application consisting of an Nginx Server and a Fluent D data collector sending logs from the application to an external logging repository (<\/span>in this case we followed CloudFlow’s New Relic integration steps<\/span><\/a>). Both of these were deployed in Docker containers.<\/span><\/p>\n

            For K8s folks: When deployed to CloudFlow, they appear in the K8s dashboard Webscale provides as follows:<\/b><\/p>\n

            \"\"<\/p>\n

            The experience of deploying an application to CloudFlow is exactly as though deploying to a single cloud location (or for K8s users, like deploying to a single K8s cluster).<\/span><\/p>\n

              \n
            1. There is no operational burden to deploy to CloudFlow\u2019s multi-location global platform.<\/span><\/li>\n
            2. Use existing workflows including Kubernetes workflows<\/span><\/li>\n
            3. The development teams and dev environment can stay exactly the same.<\/span><\/li>\n
            4. The operations team can continue to collect and analyze logs from existing centralized locations<\/span><\/li>\n<\/ol>\n

              Webscale\u2019s platform automatically took care of providing the following in the few minutes of set up;<\/span><\/p>\n

                \n
              1. A URL – <\/span>https:\/\/weathered-sun-8105.section.app\/<\/span>\u00a0<\/span><\/li>\n
              2. DNS set up<\/span><\/li>\n
              3. SSL certs for the domain (<\/span>Let\u2019s Encrypt<\/span><\/a>)<\/span><\/li>\n
              4. DDoS Protection<\/span><\/li>\n<\/ol>\n

                Traffic and Measurement<\/b><\/h3>\n

                We used New Relic\u2019s synthetic monitoring to generate traffic from all parts of the world and to measure the performance of the application for users in those parts of the world.<\/span><\/p>\n

                We set up three traffic groups firing both ping and full-page tests every minute.<\/span><\/p>\n

                  \n
                1. North America – on the top row of our dashboard<\/span><\/li>\n
                2. Europe – middle row<\/span><\/li>\n
                3. Asia and ROW – bottom row<\/span><\/li>\n<\/ol>\n

                  Here is the traffic monitoring dashboard:<\/b><\/p>\n

                  \"\"<\/p>\n

                  Testing the Application Centrally Deployed<\/b><\/h3>\n

                  The status quo for deploying an application would be to choose a hosting location based on an arbitrary or best guess as to where the ideal hosting location may be for your end users. Say, for example, you choose either the West or East of the USA for your application as a Cloud hosting location.<\/span><\/p>\n

                  To test the status quo we used a static location selection policy to deploy the microservices application to just one US East location. In this case, New York.<\/span><\/p>\n

                  \"\"<\/p>\n

                  Transparently to Ops teams and end users, in just a few minutes, CloudFlow takes care of;<\/span><\/p>\n

                    \n
                  1. Resetting networking (DNS, Anycast) to route traffic to this location<\/span><\/li>\n
                  2. Deploying the Nginx container in this location and starts serving traffic from it when ready<\/span><\/li>\n
                  3. Deploying the Fluent D container in this location (which starts sending logs to New Relic when ready)<\/span><\/li>\n<\/ol>\n

                    At this point we can see from the following North American centric view that Washington, Columbus, and Montreal all perform reasonably well but the <\/span>Western locations are having a sub-par experience.<\/i><\/b><\/p>\n

                    This is what you would expect from a simple, single location application deployment strategy. All locations not in the locale of the chosen hosting center must suffer.<\/b><\/p>\n

                    \"\"<\/p>\n

                    Distributing the Application to Chosen Locations<\/b><\/h3>\n

                    What if we can deploy the application closer to those users in the Western parts of the USA?<\/b><\/p>\n

                    By making a few simple tweaks to the platform\u2019s location selector, we can ask CloudFlow to deploy this microservice application to six specific locations across North America.<\/span><\/p>\n

                    Note that at this point we have CloudFlow\u2019s Automatic Optimization turned off and we are making a \u201cStatic\u201d or always-on policy selection whereby we are choosing the locations in which the application will be always deployed.<\/b><\/p>\n

                    \"\"<\/p>\n

                    This resulted in the deployment pattern as follows in about 10 minutes:<\/span><\/p>\n

                    \"\"<\/p>\n

                    Again, without any operations activity, other than selecting the locations,<\/span><\/p>\n

                      \n
                    1. CloudFlow sets the networking (DNS, Anycast, SSL Management, DDoS Scrubbing, etc) to route traffic to all these locations and sends traffic to the best available location automatically<\/span><\/li>\n
                    2. The Nginx container is deployed to all these locations and each starts serving traffic<\/span><\/li>\n
                    3. The Fluent D container is deployed to all these locations and each starts sending logs to the central collation point – ie New Relic<\/span><\/li>\n<\/ol>\n

                      Immediately we see a performance improvement for users in the Western parts of North America in the order of 5 to 6 times better!<\/b><\/p>\n

                      \"\"<\/p>\n

                      However, we can also see that the European users and those in Asia\/ ROW are still experiencing a sub-standard experience. (we did see a moderate improvement in user experience in Asia thanks to the closer proximity of US West locations)<\/span><\/p>\n

                      \"\"<\/p>\n

                      Distributing the Application Using CloudFlow\u2019s AI\/ML automation<\/b><\/h3>\n

                      So what if we let CloudFlow\u2019s Adaptive Edge Engine (AEE) take control of the application placement and simply deploy the application to the best locations for the application at any point in time?<\/b><\/p>\n

                      By turning on Automatic optimization in the CloudFlow Console, the application will be placed into endpoints across the world to optimize for latency.<\/span><\/p>\n

                      \"\"<\/p>\n

                      With all locations across the globe generating traffic at this time, the CloudFlow\u2019s AEE reconfigured the deployment footprint of this application in 10 minutes to run in the following locations:<\/span><\/p>\n

                      \"\"<\/p>\n

                      And as we expect, user experience all over the globe is significantly improved.<\/b><\/p>\n

                      \"\"<\/p>\n

                      Of note, the AEE decided that to find the optimal balance between locations utilized (i.e. cost) and performance, fewer locations in North America were needed than the 6 we manually selected. It chose Seattle and Los Angeles for the Western locations. We can also see a short slight increase in request time while the new Western North American locations were brought into service and the others removed.<\/span><\/p>\n

                      Importantly, no requests were dropped by the distributed hosting footprint during this automated adaptation of the network footprint.<\/b><\/p>\n

                      Distributing the Application Dynamically<\/b><\/h3>\n

                      So we know that in the real world, traffic ebbs and flows throughout any 24-hour period and indeed week to week or month to month. Why should we keep all these global locations operating at all times? What happens if traffic dissipates from some locations? Say, it\u2019s late at night in North America.<\/span><\/p>\n

                      Real Internet application traffic is not stagnant so our hosting resources should not be stagnant<\/b><\/p>\n

                      The Automatic Optimization of CloudFlow\u2019s AEE is constantly refining placement decisions based on a myriad of ingested data feeds. The AEE will detect a traffic change and then, in minutes, re-optimize the footprint for performance.<\/span><\/p>\n

                      To test this we turned off all the monitors emanating from North America. In response, the AEE then decided the following locations make sense in the absence of traffic from North America.<\/span><\/p>\n

                      \"\"<\/p>\n

                      The Adaptive Enge Engine again reshaped the delivery network by withdrawing unneeded locations. All without dropping any requests from any location.<\/b><\/p>\n

                      The following shows the traffic performance from each location in the absence of any traffic from North America.<\/span><\/p>\n

                      \"\"<\/p>\n

                      Let\u2019s check if the CloudFlow can detect an increase in traffic from any location and how the Adaptive Edge Engine responds in order to continuously adapt and deliver optimal placement for user experience.<\/b><\/p>\n

                      Let\u2019s say the traffic increases from North America and at the same time, traffic from Europe dissipates.<\/span><\/p>\n

                      In 10 minutes, the AEE shifts the application around, bringing it up in North America and removing the unneeded locations in Europe. Again, of note, no requests are dropped through the period. The AEE routes North American requests to the next best location while the application is in the 10-minute deploy period to the North American PoPs.<\/span><\/p>\n

                      During the deploy period;<\/span><\/p>\n

                      \"\"<\/p>\n

                      Post Deploy period:<\/span><\/p>\n

                      \"\"<\/p>\n

                      As the traffic from North America is detected, it is immediately routed to the next best location until the North American locations are available. When the AEE detects those locations are up and ready to receive traffic, the AEE starts sending traffic there and then user experience in North America is again optimal. <\/span>All this happens constantly, automatically, and transparently to the operations teams and the end users.<\/i><\/b><\/p>\n

                      \"\"<\/p>\n

                      Cost Optimization<\/b><\/h3>\n

                      This adaptive, \u201crun only where you need to\u201d behavior allows for cost as well as user experience optimization. We do not need to run the application in every location at all times as would otherwise be the case in the absence of the Auto Optimization capabilities of CloudFlow\u2019s Adaptive Edge Engine.<\/span><\/p>\n

                      What have Ops been Doing?<\/b><\/p>\n

                      It is worth noting for each of the distribution methods discussed above, there has been no change to the core development or operational practices for the application.<\/b><\/p>\n

                      Logs continue to stream to a central location, the team can SSH into any delivery box at any time and the Dev team can continue to develop the application in the same way they always have.<\/span><\/p>\n