Rocking the Enterprise with Rubyruote.s3.amazonaws.com/rocking_the_enterprise_with_ruby.pdf• Ruby...

27
© ThoughtWorks, 2010 Sudhindra Rao Munjal Budhabhatti Rocking the Enterprise with Ruby

Transcript of Rocking the Enterprise with Rubyruote.s3.amazonaws.com/rocking_the_enterprise_with_ruby.pdf• Ruby...

Page 1: Rocking the Enterprise with Rubyruote.s3.amazonaws.com/rocking_the_enterprise_with_ruby.pdf• Ruby – ease of use and refactoring – natural language syntax to support varied applications

© ThoughtWorks, 2010

Sudhindra Rao

Munjal Budhabhatti

Rocking the Enterprise with Ruby

Page 2: Rocking the Enterprise with Rubyruote.s3.amazonaws.com/rocking_the_enterprise_with_ruby.pdf• Ruby – ease of use and refactoring – natural language syntax to support varied applications

© ThoughtWorks, 2010

Ruby in the Enterprise

2

Page 3: Rocking the Enterprise with Rubyruote.s3.amazonaws.com/rocking_the_enterprise_with_ruby.pdf• Ruby – ease of use and refactoring – natural language syntax to support varied applications

© ThoughtWorks, 2010

• Domain• Technology and Delivery• Architecture• Integration with the Enterprise• OSS

Ruby in Enterprise

3

Page 4: Rocking the Enterprise with Rubyruote.s3.amazonaws.com/rocking_the_enterprise_with_ruby.pdf• Ruby – ease of use and refactoring – natural language syntax to support varied applications

© ThoughtWorks, 2010

• Server and network management

• Location and Power management

• Address management• Monitoring and Diagnosis• Customer Support• Back Office Support

Understanding the problem domain

4

Page 5: Rocking the Enterprise with Rubyruote.s3.amazonaws.com/rocking_the_enterprise_with_ruby.pdf• Ruby – ease of use and refactoring – natural language syntax to support varied applications

© ThoughtWorks, 2010

IP Automation

• Limited address space with IPv4• IP Blocks management• ARIN, RIPE compliance• Public, Private IPs• Public, Private Networks• IPv6 support

5

Page 6: Rocking the Enterprise with Rubyruote.s3.amazonaws.com/rocking_the_enterprise_with_ruby.pdf• Ruby – ease of use and refactoring – natural language syntax to support varied applications

© ThoughtWorks, 2010

DNS Automation

• Huge database• Security concerns over routing• Legal implications• Accuracy• Systems support• Always on

6

Page 7: Rocking the Enterprise with Rubyruote.s3.amazonaws.com/rocking_the_enterprise_with_ruby.pdf• Ruby – ease of use and refactoring – natural language syntax to support varied applications

© ThoughtWorks, 2010

• ruby DSL for network devices– data scraping and custom script execution– conditional and for loops– Configure, Diagnose, Status

• Commission new devices• Intelligent command chains• Enhanced logging for debug support

Network Device Manager

7

Page 8: Rocking the Enterprise with Rubyruote.s3.amazonaws.com/rocking_the_enterprise_with_ruby.pdf• Ruby – ease of use and refactoring – natural language syntax to support varied applications

© ThoughtWorks, 2010

Technology

• Ruby – ease of use and refactoring– natural language syntax to support varied applications– allows iterative addition to features– expertise - ThoughtWorks and Rackspace– Rails - naturally built for web applications

• Fast ramp-up for developers• Spike for first small project - achieved goal in 40% cost

8

Page 9: Rocking the Enterprise with Rubyruote.s3.amazonaws.com/rocking_the_enterprise_with_ruby.pdf• Ruby – ease of use and refactoring – natural language syntax to support varied applications

© ThoughtWorks, 2010

• Sep 2006– TW engaged for a 9 week IP Automation Engagement– Project Delivered in 7 Weeks

• 2007– Physical space project

• combination of physical and virtual world

• 2008– Distributed team– Split work streams

• Process, Vision, Architecture, Design– Successful milestone releases

