Bestand wählen

Riding Rails for 10 Years

Zitierlink des Filmsegments
Embed Code

Automatisierte Medienanalyse

Erkannte Entitäten
check in in in in in in this so who this is a list of users in that so thanks everyone for coming so my talk is riding rails for 10 years and so when I started thinking about this 10 years didn't seem like that long of a period of time to talk the rails and how it's change and it's actually a long time there a lot of stuff that's happened so I jamming as much as I could so I'm going to try and go through a pretty quick but there's lots of interesting things have happened over the 10 years the and so part of
this talk is looking at shop applying the shop like base and how it's changed over those 10 years of rails and why do we why look at shop apply and and it's pretty interesting because shop I started nearly around the same time Israel 1 came out just a bit before actually it's never been rewritten and we've used versions all the way from before 1 . 0 2 to 4 . 1 which were running now and get repository holds most of the content of all of these changes over time so it's really interesting to go digging through it and seeing how rails this change in how shop vise had to change and as rails has moved along the and for this talk I put together a little less timeline of that kind of the releases over time so these are the releases of rails over time and did it based on kind of the public releases and so on they may be off a little bit on but there's been a lot of recent releases over time a lot of changes rails over time then you can contrast this with shop
iron how we've been evolving shop my code base over time as well so we've been following along with rails and in some cases you can actually see the version numbers being a little bit before else releases because we were running on entrails for a long period of time and in the early days so this is kind how shop applies upgrades derails to the rails releases and as I was going through the
history I had a pinpointed around 45 different versions of rails that we have running in production and over the 10 years so is looking at all the major minor and tiny version of updates that have been done and and this doesn't include anything that I might be missing from the history that we don't actually have in the git repository because there's a few years of history that we don't actually have this is a lot of change over time and a lot of change that both the reals is went through and the shop like codebase itself has had to go through to follow along with those changes so I was fired just going back in
time a little bit to that 1st commit that we have a shop applied and checking added and kind of take a look at what rails looks like at that time and so the 1st thing that we have is from August 2005 is likely around rails . 1 3 and it's pretty much light rails 1 . 0 was released as in December 2005 so I checked that the commit
because I could do that and I was really easy and like acted opening my my editor and looked at the directory structure and it's pretty interesting because it's all very familiar like nothing crazy about this I like stands out it looks pretty familiar as a Rails app for most developers and you've been using rails a lot of the main pieces to what we know of rails out today existed back then in 2005 yeah so
we have the to patterns established testing is already baked in this even deployed out AVI file at that time I think was using something called ship power by Capistrano was released in early 2006 which shall find now uses
so I went through some of the files as well and take a look at some of those to see how the pieces of changed over time and so this was I think I may be cut out a line at you but this was basically the rope file for shop applied at that point the entire record file and and our rights files actually split into you like 5 or 6 different piles because it's only wrote very large but all this is very familiar it doesn't look quite the same but like you can see how it got to where was wasn't it doesn't feel completely different from what you might be used to you still have the fragments in the URL the self controllers its own actions amounting to then if we look at a controller again it's still pretty similar the naming of the actions is different because we don't have as much standardization around the naming of the actions of the time but all in all it looks pretty similar to what you would know from from real sad the models are the same thing
and we have all the associations is validations of a lot of the same pieces that exert there now existed back in 2005 this is a lot more to them you can do a lot more with the validations you can do a lot more with the associations that you couldn't do at this time and there wasn't much in addition to the associations here but now you have a lot of options that you can pass associations and they're just of generally a lot more powerful than what they were at the time it's also cool that JavaScript was also kind of beacon derails at the time we had the RGS and spectacular some prototypes were stripped with rails and so Ruby on Rails going along with like some bits of JavaScript has been the case since the earliest days that
now I looked into it a little bit more and there's a few other things that kind of exist and a lot of these things have actually changed over time so I 1 point there is this idea of sweepers and use those to expire caches we had observers to encapsulate some back actions views were are HTML instead of being html body a B and dependency management was handled by either including the gene's in your vendor directory or having submodules or having ASEAN externals and then the interface to the web server was Fast CGI at the time so also did a line of
code count on that 1st Committee which is kind of cool so the total lines of code of shop fly at that time was 11 thousand on which is pretty tiny in comparison to what it is now just to compare we have closed at half a million lines of code now and the majority of them being Ruby as so a lot has changed over time but but it's interesting looking at kind of those early beginnings and where it came from so a lot has changed but there's still a lot this seem like a lot of those early patterns of early practices were set up and established in those earlier stages so
now we follow through with kind of the evolution and start looking at some of the other versions of rails I'm starting with real 1 2 and this was released in January in shop applied actually showed up in November of 2006 because we're running on the edge and later on in 2007 we updated 1 2 3 so in those early days we're keeping pretty close with divergence on being on edge as much as possible and he was really easy to do that because rails was actually check directly into the code base in like Bender externals and so it would be changed even with like minded changes to shop i and since the codebase was pretty small the impact was low the rails 1 2 was
a pretty interesting release it had addressed and the idea of resources so DJ to assign about this earlier rest was 1 of the kind of fundamental things like came about the rails and still exist now on but it wasn't perfect when it was initially released unelectable links wasn't perfect when it was initially released I get that a bit later real someone to also added multi-byte support some out routing was rewritten and you can do some some nice things with formats in response to so show you some code from the shop vi codebase and most of this
code was like directly lifted from the codebase in history I cut out like a few things to like make it fit on the slides but this is real code that we had running and shot fire at that point in time so routing once that Canada formats and respond to so that's the format fragment in the URL so this allowed to the HTML CSP formats and rails would just inspect the content type the mind tight and that just handle of figuring out which format to render for you so this is really nice and put a bunch of like format you have to do on your own yeah rest was really cool so this uh create a lot more consistency in the application so you could matter resources and then you would have a lot more consistent action means and mean you would you would have to do all the mountain mapping of the specific you're else a lot of this exists today's and hasn't changed a whole lot over time except for the underlying routing them back to like that rest initial versions so the initial version of rest actually shipped with the Urals being separated by semicolons so after a year orders IDE there'd be a semicolon and then the action in and this was that not handle very well by some browsers and libraries and web servers and mongrel then handle it very well which was kind of the de-facto web server at the time so they actually change it in rails 1 2 4 to be a slash and so this is kind of contrast with the troubling situation where the ideas were solid from the start but didn't quite get it right in a kind of a ball and 2 to be the patterns that we see today and be really great patterns that we all use and and love so
else to the this was released in December of 2007 and shop I updated to it pretty much right at the same time I just a few days later after the really really state because we were running pretty close to the edge and the rails to series was probably 1 the best that series of rails ever but by a lot of accounts and there's a lot of really cool stuff there was added into you and some of the point releases that a lot of people are really love and it was it was a good combination of being really fast and then having a lot of features that got the job done and you didn't have to like do a lot of stuff on your own like rails was taking care of a lot for you to so rails to some of the notable things that
were added were rescue from and picture dependencies namespaces in roads multi-view responses was kind cool so you can register online type aliases so this would let you do the registering like an iPhone alias for something if you want and this is pretty early on in in the mobile Web another interesting 1 is that the action web service which was removed and active resource which came in so a lot of people probably don't know or remember action web service but is basically soap RPC protocol supported and WSDL generation freaky eyes and all kinds of nice things like that and luckily rats 1 out and rail shows with rest over all that stuff and which is another and opinionated view and drove things forward but they were exploring different ideas of time so looking at some shop code and what rescue from cleaned up we that have this right of rescue action that was taking errors in there's this massive the statement that actually trimmed down there was like 15 different conditions and therefore all the different areas and so rescue from a a lot of snow it's still because it's it exists now but let us clean that up a lot so you could encapsulate each of those in their responses on their own instead of jamming them all into the same case statement the fixture dependencies were big win because at the time you had just static integer IDA idea is that year including the had a reference those correctly which was really painful so this let you reference the the shot by its name in the fixture instead of having to reference the idea ID and then if you needed to you could use the fixtures that identifies and if it's ambiguous namespacing also allowed us to clean up a lot of code where we have this mapping of resources with a mass of options there we can now NASA nicely and encapsulate the different namespaces and keep things from getting really cluttered and make it easier to understand and read the roads as they grow over time rules you 1 didn't have a
huge number changes but it's notable mainly because it added support for conveying . gems in the environment but I biodiversity file so this was really cool because as I said up until this point you're kind of left on your own to manage agenda ments is this so the 1st time you're given a pretty decent system to manage a damn gender and the in your rails that so what this looked like was in your
initializer environment B. you could just configure which stands reusing and you can even specify the source at the time a few months after this was released you have actually became a jam source and you could have all your username Dostum gem name and there is a pretty big mess with that which changed once the Bundler and Ruby gems and everything that kind of evolved over time what is interesting because this really helped to manage dependencies where we didn't really have any help at the time and your kind left on your own figure out in interdependencies and rails to
3 is another big get big released so this was released in March 2009 and show I actually hit it in March as well and so I would say rails to 3 out of all
that to release 2 . 0 releases is probably 1 of the the biggest and 1 of the best I have with the number of features and kind of what interview as kind of the pinnacle of the 2 . 0 release cycle and again like I said it's like a good mix of like strong performance in giving you a lot of features to kind of take care of what you need to do so in this introduced rack and which show that wasn't in rails out In the previous versions and you have accepted as a batch of use and there's a few other like niceties there were added application templates were added which featured showed with the red dashed SEPI announce a lot of this stuff building up to some of the things that we see now in our Rails apps as well yeah so alot of us know well how rack works and know what it is these days and but this is just kind house shop started using wrapped in those that kind of early days and this is the 1st middleware we added to the application just as a simple blacklist for application that was aiming our site and so we would just for for this particular like request URI because they were just like kind of scraping our site and it's a great use of rack and these changes to rails really made it easy to do these types of things sets has adapted its is another 1 where we can take it for granted I think and so we actually have a whole bunch a code in shop of environ trying to do the acceptance batch of each type of thing and is just like really terrible but actually wasn't involved in any this but going through and looking back at it is just really interesting to see like the kind of high jinks you had to do that kind of make it work and then if you switch over to using a set next nest actually it's a really clean and I really obvious what's going on so it simplifies the the code base a lot of switching over to that Wilson real serious
another pretty significant release and and it was it came out in August and shop of I updated around October and so we're pretty close to that 1 as well and this was a pretty large 1
and so and it was also the 1st major release since the rails the merge with the verb team so there was a lot of new ideas coming into rails 3 and being brought by the verb deemed by kind of breaking up different parts of shock uh of rails making it agnostic to a whole bunch of different things and adding a whole bunch of niceties so that you could plug into rails a lot easier and make your own kind of framework this came with a lot of performance that degradations and this was a lot of the kind of flat that rails got at that time and a big reason why a lot of applications actually stuck with rules to 3 for a long period of time we moved on to the 3 pretty quickly because the kind of developer productivity that we got was a lot higher than any performance impact that we saw and was worth the the hit to be able to on board developers and to just a have a lot nicer code and easier to manage code so looking at a few the features they're all like it's really popular and now like we serial everywhere and it was introduced in real 3 previously you had to do some kind of awkward syntax again to kind of do the same thing it just really tightened things up and made it really easy to do the things that you need to you but with your associations and your queries if but there was also introduced at this time and so this took a lot of like kind of similar ideas to what can the jam in the environment R. B. was doing but pulled it out into separate system and Bundler again is 1 of those things that early on a lot of people hated on and because it is different and kind of change so we work but these days is probably 1 of the best things about rails and 1 of the things that actually makes it possible to work on a large rails act with a lot of dependencies I don't know I think it's hard to remember what it was like before bond learned before this dependency management and but it was pretty terrible time and on the makes a lot of this easier we actually converted shop applied to use Bundler before 3 . 0 so that we can take advantage of that and well we're still running rules 2 3 5 so next
set releases are 3 . 1 3 . 2 so these ones are pretty big ones again and the accident update to 3 . 1 we attempted it but found a whole bunch of performance issues with that and then we never followed through with that there was no dedicated team on not so just have step aside until we drove forward with 3 . 2
so within 3 1 3 2 of the noble changes are absent pipeline japery become the default JS library and just lots of internal EPI changes so I was looking at the what we eventually emerged as the rails 3 . 2 update there was like 250 change files and like the additions deletions were pretty even on but there's just a lot of them because a lot of internally eyes chains particularly around associations and kind of the internal association proxy objects so this was a pretty big change for us an asset pipeline is something that we had wanted to use because we were working on the JavaScript from intimacy aren't so asset pipeline was actually really interesting so we ended up back porting asset pipeline to 3 . 0 so we could use it and so this is just a generally pretty messy set of updates on but we eventually got onto the 3 . 2 and I thought that was then rules for came along
and it was released in June 2013 and we got on it in February 2014 so at this point shot vise getting pretty large and complex and there's a lot of moving pieces a lot of code and a lot of people working on it and it's getting harder to keep up to date when were not like paying as much attention to it so the updates are being drawn out a little bit longer or else for had a
lot of really cool stuff that we want to take advantage of so it supported Ruby to which we want to move towards trooper lengths the Russian Doll caching strong parameters they're killing off of the observers and then just generally tightening up API is like removing Hashim dynamic finders so if you get the code from
shop applied here and it just really getting more consistent API is tightening up on kind the ideas that were put forward previously with Errol and all that and just making a consistent across the different API is and and different syntax so you might use the
so latest version that we've updated to Israel's for 1 and so this was released in 2014 April and we got on it in January 2015 and so were on for 1 and again this was beaten really dedicate a whole team to it it was kind of done on the side and we have learned a lot about keeping up to date with these things which I'll get to you in a couple more slides so kind the notable things and
rules for 1 hour the spring application for a lot of promoter which was cool and because we're actually using a previously and is is really great to see rails like to speaking in the same defaults in this kind of like the trend over time you see them take the really good parts about how people are building and using rails and baking them and so you don't need to do it yourself and it just comes packaged with all these great things and to be able build their applications the other notable feature Frost was varied templates and because we were starting to use this for a are mobile applications as well so little code sample from shot by itself and of the very templates that's pretty straightforward basically just setting the variance based on the user type and then rails automatically knows how to pick that up and render that you for you and so that brings us to
today and so looking back at kind of how we've evolved over time it's been really interesting looking at and that's how we manage these updates from the early days where an edge in the codebase was lot smaller and more manageable to as we moved to a much larger codebase with a lot of people and the difficulties that that has brought so it started a lot easier and then getting harder believe in learning how to deal with that that pain of just a large codebase and what were doing with the it's kind of 1 of the hardest
things over time and marshalling changes have been a big deal and this isn't strictly related to rails but it's come up with rails updates that comes up with more with Ruby updates and but just when Rubia rails and marshalling objects a changing the format of art objects that's been really difficult for us so we have a caching layer that actually marshals full lack record objects and so that was really difficult way as rails changed like the internals of Active Record and some of the variables that it has an back it's difficult and then also changes the things like Flash formats and sessions and just anywhere you're going to serialize an object and expecting 1 format and then maybe get it differently in another request and so kind of a way we solve those issues and work learned to solve those issues is tied the like them in parallel in 2 different stores with 2 different versions so depending on the request you can pull out the right 1 or having some translating code so in the case of Flash format uh the translation between the version was pretty easy so we just added that piece of backported code that would figure out which version to deserialize and do that for you know the big thing is just no men maintaining the momentum with a large team so we have over 150 people contributing to this code base and we don't want slow them down but we also don't want them undoing the changes that we've been making or reintroducing depredations the so this has been really challenging encounter 1 of the biggest thing that we have down to minimize that is just a release the changes as early as possible and it's even as simple as we add an environment variable so you can toggle between the different rails versions really easily and then be able to work on the operate in parallel and ship all as much of the code into production as early as possible so in the end the rails for 1 and even the rails for updates ended up being like dozens of files changed if that many and so it really small set of changes compared to that 3 . 2 update where we change thousands of lines of code then just the size of the code base and lots of edge cases so this makes it really hard actually know all the bits and pieces and everywhere that might be doing some specific rails thing or might be muddy patching rails in particular way and then running into performance regressions just because of the scale of the code base and the amount of the server's running on the amount of load we're getting we hit a lot of performance regressions that people might not see so with all that in mind
why do we keep upgrading and why we keep moving forward and like it's really important to us to move it forward so like the big reasons are the new features so things like turbo links and variants and all those things are reducing the complexity of our code base and giving us and a larger peaceful leverage so as much that we can push into rails itself and take advantage and not have to maintain completely ourselves and that half a million lines that code this is a big benefit to us getting better security and updates and better practices is huge hiring is a big deal so as were growing as we've been hiring a lot in bringing people on is a lot easier when moving on to the newer versions of rails because the light and no it or it's easier to learn because the documentation or the existing resources that are out there then also the codebase longevity so the code about been around for 10 years but it's likely going to be around for another 10 or 20 years so really we actually need to do this like there's no like sticking to a particular version otherwise it'll just be an unmaintainable if we are thinking about keeping this around for another 10 or 20 years we need to continue moving forward with rails
so kind of recommendations for anyone working on keeping the rails up up to date on a mechanic in at at some of these with the big ones are like avoid monkey pattern rails itself we done this in a few few cases and it's really hard to figure out and ends up fighting you really badly keeping dependencies low and so every Jan every library that you depend on is going to be another thing that you need to you either investigate or update yourself or a throwaway every right when you update rails if the internally guys are changing so keeping those dependencies low into the minimum is really important as I said shipping changes early and often and so and having like a parallel CI running so you can do that is a big deal so with real street you we didn't really do that we have like a big bang release of real 3 2 but with real for rules for 1 we did a lot more progressive releases of the changes we NCI running so we could see what was breaking and like the final was like 30 lines of code for the for work for 1 operator it was mainly 1 person part-time kind of working on pushing it through time which was pretty significant then also having a dedicated team so depending on the scope of the change in the making of someone's part-time job doesn't really work in a lot of cases so dedicating people to have for a short period of time make a big difference and then being able to ship isolated production servers has been a big deal for us so we've been able ship some of these changes particularly the marshalling changes to a subset of service so we can actually investigate how it's gonna work in production and see how those changes are going and take a back and then we can roll them back really easily without impacting uses very much sets it if you wanna talk about so
many things in and I don't know if we have any time for questions but I'll be around and just talk about how we've like kind of kept shop like going on rails and like happier kind of show you guys what we've been doing a talk though will be doing thank you Hi level and you will find that the that was in in a in
Quelle <Physik>
Gewichtete Summe
Lineare Regression
Translation <Mathematik>
Ordnung <Mathematik>
Quelle <Physik>
Generator <Informatik>
Ordnung <Mathematik>
Reelle Zahl
Endogene Variable
Mobiles Internet
Ganze Funktion
Binder <Informatik>
Komplex <Algebra>
Parallele Schnittstelle
Konfiguration <Informatik>
Web Site
Total <Mathematik>
Speicher <Informatik>
Leistung <Physik>
Fundamentalsatz der Algebra
Physikalisches System
Objekt <Kategorie>
Dreiecksfreier Graph
App <Programm>
Befehl <Informatik>
Güte der Anpassung
Mobiles Internet
Dienst <Informatik>
Rechter Winkel
Content <Internet>
Dienst <Informatik>
Open Source
Service provider
Skript <Programm>
Inhalt <Mathematik>
Parallele Schnittstelle
Gerichtete Menge
Protokoll <Datenverarbeitungssystem>
Elektronische Publikation
Patch <Software>
Attributierte Grammatik
Kartesische Koordinaten
Web Services
Prozess <Informatik>
Mixed Reality
Kontrast <Statistik>
Figurierte Zahl
Divergenz <Vektoranalysis>
Inklusion <Mathematik>
Zentrische Streckung
Verkettung <Informatik>
Twitter <Softwareplattform>
Geschlecht <Mathematik>
Ganze Zahl
Proxy Server
Framework <Informatik>
Cross-site scripting
Elektronische Publikation
Diskretes System
Endogene Variable
Mapping <Computergraphik>
Formale Sprache


