<commit_before>---
layout: research
title: Status of the Cloud
---

Building Distributed applications:

## Building a large scale datacenter management application

This project largely described as datacenter automation dealt with coordinating with different business sides of a data center company. It incorporated all those data sources to provide a comprehensive online datacenter management solution. The data for such a large scale application came from different sources - inventory management, ip address allocation, billing. All this needed to work in different countries and report needs to be generated across regions.

Practical solutions built were hard to scale across regions. End result being multiple applications were built specific for each purpose. These applications were then orchestrated with a thin layer workflow coordination system to allow flow of data for adding servers as well as generating reports across them.


_Key learning: Large data stores that scale and replicate across ocean boundaries have latency as well as performance issues. Choose to build geography limited applications. Provide only an aggregated or summary view at the cross geography level._

## Building a voter campaigning system

For the US bi-annual elections we built a sharded large scale application system. This system allowed campaigners all across the country to pick voters, mark them for campaigning and update the system synchronously.This database consisted for a centrally located but sharded and replicated data store which served users' app across the country. Consistency was maintained using database api level checks to ensure multiple users do not campaign to the same voter.

_Key learning: Making data replicate for high availability, for high peak load requires that you build resilient hardware. In this case all of the data was moved from disk to a large (256GB) RAM cache to ensure no thrashing at high peak loads._

## Converting a monolithic app to a large scale distributed application

Distributing a large user application to scale on the cloud is a tricky endeavour. A big distributed application demands resilience from distributed system issues like - network partitioning, geographic disasters, power availability as well as being able to serve traffic at all times. Given the distributed nature of users it demands that the application be able to serve users across the world - with low or minimal latency.

We need to split this architecture from being a monolith and divide it into parts that can be managed and scaled - depending on their purpose. Divide these into services that can be thrown on the cloud and connected together. These services need to function independently as well as together. These services each have their own ways of being built and deployed.

_Key learning: Scaling applications does not necessarily need the applications to be distributed. Other mechanisms like data resilience, zone replication, Content Delivery Networks, Elastic Cache, User customized cache are all valid and great solutions before distributing application load._


## Building for the Cloud

Cloud can be partitioned at any time - due to various reasons. Electrical, Weather, Network, Local network, T1 Network, Acts of God.
Cloud applications though need to be designed so they are available, consistent as well as partition resistent.

Cloud would like to be consistent at all times - but that is a wish. Cloud architectures usually provide very high availability and Partition Resistance while compromising on the level of Consistency. The user built applications need to ensure that they provide a consistent experience to the end-users.

Another problem is people need to update applications all the time.

I will detail some learnings around

* What to cloud services do to support high availability?

  * Benefits of virtualization:
    * Computer is a resource
    * Bringing one up is a matter of time and is very reproducible
    * Running large scale programs means divide and conquer - map/reduce
    * Running large scale data - streaming mechanisms and finding local optimas for your optimization/analysis problems

  * Ensuring availability :<commit_msg>more status cloud<commit_after>---
layout: research
title: Status of the Cloud
---

# Building Distributed applications

I have been building large scale distributed applications since the last few years and would like to illustrate a few examples and learnings.

## Building a large scale datacenter management application

This project largely described as datacenter automation dealt with coordinating with different business sides of a data center company. It incorporated all those data sources to provide a comprehensive online datacenter management solution. The data for such a large scale application came from different sources - inventory management, ip address allocation, billing. All this needed to work in different countries and report needs to be generated across regions.

Practical solutions built were hard to scale across regions. End result being multiple applications were built specific for each purpose. These applications were then orchestrated with a thin layer workflow coordination system to allow flow of data for adding servers as well as generating reports across them.


_Key learning: Large data stores that scale and replicate across ocean boundaries have latency as well as performance issues. Choose to build geography limited applications. Provide only an aggregated or summary view at the cross geography level._

## Building a voter campaigning system

For the US bi-annual elections we built a sharded large scale application system. This system allowed campaigners all across the country to pick voters, mark them for campaigning and update the system synchronously.This database consisted for a centrally located but sharded and replicated data store which served users' app across the country. Consistency was maintained using database api level checks to ensure multiple users do not campaign to the same voter.

_Key learning: Making data replicate for high availability, for high peak load requires that you build resilient hardware. In this case all of the data was moved from disk to a large (256GB) RAM cache to ensure no thrashing at high peak loads._

## Converting a monolithic app to a large scale distributed application

Distributing a large user application to scale on the cloud is a tricky endeavour. A big distributed application demands resilience from distributed system issues like - network partitioning, geographic disasters, power availability as well as being able to serve traffic at all times. Given the distributed nature of users it demands that the application be able to serve users across the world - with low or minimal latency.

We need to split this architecture from being a monolith and divide it into parts that can be managed and scaled - depending on their purpose. Divide these into services that can be thrown on the cloud and connected together. These services need to function independently as well as together. These services each have their own ways of being built and deployed.

_Key learning: Scaling applications does not necessarily need the applications to be distributed. Other mechanisms like data resilience, zone replication, Content Delivery Networks, Elastic Cache, User customized cache are all valid and great solutions before distributing application load._


## Building for the Cloud

Cloud can be partitioned at any time - due to various reasons. Electrical, Weather, Network, Local network, T1 Network, Acts of God.
Cloud applications though need to be designed so they are available, consistent as well as partition resistent.

Cloud would like to be consistent at all times - but that is a wish. Cloud architectures usually provide very high availability and Partition Resistance while compromising on the level of Consistency. The user built applications need to ensure that they provide a consistent experience to the end-users.

Another problem is people need to update applications all the time.

* How does a cloud service ensure high availability?
Data centers use high level of virtualization to provision compute instances and provide high availability. Virtualization allows the data centers to provide an abstraction of hardware thus allowing them to replace and fix broken hardware from time to time. Since Virtual Machines(VMs) can be provisioned for different operating systems a lot of downtime can be saved by pre-provisioning and hot swapping them even in case of hardware failures.

  * Benefits of virtualization:
    * Computer is a resource
    * Bringing one up is a matter of time and is very reproducible
    * Running large scale programs means divide and conquer - map/reduce
    * Running large scale data - streaming mechanisms and finding local optimas for your optimization/analysis problems

  * Ensuring availability :
{'fraction_non_alphanumeric': 0.022202387593439697, 'fraction_numerical': 0.0008925582952136561, 'mean_word_length': 4.742472773862908, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6915980', 'n_tokens_mistral': 1858, 'n_tokens_neox': 1729, 'n_words': 1330}