SlideShare a Scribd company logo
1 of 50
It’s not always sunny in the clouds
             Me,
             teetering




                 Text
Mike Subelsky




 @subelsky
Mike Subelsky




 @subelsky
1 / 1 / 08
08:00:00 ET
“Everything needs
to be automated”
Autoscaling is the easiest
          part
Think carefully about
credential management
You really could use internal
            DNS
It's maybe not that cheap
Launching servers is not
       that fast
You will become dependent
    on “glue” services
You will become dependent
    on “glue” services
You will depend on a distant
     faceless provider
Use DVCS
You will spend a lot of time
      on monitoring
Your logs will
runneth over
Your logs will
runneth over
Write lots of
“in-process tests”
Write lots of
          “in-process tests”

m = Message.find_last_slug_message
secs = m.created_at - m.date_sent

if secs > 600
  ErrorNotifier.fatal(quot;Missed slug deliveryquot;,secs,m)
end
Snapshots are slow
Snapshots are slow
Rails will be the
least of your worries
Cloud services involve
 subtle-yet-massive
      tradeos
SQS guarantees delivery at
       least once
SQS guarantees delivery at
          least once
def self.guard_against_repeat_delivery(smtp_message_id)
 begin
  create!(:smtp_message_id = smtp_message_id)
  return true
 rescue ActiveRecord::StatementInvalid




 end
SQS guarantees delivery at
         least once
def self.guard_against_repeat_delivery(smtp_message_id)
 begin
  create!(:smtp_message_id = smtp_message_id)
  return true
 rescue ActiveRecord::StatementInvalid
  rows_updated = raw_update(quot;UPDATE application_message_logs
                    SET last_attempt_at = UTC_TIMESTAMP(),
                    WHERE smtp_message_id = #{smtp_message_id} AND
                    last_attempt_at  DATE_SUB(UTC_TIMESTAMP(),
                             INTERVAL 900 SECOND)quot;)




 end
SQS guarantees delivery at
         least once
