rahul singh [email protected]

23
Rahul Singh [email protected] Build & Deploy Infrastructure for Startups

Upload: kipling

Post on 25-Feb-2016

63 views

Category:

Documents


1 download

DESCRIPTION

Build & Deploy Infrastructure for Startups. Rahul Singh [email protected]. Conventional Wisdom. Repeatable Business Model Product Market Fit Customer Development Lean Startup / MVP Build a Prototype Do things that don’t scale. Conventional Wisdom is Correct. They’re all correct - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Rahul Singh rsingh@distelli.com

Rahul [email protected]

Build & Deploy Infrastructure for Startups

Page 2: Rahul Singh rsingh@distelli.com

Conventional Wisdom

• Repeatable Business Model• Product Market Fit• Customer Development• Lean Startup / MVP• Build a Prototype• Do things that don’t scale

Page 3: Rahul Singh rsingh@distelli.com

Conventional Wisdom is Correct

• They’re all correct• Focus on building a product that someone will

pay for• Most startups fail• Avoid Failure

• What happens if you succeed?

Page 4: Rahul Singh rsingh@distelli.com

Mt Gox

• First major bitcoin exchange• Started out as Trading cards• Millions of Customers• Millions in Revenue

• Lost $22 Million• Lost $400 Million• Mt Gox is Dead!!

Page 5: Rahul Singh rsingh@distelli.com

Mt Gox

• Software wasn’t built for Financial Transactions• Growth outpaced Technical Debt

• Another Example: Twitter

• Question: If things go well, will you be able to keep up?• Question: If things don’t go well will you be able to keep

up?

Page 6: Rahul Singh rsingh@distelli.com

Rate of Innovation

• Tech startups must innovate• Tech startups must iterate

• Lean Startup = MVP• Product Market Fit = Iterate fast

• Your success is tied to how fast you can innovate and iterate on your product

Page 7: Rahul Singh rsingh@distelli.com

Technical DebtWikipedia:

Technical debt is a neologistic metaphor referring to the eventual consequences of poor software architecture and software development within a codebase.

The debt can be thought of as work that needs to be done before a particular job can be considered complete.

If the debt is not repaid, then it will keep on accumulating interest, making it hard to implement changes later on.

Unaddressed technical debt increases software entropy.

Page 8: Rahul Singh rsingh@distelli.com

Technical Debt

• Reduces rate of innovation• Reduces rate of iteration

• How fast can you respond to Issues?• How fast can you add new features?

• Focus on Product Market Fit but avoid technical debt from day one!

Page 9: Rahul Singh rsingh@distelli.com

Do it Right the First Time

• Do it right the first time• Modular code• Good build systems• Auditability• Accountability• Good Deployment System

Page 10: Rahul Singh rsingh@distelli.com

Don’t Reinvent the Wheel

• Reuse well known platform• Leverage open source• Use well known patterns• Avoid doing anything special• Let others handle the muck• Buy vs Build

Page 11: Rahul Singh rsingh@distelli.com

Source Control

• Use Source Control• Git• Mercurial• No reason to use SVN today

• Hosted Source control: – GitHub: Popular– Bitbucket: Cheaper

• Don’t host your own source control server

Page 12: Rahul Singh rsingh@distelli.com

Lots of Repositories

• Break code into modules• One Source Repository per Module• To work on a module:– git clone github.com/distelli/MyModule.git– make code changes– git commit– Rebuild all downstream dependencies

Page 13: Rahul Singh rsingh@distelli.com

Dependencies

• Common Pattern: – All code is in a single directory– No dependencies– Check out the world– Every change needs to rebuild the world

• Module Dependencies– Java: Maven– Python: Pip– Ruby: Gems– NodeJS: NPM

Page 14: Rahul Singh rsingh@distelli.com

Version each Module

• Use Module Versions– Each module has a well defined name– Each module has a well defined version– Examples: • Java: HttpClient-1.4• Ruby: Nokogiri-1.1• Python: Requests-1.0

Page 15: Rahul Singh rsingh@distelli.com

Build System

• Let the build system track dependencies• Always know what all the dependencies are

for each application– Java: Maven Pom.xml– Python: Distutils / Setuptools / Distribute– Ruby: Gemfiles

Page 16: Rahul Singh rsingh@distelli.com

Build Artifacts / Releases

• A compiled binary or frozen snapshot of your code with all its dependencies that work together

• Also known as a Release• Build system produces an internally consistent

release• Tag the release in your source control• Use an artifact repository:– Stores tagged releases– Eg: Nexus, Pypi, rubygems.org

Page 17: Rahul Singh rsingh@distelli.com

Deploy Releases

• Build System produces Releases• Releases are deployed to Servers• Deployment System deploys releases• Releases can be Tagged• Deploy to a staging environment• Promote to Production• Always track who deployed what to which server • When did they do it• Rollbacks if things break in production

Page 18: Rahul Singh rsingh@distelli.com

Deployment System

• Most Common:– Home grown scripts– SSH, SCP, RSYNC– Git post receive hooks

• Everyone builds their own deployment scripts• Deployments are hard• Don’t build your own deployment scripts

Page 19: Rahul Singh rsingh@distelli.com

Deploying Code is Hard

• What version of the software is running?• Who deployed it?• When was it deployed?• How many servers are running?• How do we add instances (scale up)?• How do we remove instances (scale down)?• How to we handle server failures?

Page 20: Rahul Singh rsingh@distelli.com

Deploying Code is Hard• How do we push a bugfix to all servers?• How do we rollback to a known good version?• What version of HttpClient is my app using?• What changed in this latest deployment?• Efficiency / Cost - Can we run multiple apps on a

single Server?• Heroku is awesome… but...– Too Expensive– Enterprises don’t want to push code outside the

organization

Page 21: Rahul Singh rsingh@distelli.com

A New Way

• distelli.com is a platform that makes it easy to deploy any application to any server

• Easy & Secure– No SSH access required– No Code changes required– Code doesn’t leave your organization– Audit trails & History– Teams and Collaborative features– Works well with other tools

Page 22: Rahul Singh rsingh@distelli.com

A New Way

• Make deployments a part of the developer workflow – code -> build -> unit-test -> deploy to test stage

• De-couple production deployments from development– Developers produce deployable code– Operations team deploys from test stage to prod

Page 23: Rahul Singh rsingh@distelli.com

Interactive Q & A

• Questions• Example Code

• Talk to me if you need help