• DNS Manager and IP Automation

Milestones

9

Page 10: Rocking the Enterprise with Rubyruote.s3.amazonaws.com/rocking_the_enterprise_with_ruby.pdf• Ruby – ease of use and refactoring – natural language syntax to support varied applications

© ThoughtWorks, 2010

Milestones

• 2009– Enabling data centers to be efficient

• Location Manager• Power Manager• Network Architect• Network Device Manager

• 2010 AutoHost– Automatic Provisioning– Comprehensive reporting– Integration

10

Page 11: Rocking the Enterprise with Rubyruote.s3.amazonaws.com/rocking_the_enterprise_with_ruby.pdf• Ruby – ease of use and refactoring – natural language syntax to support varied applications

© ThoughtWorks, 2010

Delivering Continuously

• Discipline– Focused user base– Strict control on features– Delivering frequently - 2 weeks– Small testable features– Consistent code coverage

• Feedback– Adapt architecture– RESTful interface

11

Page 12: Rocking the Enterprise with Rubyruote.s3.amazonaws.com/rocking_the_enterprise_with_ruby.pdf• Ruby – ease of use and refactoring – natural language syntax to support varied applications

© ThoughtWorks, 2010

• Remodelling to adapt to usage changes– Physical Space Project

• Combined concepts of Physical and Virtual world• Data collection, usage, and consistency issues

– Redesign• Identify User groups and Patterns• Split the domain

• Changing Domain abstractions• Distributed transactions• Pluginization to reuse functionality

Architecture

12

Page 13: Rocking the Enterprise with Rubyruote.s3.amazonaws.com/rocking_the_enterprise_with_ruby.pdf• Ruby – ease of use and refactoring – natural language syntax to support varied applications

© ThoughtWorks, 2010

• REST Engine • Web based UI - Consumer• Rails templates and

resource_full• Distributed testing• Selenium suite

Design

13

Engine Engine Engine

App App

Consumers

Page 14: Rocking the Enterprise with Rubyruote.s3.amazonaws.com/rocking_the_enterprise_with_ruby.pdf• Ruby – ease of use and refactoring – natural language syntax to support varied applications

© ThoughtWorks, 2010

• Restrict access to domain• System of record• Load once read many times• Collaboration between domain

models• Reduced maintenance

Pluginized Models

App

14

Page 15: Rocking the Enterprise with Rubyruote.s3.amazonaws.com/rocking_the_enterprise_with_ruby.pdf• Ruby – ease of use and refactoring – natural language syntax to support varied applications

© ThoughtWorks, 2010

• Comprehensive reporting• Repurpose with API• Auto provisioning• Workflow engine• Enterprise Message System

Integrating with the Enterprise

Core api - Integration Layer

IP NDM ENV NET DNS

15

Page 16: Rocking the Enterprise with Rubyruote.s3.amazonaws.com/rocking_the_enterprise_with_ruby.pdf• Ruby – ease of use and refactoring – natural language syntax to support varied applications

© ThoughtWorks, 2010

• Ruote - DSL based workflow engine• RESTful services orchestration and Rich abstractions• Example

Workflow Engine

16

IP NDM LOC NET DNS

Ruote Engine

Page 17: Rocking the Enterprise with Rubyruote.s3.amazonaws.com/rocking_the_enterprise_with_ruby.pdf• Ruby – ease of use and refactoring – natural language syntax to support varied applications

© ThoughtWorks, 2010

• RabbitMQ - a highly reliable, available, and scalable EMS• Decoupling when Integrating with external systems• Single Source of Record augmented by Pluginization

Enterprise Message System

17

IP NDM LOC NET DNS

Page 18: Rocking the Enterprise with Rubyruote.s3.amazonaws.com/rocking_the_enterprise_with_ruby.pdf• Ruby – ease of use and refactoring – natural language syntax to support varied applications

© ThoughtWorks, 2010

OpenSource

• resource_full• distributed testing• cc monitor

18

