Services Inception in Ruby, presented on Friday Sept. 30th @ RubyConf US 2011. Covering Metaprogramming and other options for building and consuming Cloud services from inside of Apps deployed to PaaS clouds.
Download from GitHub @ https://github.com/mccrory/ServicesInception-RubyConf-US-2011
9. Setting the Stage
“The Dream State”
• This is specifically targeted at PaaS
(Platform as a Service)
• All providers have an interface (CLI
or otherwise) to control services in
their platform
14. Dependencies
• Most Apps Have Them...
• I’m not just talking about
• require ‘rubygems’
• Bundler
• etc...
15. I’m talking about
Service Dependencies
• “Assumes Redis”
• “Built for MongoDB”
• “Works with MySQL, other support
coming”
• “Requires/Assumes X Service”
16. YOU need to go setup
that Service...
You need
• Resources
• the bits for the service (the correct version)
• and YOU must configure it
• and in some cases you must install it
19. https://github.com/defunkt/resque
Resque is our Redis-backed library for creating
background jobs, placing those jobs on multiple queues,
and processing them later.
Installing Redis
Resque requires Redis 0.900 or higher.
20. https://github.com/defunkt/resque
Resque is our Redis-backed library for creating
background jobs, placing those jobs on multiple queues,
and processing them later.
Installing Redis
Resque requires Redis 0.900 or higher.
Resque Dependencies
gem install redis redis-namespace yajl-ruby
22. https://github.com/wistia/resque-mongo
Resque-mongo is a fork of [Resque][resque] that uses
MongoDB as a backend instead of Redis.
Resque-mongo uses a fairly new feature of mongo, findAndModify().
findAndModify that is only supported by 0.20+ version ofthe ruby mongo driver.
23. https://github.com/wistia/resque-mongo
Resque-mongo is a fork of [Resque][resque] that uses
MongoDB as a backend instead of Redis.
Resque-mongo uses a fairly new feature of mongo, findAndModify().
findAndModify that is only supported by 0.20+ version ofthe ruby mongo driver.
Also, check your mongo version: 1.3.0 or higher
24. https://github.com/wistia/resque-mongo
Resque-mongo is a fork of [Resque][resque] that uses
MongoDB as a backend instead of Redis.
Resque-mongo uses a fairly new feature of mongo, findAndModify().
findAndModify that is only supported by 0.20+ version ofthe ruby mongo driver.
Also, check your mongo version: 1.3.0 or higher
Mysql::Error: MySQL server has gone away
If your workers remain idle for too long they may lose their MySQL connection.
25. https://github.com/wistia/resque-mongo
Resque-mongo is a fork of [Resque][resque] that uses
MongoDB as a backend instead of Redis.
Resque-mongo uses a fairly new feature of mongo, findAndModify().
findAndModify that is only supported by 0.20+ version ofthe ruby mongo driver.
Also, check your mongo version: 1.3.0 or higher
Mysql::Error: MySQL server has gone away
If your workers remain idle for too long they may lose their MySQL connection.
Installing Redis
Resque requires Redis 0.900 or higher.
26. https://github.com/wistia/resque-mongo
Resque-mongo is a fork of [Resque][resque] that uses
MongoDB as a backend instead of Redis.
Resque-mongo uses a fairly new feature of mongo, findAndModify().
findAndModify that is only supported by 0.20+ version ofthe ruby mongo driver.
Also, check your mongo version: 1.3.0 or higher
Mysql::Error: MySQL server has gone away
If your workers remain idle for too long they may lose their MySQL connection.
Installing Redis
Resque requires Redis 0.900 or higher.
Resque Dependencies
gem install redis redis-namespace yajl-ruby
30. Why do you need this?
• Why does the Application have a
Dependency on a Service that you
have to create outside of your code?
• Worse, replicate someone else’s steps/
configuration to get working
properly?
• Ideally you shouldn’t even have to find
the resources they should build
themselves!
31. Not meant to directly reflect resque-mongo
A Basic App
App
$redis $mongo
connection connection
Redis MongoDB
PaaS
32. Services Inception
Services inside Services inside...
App
Depends on
$redis $mongo Redis and Mongo
connection connection
You are expected to
Redis MongoDB
set these up yourself
using a command line
PaaS tool in most cases
36. Services Inception
• The App should ask the Platform for
the Service and get it
• If the Platform doesn’t have a service
due to complexity, the app should be
able to create/build it
• The App should have the ability to
automatically bootstrap, update, and
repair itself if need be
• Include the steps, let me choose if I
want to change them
37. We need a Services
Architect
-Ariadne
“I designed the place.”
38. We need a Services
Architect
-Ariadne
“I designed the place.”
The original Developer of the code knows what
it expects, they should leave this behind with the
code (either in it or as an artifact)