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

Arquitecture of a modern web application

Arquitecture of a modern web application

Presented at ASPgems

Diego Rodriguez

November 12, 2014
Tweet

More Decks by Diego Rodriguez

Other Decks in Technology

Transcript

  1. Diego Rodr guez í @diec123 Architecture of a modern web

    application ASPgems nov2014 Happier team collaboration
  2. Diego Rodríguez @diec123 https://teowaki.com ASPgems nov2014 posgres misc redis web

    FrontEnd Webserver API Webserver Admin Webserver Redis api01 API Backend MC* Redis Slave PostgreSQL Replica Admin Backend Ruby Workers api02 API Backend MC* postgreSQL bq Amazon S3 / Glacier Google BigQuery rollbar BitBucket Pivotal Tracker Wordpress Pingdom monit munin Mandrill New Relic Stripe *MC: Memcached ansible Digital Ocean goDaddy NameCheap MaxMind Google Apps Mailchimp Google Analytics JRuby Workers
  3. Diego Rodríguez @diec123 https://teowaki.com ASPgems nov2014 API Backend • Hypermedia

    Restful API • Built on RoR • Our Frontend is an API client
  4. Diego Rodríguez @diec123 https://teowaki.com ASPgems nov2014 Frontend • AngularJS web

    as API Client • Directives and Data Binding • Tools: – Bower: JS dependency manager – Grunt: JS task runner
  5. Diego Rodríguez @diec123 https://teowaki.com ASPgems nov2014 • Full-text search •

    Data types (arrays, geometry) • JSON Interested? http://www.meetup.com/PostgreSQL-Espana/
  6. Diego Rodríguez @diec123 https://teowaki.com ASPgems nov2014 • Advanced key-value store

    (NoSQL) • Fast! • Always in memory • Disk persistance • Atomic Interested? http://berlinbuzzwords.de/session/how-you-can-benefit-using-redis
  7. Diego Rodríguez @diec123 https://teowaki.com ASPgems nov2014 Memcached • key-value store

    (NoSQL) • Always in memory • Evictions • Out-of-the-box support in Rails
  8. Diego Rodríguez @diec123 https://teowaki.com ASPgems nov2014 Background Tasks • Any

    project task that can be delayed • Based on Sidekiq – Background jobs queue (Redis) – Background workers (RoR)
  9. Diego Rodríguez @diec123 https://teowaki.com ASPgems nov2014 Google Bigquery • Big

    Data analysis as a service • Used for API analytics • Extracted module as new product https://datawaki.com Interested? https://www.youtube.com/watch?v=KHrZCpprD6Y (Svitla Ruby Conference)
  10. Diego Rodríguez @diec123 https://teowaki.com ASPgems nov2014 Amazon S3 / Glacier

    • Backups – PostgreSQL (Incremental WAL backup each 5 mins.) – Redis (1 backup per hour) • File storage • Backups moved to Glacier after 1 month https://github.com/wal-e/wal-e
  11. Diego Rodríguez @diec123 https://teowaki.com ASPgems nov2014 posgres misc redis web

    FrontEnd Webserver API Webserver Admin Webserver Redis api01 API Backend MC* Redis Slave PostgreSQL Replica Admin Backend Ruby Workers api02 API Backend MC* postgreSQL bq Amazon S3 / Glacier Google BigQuery *MC: Memcached Digital Ocean JRuby Workers
  12. Diego Rodríguez @diec123 https://teowaki.com ASPgems nov2014 DevOps DevOps (a portmanteau

    of development and operations) is a software development method that stresses communication, collaboration and integration between software developers and information technology (IT) professionals. DevOps is a response to the interdependence of software development and IT operations. It aims to help an organization rapidly produce software products and services https://en.wikipedia.org/wiki/DevOps
  13. Diego Rodríguez @diec123 https://teowaki.com ASPgems nov2014 Provisioning • Server installation

    automation • SSH connection from client • Based on yaml configuration files
  14. Diego Rodríguez @diec123 https://teowaki.com ASPgems nov2014 Deployment • Automating the

    execution of commands across multiple remote machines • Integrated with RoR (migrations) and libraries (sidekiq, whenever, unicorn…) • Rollback
  15. Diego Rodríguez @diec123 https://teowaki.com ASPgems nov2014 Other Services • GoDaddy

    - DNS • NameCheap – SSL Certificate • MaxMind – IP Geolocation • Wordpress – Blog hosting • Google Analytics • Google Apps
  16. Diego Rodríguez @diec123 https://teowaki.com ASPgems nov2014 posgres misc redis web

    FrontEnd Webserver API Webserver Admin Webserver Redis api01 API Backend MC* Redis Slave PostgreSQL Replica Admin Backend Ruby Workers api02 API Backend MC* postgreSQL bq Amazon S3 / Glacier Google BigQuery rollbar BitBucket Pivotal Tracker Wordpress Pingdom monit munin Mandrill New Relic Stripe *MC: Memcached ansible Digital Ocean goDaddy NameCheap MaxMind Google Apps Mailchimp Google Analytics JRuby Workers
  17. Diego Rodríguez @diec123 https://teowaki.com ASPgems nov2014 Pricing • Hosting 7

    servers 65$ per month (50€) • Total operational cost 100€ per month