Page 19: Rocking the Enterprise with Rubyruote.s3.amazonaws.com/rocking_the_enterprise_with_ruby.pdf• Ruby – ease of use and refactoring – natural language syntax to support varied applications

© ThoughtWorks, 2010

resource_full

• Fully compliant ActiveResource Built on ActionController• RESTful parameter queryability, paging, etc.• template for making engines REST easy• template for REST consumers• Typical functionality Out of the box• Extend to return different stream types - json, xml

19

Page 20: Rocking the Enterprise with Rubyruote.s3.amazonaws.com/rocking_the_enterprise_with_ruby.pdf• Ruby – ease of use and refactoring – natural language syntax to support varied applications

© ThoughtWorks, 2010

resource_full

20

class UsersController < ResourceFull::Base identified_by :username, :unless => lambda { |id| id =~ /^[0-9]+$/ }

queryable_with :city, :state, :from => :address queryable_with :name, :columns => [:first_name, :last_name] queryable_with :email_address, :fuzzy => true queryable_with :is_active, :scope => :active

orderable_by :city, :from => :address

responds_to :html responds_to :xml, :only => [:read, :update]end

class AddressesController < ResourceFull::Base nests_within :users queryable_with :city, :stateend

Page 21: Rocking the Enterprise with Rubyruote.s3.amazonaws.com/rocking_the_enterprise_with_ruby.pdf• Ruby – ease of use and refactoring – natural language syntax to support varied applications

© ThoughtWorks, 2010

Distributed Testing

21

Consumerapplication

Server start/stop, run tests, collect reports

Service engine

Service engine

Service engine

Page 22: Rocking the Enterprise with Rubyruote.s3.amazonaws.com/rocking_the_enterprise_with_ruby.pdf• Ruby – ease of use and refactoring – natural language syntax to support varied applications

© ThoughtWorks, 2010

• DRb based integration testing• Integrating multiple engines to run a test that spans the

domain• Unit tests/functional tests to ensure quality of each engine• Domain level testing• Functional testing• Transaction testing

Distributed Testing

22

Page 23: Rocking the Enterprise with Rubyruote.s3.amazonaws.com/rocking_the_enterprise_with_ruby.pdf• Ruby – ease of use and refactoring – natural language syntax to support varied applications

© ThoughtWorks, 2010

Distributed Testing

23

#Plugin coderequire rails_root("/vendor/plugins/integration/lib/integration/helper")  include Blackbox::Integration::Helper  start_dependencies( :app1, :engine1, :location_engine )  

#spec across engine and applicationit "should find all data_centers" do     data_center1, data_center2 = engine_drb.setup(<<-DATA, __FILE__, __LINE__)   data_center1, data_center2 = create! :data_center, :quantity => 2      [data_center1, data_center2]    DATA  DataCenter.find(:all).should == [ data_center1, data_center2 ]  end  

Page 24: Rocking the Enterprise with Rubyruote.s3.amazonaws.com/rocking_the_enterprise_with_ruby.pdf• Ruby – ease of use and refactoring – natural language syntax to support varied applications

© ThoughtWorks, 2010

CC Monitor

24

• Simple dashboard for all your builds

• Ramaze application

• Instant Feedback• Cruise, Bamboo,

Hudson

Page 25: Rocking the Enterprise with Rubyruote.s3.amazonaws.com/rocking_the_enterprise_with_ruby.pdf• Ruby – ease of use and refactoring – natural language syntax to support varied applications

© ThoughtWorks, 2010

• Continuous testing and refactoring• Managed Scope and timeline• Communication and Feedback• Ruby – allowed twisting and splitting applications– allowed merging domain concepts via modularization– allowed for simple design - thus making it amenable to change– availability of libraries to support enterprise needs

• Enterprise Ready??

Secrets of Success

25

Page 27: Rocking the Enterprise with Rubyruote.s3.amazonaws.com/rocking_the_enterprise_with_ruby.pdf• Ruby – ease of use and refactoring – natural language syntax to support varied applications

© ThoughtWorks, 2010

Sudhindra Rao

Munjal Budhabhatti

Thanks