def self.guard_against_repeat_delivery(smtp_message_id)
 begin
  create!(:smtp_message_id = smtp_message_id)
  return true
 rescue ActiveRecord::StatementInvalid
  rows_updated = raw_update(quot;UPDATE application_message_logs
                    SET last_attempt_at = UTC_TIMESTAMP(),
                    WHERE smtp_message_id = #{smtp_message_id} AND
                    last_attempt_at  DATE_SUB(UTC_TIMESTAMP(),
                             INTERVAL 900 SECOND)quot;)

  if rows_updated  1
    logger.warn(quot;Preventing duplicate msg delivery #{smtp_message_id}quot;)
    return false
  else
    return true
  end
 end
Queue lengths inaccurate
   for  1000 items
SQS not
necessarily FIFO
So you may not
want a cloud queue
SimpleDB optimized
for writes, not reads
You must code defensively
There are no good quot;cloud
      sandboxesquot;
Pay attention to
MySQL timeouts
quot;User account management
            is
       -not- ideal.quot;
             -Deacon
              Bradley
You are locked-in to your
         provider
Relational DB may not
 be the best choice
Is there a benefit?
Changes the way you write
          code
You can start
 right away
Pretty awesome redundancy
Time for an example?
US-EAST-1C
                            o
                       t                           Ta
                    me                  SQS           s
                   a                                   kin
                 en e
              Fil ars                                      g
              3P
             S


    Postfix   MailSender                                      MailReceiver   MailParser   Master DB




                                                            le
                 Ra




                                                          Fi
                   w
                       Mb




                                                       x
                                                    bo
                           ox




                                                   M
                                 Fil




                                               w
                                    e




                                              Ra
                                        S3




US-EAST-1B
                            to                     Ta
                       e                SQS
                    am                                skin
                  en e
               Fil ars                                     g
             S3 P


    Postfix   MailSender                                      MailReceiver   MailParser   Master DB
                                                           le
                 Ra
                                                          Fi

                   w
                       Mb
                                                       x
                                                     bo




                           ox
                                                   M




                                 Fil
                                                 w




                                    e
                                              Ra




                                        S3
US-EAST-1C
                            o
                       t                           Ta
                    me                  SQS           s
                   a                                   kin
                 en e
              Fil ars                                      g
              3P
             S


    Postfix   MailSender                                      MailReceiver   MailParser   Master DB




                                                            le
                 Ra




                                                          Fi
                   w
                       Mb




                                                       x
                                                    bo
                           ox




                                                   M
                                 Fil




                                               w
                                    e




                                              Ra
                                        S3




X XX
US-EAST-1B
                            to                     Ta
                       e                SQS
                    am                                skin
                  en e
               Fil ars                                     g
             S3 P


    Postfix   MailSender                                      MailReceiver   MailParser   Master DB
                                                           le
                 Ra
                                                          Fi

                   w
                       Mb
                                                       x
                                                     bo




                           ox
                                                   M




                                 Fil
                                                 w




                                    e
                                              Ra




                                        S3
X
US-EAST-1C
                            o
                       t                           Ta
                    me                  SQS           s
                   a                                   kin
                 en e
              Fil ars                                      g
              3P
             S


    Postfix   MailSender                                      MailReceiver   MailParser   Master DB




                                                            le
                 Ra




                                                          Fi
                   w
                       Mb




                                                       x
                                                    bo
                           ox




                                                   M
                                 Fil




                                               w
                                    e




                                              Ra
                                        S3




                                                                                         X
US-EAST-1B
                            to                     Ta
                       e                SQS
                    am                                skin
                  en e
               Fil ars                                     g
             S3 P


    Postfix   MailSender                                      MailReceiver   MailParser   Master DB
                                                           le
                 Ra
                                                          Fi

                   w
                       Mb
                                                       x
                                                     bo




                           ox
                                                   M




                                 Fil
                                                 w




                                    e
                                              Ra




                                        S3
US-EAST-1C




                                                          X
                            o
                       t                           Ta
                    me                  SQS           s
                   a                                   kin
                 en e
              Fil ars                                      g
              3P
             S


    Postfix   MailSender                                      MailReceiver   MailParser   Master DB




                                                            le
                 Ra




                                                          Fi
                   w
                       Mb




                                                       x
                                                    bo
                           ox




                                                   M
                                 Fil




                                               w
                                    e




                                              Ra
                                        S3




US-EAST-1B




                                                          X
                            to                     Ta
                       e                SQS
                    am                                skin
                  en e
               Fil ars                                     g
             S3 P


    Postfix   MailSender                                      MailReceiver   MailParser   Master DB
                                                           le
                 Ra
                                                          Fi

                   w
                       Mb
                                                       x
                                                     bo




                           ox
                                                   M




                                 Fil
                                                 w




                                    e
                                              Ra




                                        S3
X
US-EAST-1C

                             SMTP Cloud
                            o
                       t                           Ta
                    me                  SQS           s
                   a                                   kin
                 en e
              Fil ars                                      g
              3P
             S


    Postfix   MailSender                                      MailReceiver   MailParser   Master DB




                                                            le
                 Ra




                                                          Fi
                   w
                       Mb




                                                       x
                                                    bo
                           ox




                                                   M
                                 Fil




                                               w
                                    e




                                              Ra
                                        S3




US-EAST-1B




                                  X
                            to                     Ta
                       e                SQS
                    am                                skin
                  en e
               Fil ars                                     g
             S3 P


    Postfix   MailSender                                      MailReceiver   MailParser   Master DB
                                                           le


                 Ra
                                                          Fi



                   w
                       Mb
                                                       x
                                                     bo




                           ox
                                                   M




                                 Fil
                                                 w




                                    e
                                              Ra




                                        S3
Me,recovering
Questions?


mike@oib.com
 @subelsky

subelsky.com

More Related Content

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

It's Not Always Sunny in the Clouds

Editor's Notes

  1.      - so you either have to pay for RightScale, EY, Heroku, Scalr, etc.      - or you have to roll your own      - or you can install an open source project      - either way, it's going to cost you time or treasure
  2. Nine different sets of creds to manage Maybe YAML not so much
  3. some people, like Gartner, think AWS still charges too much
  4. - general AWS launch time - JRuby JVM
  5. - For us, SQS, S3, EC2
  6. You can get AWS SLAs, premium support
  7. otherwise you’re too dependent on the VCS host
  8. - Because nodes are ephemeral - We use Alertra & custom scripts & rightscale - we've written a ton of custom monitoring scrips
  9. one log file turns out to be better than many 40+ boxes, ephemeral so don’t save logs have not found a palatable alternative to splunk hoptoad FTW
  10. - use to test \"can we hit SQS a lot\", now we test \"can a message get delivered in a timely fashion end-to-end\" - show snippet
  11. but can be a lifesaver
  12. - show idempotency code example
  13. - show idempotency code example
  14. - show idempotency code example
  15. - esp if you have a task that HAS to be performed immediately - we use this for email delivery and generally is fast enough
  16. you miss a lot of awesome aggregation that RDBMs does for you
  17. - Cloud services give a lot of expected and unexpected errors - Write lots of exponential retry code
  18. - Testing is going to be difficult - Need something like Paypal test gateway - Fakeweb shows promise I’m working on something
  19. - connections for killed-off servers may hang around - lowering the timeout caused lots of issues for seemingly-unrelated pieces
  20. \"A system like Kerberos which is ideal for multi-server multi-role environments requires too much overhead to setup”
  21. - cloudkick may change this - it's bound to change
  22. - forces you to loosely couple components - affords you trade offs - you can throw more servers at a problem
  23. - very low activation energy
  24. - very low activation energy