Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Rails Engines as a way to Micro Services

Rails Engines as a way to Micro Services

Talk presented at Rubyconf Brasil 2016

Lucas André de Alencar

September 24, 2016
Tweet

More Decks by Lucas André de Alencar

Other Decks in Programming

Transcript

  1. EMAIL MARKETING LANDING PAGES SOCIAL MEDIA POSTS LEADS MANAGEMENT SEGMENTATION

    LEADS IMPORT MARKETING AUTOMATION EMAILS CUSTOM FIELDS SOCIAL MEDIAS DASHBOARD
  2. EMAIL MARKETING LANDING PAGES SOCIAL MEDIA POSTS LEADS MANAGEMENT SEGMENTATION

    LEADS IMPORT MARKETING AUTOMATION EMAILS CUSTOM FIELDS SOCIAL MEDIAS DASHBOARD
  3. EMAIL MARKETING LANDING PAGES SOCIAL MEDIA POSTS LEADS MANAGEMENT SEGMENTATION

    LEADS IMPORT MARKETING AUTOMATION EMAILS CUSTOM FIELDS SOCIAL MEDIAS DASHBOARD
  4. EMAIL MARKETING LANDING PAGES SOCIAL MEDIA POSTS LEADS MANAGEMENT SEGMENTATION

    LEADS IMPORT MARKETING AUTOMATION EMAILS CUSTOM FIELDS SOCIAL MEDIAS DASHBOARD
  5. EMAIL MARKETING LANDING PAGES SOCIAL MEDIA POSTS LEADS MANAGEMENT SEGMENTATION

    LEADS IMPORT MARKETING AUTOMATION EMAILS CUSTOM FIELDS SOCIAL MEDIAS DASHBOARD
  6. EMAIL MARKETING LANDING PAGES SOCIAL MEDIA POSTS LEADS MANAGEMENT SEGMENTATION

    LEADS IMPORT MARKETING AUTOMATION EMAILS CUSTOM FIELDS SOCIAL MEDIAS DASHBOARD
  7. EMAIL MARKETING LANDING PAGES SOCIAL MEDIA POSTS LEADS MANAGEMENT SEGMENTATION

    LEADS IMPORT MARKETING AUTOMATION EMAILS CUSTOM FIELDS SOCIAL MEDIAS DASHBOARD
  8. ~/code rails plugin new engines/engineX --mountable create create README.rdoc create

    Rakefile create engine_x.gemspec create MIT-LICENSE create .gitignore create Gemfile create app create app/controllers/engine_x/application_controller.rb create app/helpers/engine_x/application_helper.rb create app/mailers create app/models create app/views/layouts/engine_x/application.html.erb create app/assets/images/engine_x create app/assets/images/engine_x/.keep create config/routes.rb create lib/engine_x.rb create lib/tasks/engine_x_tasks.rake
  9. . ├── app ├── bin ├── config ├── db ├──

    engines │ ├── engineX │ ├── engineY │ └── engineZ ├── lib ├── public ├── test └── tmp
  10. 1 source 'https://rubygems.org' 2 3 path './engines' do 4 gem

    'engineX' 5 gem 'engineY' 6 gem 'engineZ' 7 end 8 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ NORMAL Gemfile
  11. . ├── app ├── config └── engines └── engineX ├──

    app │ ├── controllers │ ├── helpers │ ├── models │ └── views ├── config │ └── routes.rb ├── Gemfile └── engine_x.gemspec
  12. WHAT GOES INSIDE AN ENGINE? CODE TESTS DUMMY APP FOR

    TESTS (AUTOMATED AND MANUAL) DATA MIGRATIONS ROUTES
  13. 1 module EngineX 2 class Engine < ::Rails::Engine 3 isolate_namespace

    EngineX 4 end 5 end ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ NORMAL lib/engine_x/engine.rb
  14. 1 module EngineX 2 class Engine < ::Rails::Engine 3 isolate_namespace

    EngineX 4 end 5 end ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ NORMAL lib/engine_x/engine.rb
  15. 1 module EngineX 2 class Engine < ::Rails::Engine 3 isolate_namespace

    EngineX 4 end 5 end ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ NORMAL lib/engine_x/engine.rb
  16. 1 module EngineX 2 class Engine < ::Rails::Engine 3 isolate_namespace

    EngineX 4 end 5 end ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ NORMAL lib/engine_x/engine.rb