Saturday, November 28, 2009

What If Hosting Was a Library?

# Was thinking, "if hosting was a library, what might it look like..."

require 'ProviderX'

# We'll pretend we already have an account with fictitious ProviderX

host = => 'foo', :password => 'secret')

# Let's see what ProviderX will allow us to deploy to

> ['Amazon', 'Google']

# Let's create a new environment to deploy to

production = => 'Amazon', :name => 'production', :min_cpu => 2, :min_mem => 1024)

# We also would need to define the application that we wish to deploy

application = => '', :type => 'Rails', :name => 'foo', :domain => '', :ssl_enabled => true)

# All set! Let's deploy.

application.deploy_to production

> true

> ['production']

> ['foo']

# Maybe we forgot that we want to redirect to

application.redirects.add :from => '', :to => ''

# We don't want to deploy the code again, we just want to sync configuration changes (the redirect).

application.sync_configs production

# Perhaps we could control our resources from within our application

if production.swapping?
  production.ram.add 128

# That's it for my day-dreaming.


  1. The vendors should just conform to the host interface. Less typing, more explicit.

    production = blah)

    Honestly, I've learned to live without stuff like Capistrano though and realized my life is simpler for it. Shell scripts FTW. :-)

  2. IMO there should be an application system requirements protocol and a language which supports declarative programming as a first class citizen like Ruby should be able to describe the system requirements of the application down to every detail and be transaction focused. This way we can describe the performance for each transaction within the application and also the resource consumption of the application and have the cloud host digest these requirements and use their intelligent systems to spawn a system to support the application requirements. Then of course learn the behavior of the application over time and autotune that shit.