<commit_before>Lifeboat
========

![LifeBoat](https://github.com/ivanacostarubio/lifeboat/raw/master/support/lifeboat.png)

Lifeboat is a drop in module for any Ruby Object that responds to 3 callbacks. 

It monitors your models for create, update and delete events. 

It sends a serialized copy of the model attributes to Amazon SQS when those events happen.  

The serialized records are JSON.


WHY
---

If you're operating a web service and you're smart, then you make frequent
backups.  But if you're operating a popular web service then no backup will
ever be fresh enough when you have a failure.  A lot of people learned that
lesson the hard way during the Great Amazon EBS Meltdown of 2011.  How do
you recover data that was created after your most-recent backup, but before
your database crashed?  One way to do that is with database replication.
But not everybody has that option.  Another way to do it is to send your data
to the lifeboats as soon as it's created, so that you can recover it after
a disaster.



Requirements
------------
* Amazon SQS
* right_aws gem

Installation
------------

Include the gem in your Gemfile:

    gem "lifeboat"

Quick Start
-----------

Include Lifeboat in your model class:

    class AnyObject < ActiveRecord::Base
     include LifeBoat
    end

Provide your AWS credentials in config/aws.yml

    access_key_id: YOURSECRETACCESSID
    secret_access_key: YOUR-secRE/TACCe\ssKEy


** We will then automatically create queue messages each time any instance of the model class is created, updated, or deleted. ** 

How did we named the queues
---------------------------

** action_model **

** Where: **  action can be: create, update and delete
** Where: ** model can be the name of any model we include lifeboat on. 


ASSUMPTIONS
-----------

We Asume you have a file called aws.yml under you config directory with the aws key and secret

    test:
      :key 'you_key'
      :secret 'your_secret'

<commit_msg>Minor tweaks.<commit_after>Lifeboat
========

![LifeBoat](https://github.com/ivanacostarubio/lifeboat/raw/master/support/lifeboat.png)

Lifeboat is a drop in module for any Ruby Object that responds to 3 callbacks. 

It monitors your models for create, update and delete events. 

It sends a serialized copy of the model attributes to Amazon SQS when those events happen.  

The serialized records are JSON.


WHY
---

If you're operating a web service and you're smart, then you make frequent
backups.  But if you're operating a popular web service then no backup will
ever be fresh enough when you have a failure.  A lot of people learned that
lesson the hard way during the Great Amazon EBS Meltdown of 2011.  How do
you recover data that was created after your most-recent backup, but before
your database crashed?  One way to do that is with database replication.
But not everybody has that option.  Another way to do it is to send your data
to the lifeboats as soon as it's created, so that you can recover it after
a disaster.



Requirements
------------
* Amazon SQS
* right_aws gem

Installation
------------

Include the gem in your Gemfile:

    gem "lifeboat"

Quick Start
-----------

Include Lifeboat in your model class:

    class AnyObject < ActiveRecord::Base
     include LifeBoat
    end

Provide your AWS credentials in config/aws.yml

    access_key_id: YOURSECRETACCESSID
    secret_access_key: YOUR-secRE/TACCe\ssKEy

We will then automatically create queue messages each time any instance of the model class is created, updated, or deleted.

Naming conventions for Lifeboat message queues
----------------------------------------------

Lifeboat will generate three different message queues for each model that you configure
it for: create_MODEL, update_MODEL, and delete_MODEL.  For example, if your model is named
Sale, then Lifeboat will generate message queues named create_sale, update_sale, and delete_sale.

Assumptions
-----------

We assume that you have a file called aws.yml under you config directory with your aws key and secret:

    test:
      :key 'you_key'
      :secret 'your_secret'


{'fraction_non_alphanumeric': 0.0857352222765022, 'fraction_numerical': 0.002442598925256473, 'mean_word_length': 3.1828396322778345, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1581052', 'n_tokens_mistral': 1139, 'n_tokens_neox': 1079, 'n_words': 560}