{"action":"created","issue":{"url":"https://api.github.com/repos/18F/e-manifest/issues/17","labels_url":"https://api.github.com/repos/18F/e-manifest/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/18F/e-manifest/issues/17/comments","events_url":"https://api.github.com/repos/18F/e-manifest/issues/17/events","html_url":"https://github.com/18F/e-manifest/issues/17","id":125265626,"number":17,"title":"Moving to Rails","user":{"login":"jessieay","id":601515,"avatar_url":"https://avatars.githubusercontent.com/u/601515?v=3","gravatar_id":"","url":"https://api.github.com/users/jessieay","html_url":"https://github.com/jessieay","followers_url":"https://api.github.com/users/jessieay/followers","following_url":"https://api.github.com/users/jessieay/following{/other_user}","gists_url":"https://api.github.com/users/jessieay/gists{/gist_id}","starred_url":"https://api.github.com/users/jessieay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jessieay/subscriptions","organizations_url":"https://api.github.com/users/jessieay/orgs","repos_url":"https://api.github.com/users/jessieay/repos","events_url":"https://api.github.com/users/jessieay/events{/privacy}","received_events_url":"https://api.github.com/users/jessieay/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-01-06T21:20:04Z","updated_at":"2016-01-07T15:43:24Z","closed_at":null,"body":"I estimate that moving our application from Sinatra / Jekyll to Rails will take one developer less than 1 day.\r\n\r\nRails is a web framework written in Ruby. Sinatra is also a web framework written in Ruby. Sinatra is usually best for very small applications. I believe we should move to Rails because our application is growing and could benefit from pulling in some parts of Rails. While it is possible to pull in these parts one by one while still using Sinatra, it will be faster to move to Rails entirely rather than basically turning our Sinatra app into a Rails app without actually using Rails. In short: let's not reinvent the Rails wheel. \r\n\r\nHere are some benefits of Rails over Sinatra:\r\n\r\n- Would use same database (Postgres) and language (Ruby) that we currently use, so it would be an easy move\r\n- Rails console for creating data - http://guides.rubyonrails.org/command_line.html#rails-console\r\n- ActiveRecord for interacting with SQL database and adding data validations - http://guides.rubyonrails.org/active_record_basics.html\r\n- Asset pipeline for CSS - http://guides.rubyonrails.org/asset_pipeline.html\r\n- Improve ability to do front end tests if front end and back end are tied together. We currently do not have any tests that cover our front end and back end together.\r\n\r\nvia https://blog.engineyard.com/2014/rails-vs-sinatra\r\n\r\n> Rails we reserve for larger scale applications, anything with an expectancy for many users and greater than say 15-20 end points, or places where the application can be accessed, like a URL or login portal. Sinatra is for small projects and API pullers, something that has just a few or some limited number of users and about 5-10 end points.\r\n\r\n> Considering scale, Rails will far outstrip Sinatra. As we grow our application, assuming we started in Sinatra, we’ll see that as the number of users and end points grow, the more we are implementing parts of Rails, such as ActiveRecord, in Sinatra in order to keep up. Once that starts happening, once the Sinatra app has grown difficult to manage, it’s time to rebuild it in Rails. It may be obvious over time, but timing is crucial and knowing your app will help you determine when this switch needs to take place.\r\n\r\n> Performance can also come down to the size of the application. As a Sinatra application starts to grow, we are likely to see dips in performance. With Rails, there are many ways to offload certain aspects of an application to lighten the load and improve performance. Database indexing, creating ETLs, and background jobs for the application are much easier to implement in Rails and therefore can boost performance as the application begins to grow.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/18F/e-manifest/issues/comments/169699882","html_url":"https://github.com/18F/e-manifest/issues/17#issuecomment-169699882","issue_url":"https://api.github.com/repos/18F/e-manifest/issues/17","id":169699882,"user":{"login":"pkarman","id":1205061,"avatar_url":"https://avatars.githubusercontent.com/u/1205061?v=3","gravatar_id":"","url":"https://api.github.com/users/pkarman","html_url":"https://github.com/pkarman","followers_url":"https://api.github.com/users/pkarman/followers","following_url":"https://api.github.com/users/pkarman/following{/other_user}","gists_url":"https://api.github.com/users/pkarman/gists{/gist_id}","starred_url":"https://api.github.com/users/pkarman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkarman/subscriptions","organizations_url":"https://api.github.com/users/pkarman/orgs","repos_url":"https://api.github.com/users/pkarman/repos","events_url":"https://api.github.com/users/pkarman/events{/privacy}","received_events_url":"https://api.github.com/users/pkarman/received_events","type":"User","site_admin":false},"created_at":"2016-01-07T15:43:24Z","updated_at":"2016-01-07T15:43:24Z","body":"I recommend reading https://blog.engineyard.com/2014/rails-vs-sinatra\r\n\r\n> Considering scale, Rails will far outstrip Sinatra. As we grow our application, assuming we started in \r\n> Sinatra, we’ll see that as the number of users and end points grow, the more we are implementing \r\n> parts of Rails, such as ActiveRecord, in Sinatra in order to keep up. Once that starts happening, once \r\n> the Sinatra app has grown difficult to manage, it’s time to rebuild it in Rails. It may be obvious over \r\n> time, but timing is crucial and knowing your app will help you determine when this switch needs to \r\n> take place.\r\n\r\nIME, if architected correctly, a web-based application like this should always bottleneck at the storage (database, search index) layer, not the app code layer. You can always scale out the web app to multiple nodes and load balance. The storage layer has ACID constraints, which means concurrency becomes the slowdown.\r\n\r\nI.e., Rails vs Sinatra isn't the scaling issue."}}