Formale Metadaten

Titel Riding Rails for 10 Years
Serientitel RailsConf 2015
Teil 14
Anzahl der Teile 94
Autor Duff, John
Lizenz CC-Namensnennung - Weitergabe unter gleichen Bedingungen 3.0 Unported:
Sie dürfen das Werk bzw. den Inhalt zu jedem legalen und nicht-kommerziellen Zweck nutzen, verändern und in unveränderter oder veränderter Form vervielfältigen, verbreiten und öffentlich zugänglich machen, sofern Sie den Namen des Autors/Rechteinhabers in der von ihm festgelegten Weise nennen und das Werk bzw. diesen Inhalt auch in veränderter Form nur unter den Bedingungen dieser Lizenz weitergeben.
DOI 10.5446/30697
Herausgeber Confreaks, LLC
Erscheinungsjahr 2015
Sprache Englisch

Inhaltliche Metadaten

Fachgebiet Informatik
Abstract Over 10 years ago the first line of code was written for what would become Shopify. Within this codebase we can see the evolution of Rails from the early 0.13.1 days to where we are today, on Rails 4.1. Through the history of this git repo we can revisit some of the significant changes to Rails over the years, and simultaneously observe what has withstood the test of time. By looking at the challenges that we have overcome while building and using Rails, we can inform future decisions so that we can continue to build a framework, and applications, that last years to come.

Ähnliche Filme