Hey friends today. I am hanging out at Hollywood Studios I came here today because I wanted to have a fun day at Hollywood Studios But also I wanted to find out how park hopping affects rise of the resistance boarding groups because there's some kind of like little Claws or stipulation when it comes to park hopping and getting a boarding group. So Let's go do this Another thing that I'm excited to see is if the crowds actually drop down at 2 o'clock because that's when park hopping is allowed So you have to be in the park until 2 and then you can go to any other park You can do all four parks because we did that on New Year's Day itself But does that mean it's gonna drop down for like a just a a brief hour like you know I mean are people gonna leave at 2 o'clock and then some people are gonna come here at 2 o'clock But there might be that time in between where rides might be a walk on I did actually confirm and this is kind of like Just logic that you need to be at Hollywood Studios for your first park So like you can't go to Magic Kingdom Animal Kingdom or Epcot. You can't make a reservation for those three parks To plan to go there and then try to join a boarding group at 7 a.m So it is pretty simple does not like a big mystery there And that's why they moved the boarding group from 2 o'clock to 1 o'clock So 7 a.m. And 1 p.m. Are the only times that you can actually get it So I guess to make it real simple if you plan on doing park hopping and riding rise of the resistance in the same day Hollywood Studios is the place you need to make a reservation for your first park and right now it is 143 so in about 20 minutes the ability to park hop is gonna be Accessible to all these guests that are here and like I said it'd be nice to see a drop in wait times just for like Maybe an hour or two, but from the looks of it. I don't think it's gonna happen Especially because Toy Story Mania is actually now queuing up at the old Toy Story Mania building I've never seen the line out here this far and I haven't seen these doors open in a while But this is the line for Toy Story Midway Mania Look at this like this is where you get in line I used to stand right here and actually just wait to go to Toy Story Midway Mania right inside those doors That was really cool to be back there again. I'm so happy that it's opened up It's not open for just like social gathering But I did ask if I can just take a look see in there They're just using it as an extended queue for Toy Story Midway Mania and it's crazy that all the incredible stuff is all back There is still I know that they shut that down I think last year because it was the incredible summer like celebration, but they just left everything up there So maybe it'll open back up again But Toy Story Land is just overall busy This is the line to get in Midway Mania and this is the line to get in slinky dog dash Both of them are actually going all the way out there around 50 to 60 minutes each So I don't think that the wait times are gonna drop down much at all. I Also love that I'm walking around Toy Story Land with my woody shirt from RSVLTS These shirts are so awesome I absolutely love this and I actually have another woody one and a Buzz Lightyear one that I'm gonna actually Break out anytime I come to Hollywood Studios now and Wow even alien swirling saucers is at a 40 minute wait and the queue is actually outside Oh, the queue is actually running right into smugglers run It looks like look at they just have like a little separation point right here to here Wow It is a very busy day. It is a Sunday So we'll just see if these actually drop down by two o'clock, which is not too far away And for now I think I'm gonna go get something to eat and give it some time So that we can see if the wait times die at two o'clock and there's a place that I've been actually wanting to eat for a while The famous original Pizza Rizzo the best pizza on the planet a lot of people say it's the worst pizza on Disney property But I don't think there's like any standout pizzerias on Disney property a couple good restaurants can sling a pie But nothing like that hometown family owned and operated pizzeria So we're gonna get something to eat here and who can go wrong with some pizza I'm also gonna show you one of my favorite places to come sit down and relax at Hollywood Studios This one's such a gem And here is my pizza 11 bucks for three meat pizza apple slices and a cup of water I think that's pretty affordable. Thank you. And now we're gonna take our pizza pie All the way up to the second level This is one of my favorite places up here and it's actually really quiet usually so it'll be nice to see if it actually started Getting more popular recently Looks like it has got popular I've had so many dancing episodes in here. It was so amazing always a great time hanging out here The music the lights the disco ball the dance floor They usually don't have a table on the dance floor usually that's just for dancing Gives you a little details right here I always call it a prom room But it's actually a wedding room and it could be for anything but featuring DJ electric mayhem playing the greatest wedding hits of all time BYO BP BYO B&P Bring your own beer and pizza Now they're playing footloose. Oh boy This pizza is really good. Actually, it's not that bad. I really do like it. I like the sausage too Take a look at the crust and I'll about to give it a rating Because you know one bite everyone knows the rules. I would probably say Fortune I think that's fair a fortune That was absolutely amazing a little bit greasy But I did get apples instead of a salad because now I could take my apples and maybe munch on them later Or hopefully I don't forget about them and then I have a bunch of soggy apples in my pockets later. I Only say that like that because it wouldn't be the first time that I put some apples in my pockets and then forgot about them I got home and realized I got a bunch of soggy apples in my pockets But now it is 2 23 park hopping is an option So let's check on the wait times and see if they went down a little bit But also you guys ever want to find a restroom. That's pretty secluded this one right here hardly no one's in there Now I think I'm just gonna walk through the same way I came in checking the wait times so we can see if there's a big difference It's only been about 35 minutes But that two o'clock hour happened in between that 35 minutes So let's see if that really did have a play on it. I don't know I don't know if there's a good way to tell if it's from that or if it's just from the line going down But we'll see It looks like the alien swirling saucer line literally just Disappeared this was all full everything was full here. It was like a 40 minute wait. I think it said and now It's a 10 minute wait. Holy moly Even though it's a great ride. That's really not a ride We can judge to see if the wait time has dropped at all that 45 minute in that whole gigantic extended queue Could have been maybe because of a cleaning so we'll check out some other rides That's just the first one we came on and it literally the line literally disappeared Toy Story Midway Mania dropped Huge it is now 40 minutes and the line is right out here. So like that was that's crazy That's absolutely mind-blowing crazy to think just about 30 minutes ago The line to get in here was all the way back here They did leave some of the signage up like right there But they took away the sign holder and like it's all the way up front there And now it's just kind of open. So we can kind of like maybe poke around in here I don't know. I thought that you can only go in here and just get in line But since there's no line and they left the doors open and all the cast members that were working for Toy Story Midway Mania attraction aren't here anymore. So I guess we can just enjoy it Well, that makes me kind of happy Right inside this door is where Edna mode used to meet look at just kind of just sitting in there Can you imagine if Edna mode just popped out of the corner and started yelling at me? Honestly out of all the character meet and greets at Disney some villains can be actually Intimidating to actually do a meet and greet with it Edna mode is the only non-villain that I felt like it was a little intimidating because she's you know Darling and she doesn't like the way you dress and it was a great meeting there. It really was it was fun And it was definitely creative This is where you used to walk in I think this was the standby line for Toy Story Midway Mania and then on this side I think that was the fast pass So crazy seeing it now it's an abandoned and incredible celebration But who knows maybe they'll just bring it all back. I mean there's no reason To keep everything up like this if they didn't have plans to oh Wait, they're actually shutting. They're closing the gates Oh, no They are shutting us out Yeah, they are shutting it down actually so you can't just like linger down here They said it was fine that I'm back here There's actually other people back here with me But they said they're just gonna close it down because they don't need it anymore And it's so funny because when they start closing the gates I felt like singing like frozen tell the gods to open up the gate Another really cool thing is you can see a little bit of a streets of America's scrim right there Isn't that fancy? Wow You can also see all the different uniforms still in there. Look at that. Isn't that really cool? Just show you so we got elastic girl And we got Mr. Incredible right here, too It's all just sitting in there really nifty That was really cool to hang out back there I don't know. I think it's opened up like that maybe during the afternoons a lot of times Especially in the weekends, but it was just nice because that was the first time I've been able to experience a little bit of the old toy story midway mania entry. It's really nifty brings back memories I guess in conclusion after seeing the lines for slinky dog dash and Mickey and Minnie's runaway railway I don't think the lines actually drop at all between two or three You would think that they would because there's so much transit of people actually leaving and coming But no it just kind of stayed steady right through It's a little strange though when I came here on New Year's Day The Christmas music was gone and now it's like two days after New Year's Day and the Christmas music's back I mean, I'm not gonna complain because I love the Christmas music, but I was just a little thrown off by it It looks like rock and roller coaster has been down all day long So that could be a reason why some wait times are a little bit longer than expected You know this one is actually very popular and the ride line for this is so long because It's very hard to socially distance in the queue. So they actually like Extend it all the way out up on Sunset Boulevard sometimes In fact, the cast members just told me that that's the third consecutive day that rock and roller coaster has been down So something major happened there. Wow. I didn't even notice Hi Speaking of the Incredibles look at this Here they come. Oh in Edna mode She's in her Edma mode mobile that sounds funny the Edma mode mobile Hi, oh, yes. Oh, yes, and just a fun relaxed day here Just wanted to see what it was like if I could have rode some rides I definitely would have but the lines really didn't drop down that much at all I mean, they always drop down at night time like when the park is about to close But I thought maybe between like two and three or two and four even but nothing Anywho's I still had fun just coming here checking it all out eating a pizza riso Seeing some characters and exploring around the old Toy Story midway media entrance That was actually a lot of fun and now I think I'm done here. So I hope you enjoyed the video I enjoyed making it. I Still have my apples. Look at that And they are sorry, so we'll see you next time


at the start of the pandemic, we had gotten the mission to really create a system for where there was none. There were no moodles, there were no e-learning systems at these schools. It was very basic, very frontal learning and we were supposed to build a system that can host up to 7,000 schools. We were able to provision over 3,000 of these schools which host over 1.4 million students.


Live from Atlanta, Georgia, it's theCUBE, covering AnsibleFest 2019, brought to you by Red Hat. Okay, welcome back everyone, it's theCUBE's live coverage here in Atlanta, Georgia for AnsibleFest 2019. I'm John Furrier with Stu Miniman, co-host. Our next guest is Massimo Ferrari, product manager with Ansible Security, welcome to theCUBE. Thanks for coming on. Thank you for having me. So, security is obviously a big part of the conversation in automation. Making things more efficient, you know, security, making security driving a lot of automation, obviously job performance, among other things. Red Hat's done a lot of automation in other areas outside of just configuration, network automation. Now, security, looking kind of like the same thing, but security is certainly different and more critical. It is, it's more time sensitive. I guess through the security automation angle, what's going on? Well, basically, there are several things going on, right? I believe the main thing is that IT organizations are changing. Honestly, IT organizations have been changing for the last five years, 10 years, and as a consequence, the infrastructures to be protected are changing as well. And there are a couple of challenges that are kind of common to other areas of it. As you said, automation is all over the place, so clearly there are some challenges that are common to IT operations or network operations, something that is peculiar for the security space. What we are seeing, basically, is that if you think about, there's a major problem of scale, right? If you think about the adoption of technologies like containers or private public cloud, if you're a large organization, you're introducing those technologies side by side with, for example, your legacy applications on bare metal or your fantastic virtual machines, but what they do, actually, is introducing a problem of size, a problem of scale, and a problem of complexity connected to that, and a problem of distribution, which is just unmanageable without automation. And the other problem, which is complexity that I mentioned before, is that I wasn't specifically referring to the complexity of the infrastructure, per se. If we think about adopting best practices or practices like microservices or adopting functions of service, we can easily imagine how an old school three tiers application can be re-engineered to become something like we've made of 10 hundred components, and those are micro components very focused on single things, but from a security perspective, those are ingress points. And what automation did, well, automation proved to be able to do is to manage complexity for other areas. So you can be successful in the operations in network and clearly you can be successful in security. But what is unique to security is that professionals are facing a problem of speed, which means different things, but to give you an example, what we are seeing is that more and more cyber attacks are using automation and artificial intelligence. And the result of that is that the velocity and the impact of those attacks is so big that you can cope with human operators. So we are in a classic situation of fighting fire with fire. So this is a great example. We had the service guys on earlier talking about the automation platform, and one comment was you don't want to boil the ocean over, focus on some things you can break down and show some wins. Security professionals have that same problem. They want to throw automation and AI at the problem. It's going to solve everything. And so it's certainly very valuable. Managing configurations, open ports, S3 buckets, there's a variety of things that entry points for hackers and adversaries to come in, take down networks. What's the best practice? How do you see customers applying automation? What's the playbook, if you will? What's the formula for a customer to look at security? So how can I direct Ansible at my security problems or opportunities to manage that? When you discuss security automation with customers, it really depends on the kind of audience that you have. As you know, security organizations tend to be fairly structured, right? And depending on the person you are talking to, they may have a slightly different meaning for security automation, it's a broader practice in general. What we are trying to do with Ansible security automation is we are targeting a very specific problem. There is a well-known issue in the security world, which is the lack of integration. What we know is that if you are any large organization, you buy tens, hundreds sometime of security solutions. And those are great. They protect whatever they have to protect, but there is little to no integration between them. And the result of that is that security teams have an incredible amount of manual work to do just to correlate data coming from different dashboards or to perform an investigation across different perimeters, or at some point they have to remedy it, something that is going on, and they have to apply this remediation across groups of devices that are sparse. And what we are trying to do with Ansible security automation is to propose Ansible as an integration layer, as a glue between all those different technologies. To, on one hand, is a matter of, you know, become more efficient, streamline the process.  Because security, as I say, is time critical, and so automation becomes, in this context, become even more important. Massimo, with the launch of the Ansible automation platform, we see a real enhancement of how the ecosystems participating here. Where does security fit into the collections that are coming from the partner ecosystem of Ansible? Well, in one way, we have been building over the shoulders of our friends and network automation. They did an amazing job over four years. They did two major things. The first one is that they expanded for the first time the footprint of Ansible outside the traditional IT operations space. That was amazing. And we did kind of the same thing, and we started working with some vendors that were already working with us for slightly different use cases, and we helped them to identify the right use cases for security, and expand even more what they were capable of doing through Ansible. And what we are doing now is basically working with customers. We have, you know, a lighthouse customer, we call them, the guy that has to understand which is the next step that we are supposed to perform, and we are gathering together a security community around Ansible. Because, surprisingly, we all know that the security community has always been there, always been super vocal, but open-sourcing security is a fairly new thing, right? And so we have this ability. The important thing is that we all know that Red Hat is not a security vendor, right? We don't want to be a security vendor. That's not the ambition that we have. We are automation experts in the case of Ansible, and we are open-source experts across the board. So what we are doing with them, we are helping them to get there, to cooperate in the open-source world. And for security, it proved to be very interesting the adoption of collection, because in some way allows them to deliver the content that they want to deliver in a very, I would say, focused way, and since security relies on, again, is a matter of time to market or time to solve the problem. Through collection, they have more independence. They are capable to deliver whatever they want to deliver, when they want to deliver according to the start. One of the things you mentioned, glue layer, integration layer, and open-source user expertise and automation, is interesting, and I want to get your reaction on this, because we did a survey of CISOs on our community, prior to the Amazon Web Services Reinforce Conference. This past summer was their first inaugural cloud security, so yeah, cloud security is a big part of it, but with on-premise and hybrid and multi-cloud here, on the, being discussed, this notion of what cloud and role of enterprise is interesting to the CISOs, Chiefs of the Information Care Officer, and the trend on the survey was, is that CISOs are rehiring internal development teams to build stacks on site in their own organizations, investing in their stack, and they're picking a cloud and then a secondary cloud, so as that development team picks up, that seems to be a trend. One, do you agree with that, and if people want to have their own developers in-house for security purposes, how does Ansible fit into that glue layer? Because if it's configuring all the gear and all the pipes and plumbing, it makes sense to kind of think about that. So this might be a trend that's helping you? So the trend, there is a general trend in the corporate enterprise world, that more technical people are coming into traditionally, in areas that are traditionally under the purview of other people or domains, right? So we saw more technical people coming into business lines. We are seeing more developers coming into security. That's certainly a trend. It's a matter of, you know, it's again, it's a matter of managing scale and complexity. You need to have technical people there. So in one hand, that help us to create a more efficient and more pervasive community around security. You have developers there, which means that you need to serve that corner case that you are not targeted at the moment. You have talented people that can cooperate with us and build those kinds of things. And use the open source software. Exactly, well that's the entire purpose, right?  That's the entire purpose. So you do see the trend of more developers being hired by enterprises in-house? It certainly is. And it's been going on for about, like probably three to five years, I've seen that. In other areas, mainly in the business area, because they want to gain that agility and want to be self-contained in some way. Business want to be self-contained security in some sense is going in the same direction. That feeds clearly one angle of Ansible, so you have more contribution in the community. On the other end, what we are trying to make sure is that we support the traditional security teams. Traditional security teams are not super-development oriented, right? So they want to consume the content. Well DevOps is always infrastructure as code implies that the infrastructure has been coded. And if you look at all the security breaches that have been big, a lot of them have been basic stuff and exposed as three bucket. Is that Amazon's fault or is that the operator's fault? Or patches that aren't deployed? You guys are winning in with Ansible in these areas. This seems to be a nice spot for you guys to come in. I mean, can you elaborate on those points? And is that true? And you guys winning in those areas? Because I mean, I can see automation just solving a lot of those problems. Well there is, I will say something not super popular, but as a security community, we always been horrible at the basics, right? We've been, like any other technical people, we are chasing the latest and greatest, the fun stuff. The basics, we are always been bad at that. Automation is a fairly new thing in security. And what we all know that automation does is providing you consistency and reduce human error. Most of the stuff is because somebody forgot to configure something, some one forgot to rotate a secret or something like that. They didn't bring their playbook to the game. So I'm not trying to fly the parallelism here, but the point is that the same benefits that get the automation. There's just no excuse if you have automation, you can basically load that patch or configure that port properly because a playbook exists. This only helps. Absolutely, but those are the basic values of automation. You communicate in a slightly different way to security because they use different language and for them automation is still a new thing. But what you heard during the keynote, so the entire purpose of the platform is to help different areas in the AT organization to cooperate with each other. As we know, security is not a problem of IT security anymore, it's a broader problem and needs to have a common tool to be solved. In the demo in the keynote this morning, I thought they did a good job showing how the various stakeholders in the organization can all collaborate and work together. Wanting to explain how security fits into that discussion, and also they added the hardening piece in there, but I would expect for many companies that I want to flag when I'm creating this image that it's going to say, hey, have you put the right security policies on top of it? Not something that they just, oh, it's one of the steps that I do. How do we make sure that everybody follows those corporate edicts that we have? Well, it's mainly a matter, I want to use the play the usual card of cultural change, but the fact is that security, especially, we are looking at two major shifts, and one of these shifts is that pretty much everyone, I would say private organization and government, kind of a knowledge that security, cybersecurity is not an IT problem anymore, it's a business problem, right? Being a business problem, that means that the stakeholders involved are in all different parts of the organization, and that requires a different level of collaboration. Collaboration starts with training and enablement of people to understand where the problems are and understand that they are part of the same process. We used to have security as an highly specialized function of IT. Right now, what happens is that, if you think about a data breach, a data breach could be caused by an IT problem, but most of the impact is on the business, right? So right now, a lot of security processes are shifting to give responsibility to the business owners, and if the government is involved, I live in London and in Europe for another month, I guess, we have this fantastic thing that you know, it's called GDPR. GDPR forces you to have what is called a data breach notification process, which means that now, if you're investigating a cyber threat, you want to have legal there to make sure that everything is fine, and if this data breach could become a media thing, you want to have PR there because you want to have a plan to mitigate whatever kind of impact you may have on your corporate image. You may also want to have there, I don't know, customer care, just to handle the calls of the customer, worry for the data. So the point is that this is becoming a process that needs to involve people. People needs to be aware that they are part of this process, and on what we can do as an automation provider, we are trying to enable through the platform, the IT organization to cooperate with each other. You know, having workflows, having the ability to contribute to the same process allows you to be responsible for your piece. Massimo, the new security track here at the show this year, for those that didn't get to come or maybe that didn't get to see all of it, some of the highlights you want to share with the audience. So this year, the general message this year is there, is the first time that we have this fantastic security track, and this is not a security conference, it's never going to be a security conference. So what we are trying to do is to enable security teams to talk with the automation experts to introduce automation in that space. So the general message that we have this year is, what the desire is to create a bridge between the Ansible practitioners, the Ansible heroes, whatever you want to call them, to understand what the problem is, what the problem could be, and have a sort of a common language that can use to communicate. So the message that we had this year was, is go back home and sit down at the same table with your security folks and make sure that they are aware that it's the new possibility and you can help them that you now have a common tool together. We have a couple of very interesting tracks, we have partners, a lot of partners are contributing to security space, we mentioned that before, and most of them have tracks here and they are showing what they built with us, what are the possibilities of those tools. We have a couple of customer stories that are extremely interesting, that just came out from a session presenting one of our customer stories. And in general, we are trying to show also how you can integrate security in all the broader processes, like the mythical DevSecOps process. What's been the feedback from customers specifically around the talk and the security conversations here at Ansible Fest? It wasn't unexpected, but it's going particularly well. We have very good, we have very good feedbacks. And we have, we kind of... What are they saying? Well, they are saying something, okay, the best quote that I can give you, the customer told me, this year I learned something new. I learned that we can do something in this space we never thought about. Which is a good feedback to have at a conference and a lot of people are attending this session. We have quite a lot of security professionals that was kind of unexpected. So the old sessions are pretty full, but we also are seeing people that are just curious, they are coming in and they are staying. They are paying attention. So there is the real opportunity. They see the same opportunity that we see. And hopefully that will bring the message home. Massimo, thank you for coming on theCUBE, sharing your insights. Certainly security is a main driver for automation. One of the key four bullet points that we outlined in our opening. Thanks for coming on. Thank you very much for having me. And sharing your insights. This is theCUBE coverage here at Ansible Fest 2019, where Red Hat's announced their Ansible Automation platform. I'm John Furze, Stu Miniman. Stay with us for more after this short break.


Hello, Freedom Family. It's been another 10 days since my last video. I'll do a proper punishment more than just a little hand-slap-y thing. In the meantime, I want to update you on a few exciting developments. Last time I mentioned we have two game projects that we were considering investing on. We made a lot of progress towards one of those deals and I'm going to share with you as soon as we sign the documents what the project is and how you can get involved in the game. I can tell you it is an MMO. It will have a closed beta, the final closed beta, before launch pretty soon and I hope some of you will get access to that so you can play it, make videos about it, and tell us what you think. More on that soon. We just paid you 1.9 million dollars Freedom Family for all your hard work in June and July because some of you opted in for advanced payments. That's why you got your July payment when many of you only got your June payments. Do you want to get what paid 30 days early? Click that I to find out how it's called advanced payments in the Freedom Dashboard. I returned from my trip to Vietnam with a lot of great news that I can't share with you yet because that's another deal that needs to close before I can talk about it. All I can tell you is it will be a huge benefit to freedom because it'll expand a lot of the things we can offer for you for all markets not just Vietnamese and I can't wait to tell you more. We also completed a shiny new MSI 3D set that I will show you in the next video and two of you have gotten 110% revenue share that I gave you just a few days ago.  I will announce those two winners in the next episode of the George Show because I'm running short on time on this episode again I apologize and there will be a lot more winners of the 110% revenue share which is part of our $100,000 sponsorship. Click that I to learn more. I will be flying on a jet plane in a few hours again traveling again I know what are all these trips for George these will all lead to good things for the Freedom Family I promise for now who am I I am Papa George George Sunpai and the guy who hasn't been reading your comments sorry about that I will fix that in future episodes and the guy who hasn't been announcing the what are we watching where you introduce the George Show sorry about that I'll be fixing that in future episodes I am George CEO and founder of Freedom for Freedom and the Freedom Family amazing people who are helping each other grow together as a family because that is the spirit of freedom we all help each other grow together as the Freedom Family see you in the next episode of what you've been watching which is the George Show unedited wow I got that really wrong see how long it's been I've forgotten how to end my episodes so sad yeah bye click that I to partner with Freedom and join the Freedom Family so we can all grow together you get many perks like position music you also get epidemic sound a lot of other access to royalty-free videos sponsorships and many things to help you grow just click the links down there in the description below to get involved in our community our forums our discord chat servers meet our graphics team meet our community team all of that on discord and the forums what are you waiting for get started and we will grow together as a family because this is the Freedom Family you are part of it we are all part of it and we're all growing together to get more George click that big F that will subscribe you to Freedom Central home of the George Show and PewDiePie gave one of you Freedom Family a big shout out click that video to see the shout out and to see our new 3d sets for you and click that video to see what YouTube recommends you watch next


American trail is blood, depended in blood. Chapter 8, on to Monterey. August 25th, 1843, Utah Territory. Red, yellow, blue cliffs rise up on all sides. Sunset, fierce, barbaric, hostile. The man is Captain John Fremont. The government wants a route survey that will connect the United States with the Oregon country. Fremont is the man for the job. Four months ago, he left Kansas. He is west of the Rocky Mountains now. 15 men with him. One howitzer gun. And a hunter named Carson. You're working on that, Dari, Captain? Yes, I'll need these notes when I get back to Washington. I sort of keep thinking about broken-hand Fitzpatrick. He's all right, guys. Maybe we should have all stayed together. By the time we get to the Oregon country, broken-hand will be there waiting for us. You're most likely to get to Fort Hall before we do. That was no coyote, Captain. Indians? Johnson, what is it? I ain't sure, sir. You see something? I just ain't sure, Captain Fremont. I'll take a look around, Captain. I get some sleep. Indians won't attack if they know we're on the watch for them. September 8th. One week south of Soda Springs. Searching for the great Salt Lake. Something else. Something I can't even talk to Carson about. Not yet. Our final destination should be the Columbia River. The job will be done. Yet? Yet I know I must go on from there. That can wait. Our party's even smaller. The men on the Fort Hall for supplies. The rest of us are in marshlands surrounded by mountains. Real slowly around here, Captain. Yeah, I'm breathing it. I feel it in my stomach. It's your kind of thirsty. Hey, guys, and your face is covered with salt. You better wipe it off. Marshlands glisten with salt. We've ridden to higher ground. An ocean in the middle of the desert. All the way to the horizon. Further than you can see. Hey, there are mylons out there. Look at them mylons. A tropical jungle island. Do you reckon anything lives on? Animals. Tomorrow we'll take the rubber boat out. We'll explore the lake, the island. It's a real good thing there's only four of us in this here boat. Huh? It sprung half a dozen leagues. Carson, something wrong, Cam? The island. You see anything wrong? Carson, take these glasses. Have a look. Captain, I don't see nothing but a rock. No trees, no? Nothing at all. Just bare and rock. Nothing but rock. Captain Femont, we're taking water. You sure are, Captain. Start bailing. I expected to see so much on that island. Can't keep bailing, brother. This boat's going to sink. All right, now. Come on, we're almost in shallow water now. We'll be able to wait ashore. Most likely the first human voice is to break the silence of this island in a million years. Good night. Until we can patch the boat out. Well, anyhow, I won't have to bother none about Indians tonight. In the morning, I can draw a map of the lake and I can see it from here. We'll push on to Fort Hall. September 15th, Oregon Trail. The men I sent on to Fort Hall have returned. Rogan Han Fitzpatrick is with him. Captain, my boy, we couldn't bring much food. Food's a scarce commodity up at Fort Hall. Well, how's that? Well, it's the settlers moving into the Oregon country. They're just about to clean up all the food at the fort. Hey, I reckon we can get enough to see us to the Columbia River broken half. Well, it's quite a problem, Kit. Well, we don't all have to go to the Columbia. I think we can send some of the men home, as a matter of fact. October 28th. They camp beside the Dallas of the Columbia River. Rock walls overlook deep, dark whirlpools. No sound, no foam, no ribbon. An accurate map has been charted from Kansas to the Oregon country. Still the dream I've had for many weeks stays with me. The great, unknown country to the south of here. What are you thinking about, Captain? I was thinking of somewhere in the Sierra Nevada. Sierra Nevada? The Buena Ventura River. Captain, you ain't got no idea. The river's never been surveyed. But, but Captain. No one's even sure where it is. Well, it's on maps. Yeah, but every map is different. Captain, we wouldn't have food enough. Oh, Buffalo, dear. We'd find food and travel light. The winter's coming. We'll be in the river country before then. Close through a valley, mild climate, even in winter. I ought to have my skull examined for even listening. Travel light, you said, Captain. We'll leave the heavy equipment. What about the howitzer gun, Captain? We'll take that. December 10th. Excitement at the prospect of locating the Buena Ventura. We're pushing through a hill country where no white men have ever been before. The Indians seem hostile everywhere. Smoke signals. We've hauled it. I'd stand precious little chance that we're attacked. Eh, if we could discourage them. Well, they might be kind of hard to discourage, Captain. They're coming. Look. Down on hill, Captain. See them? On hits the howitzer. Load it. Hurry up. Howitzer's big glory, yes. Get some use for guns. I can help you. Rugged eyes. Load the howitzer. Now if this fails, get ready to fight. Fire! After me, boy, they're running for their lives. Captain, this is the first time I ever took a liking to that dare gun. January 3rd. We move across Black Rock, desert land. Heavy fog, and the cold. The river can't see more in a few yards in any direction, Captain. Well, at least we're hidden from the Indians. January 15th. Pine Forest. We must be coming to the Benaventura River. Carson is going ahead looking for beaver signs. That'll tell us we're close to a river flowing seawards. All the men are looking forward to seeing the river. It'll be a moment of triumph for all of it. January 16th. The river must be at hand. Not in one ravine or valley then in the next. We're close by. January 17th. The river is somewhere in this country. We've tried all directions in the next ravine, perhaps, or the next. January 18th. Where is it? No sign of beaver tracks to indicate where it could be. Where is it? Benaventura. Another legend. Another legend like the jungle islands in the Salt Lake. All these fools who... We might have missed the river. No, it doesn't exist. I reckon we came a long way for nothing. I wouldn't say that. We found there's no such river. Now we know. What now? Now? We're low on food. We can't go back. We've come too far. Well, Captain California is just on the other side of these mountains. It's late in the year, but we can try. If we can find a path. We must find a path, Captain. All right. We turn off. We'll try to cross the theater as we have no choice. 100,000 feet high. I keep a record of the days. We've shot a few birds, but today we've seen no sign of any. In the silence of the Sierra Nevada. Snow. 100 feet deep in places. The gun has been left behind. We go on. On hunger. Hunger in frozen bodies. Starvation is there in me. Oh, what one of the men. Dave. Captain Freeman. Snow so soft. Let me sleep. Let me sleep. Later now. Later. No. No. I'm hungry, Captain. I can just sleep. I won't care so much. Give me food. Give me food. I want food. We better strap them to a saddle, Captain. All right. Help me. No. Let me sleep. Eating most of our clothing. Leather jackets. Foot gear. Half naked now. Living skeletons. Frozen. We stared each other looking for signs of madness. Much commenced. Much more. See something, Captain. That's what I saw. Friendly Indians. Employed by a white man named Sutter. On March 6th, Fremont made his way into Sutter's fort in the Sacramento Valley. For the first time, an accurate survey had been made of the country from Kansas to Oregon. From the Columbia down through the Sierras into California. As America entered yet another era of expansion, new states grew up in the great mountain regions as the covered wagons rolled westward, ever westward, on to Monterey. This has been the eighth chapter in the story of the American nation brought to you by the ladies' auxiliary to the veterans of foreign wars. Next week, another story to make you proud of this great country of ours as we follow the American Trail.


I'm also known by the name of Grand Maester Nate. I'm an expert in Rails magic. I've forged my links at the Old Town Great Citadel. Just kidding, Rails is not actually magic. DHH does not actually sacrifice chickens in his backyard to make all of the components work. So we're going to talk a little bit about some of that magic today, being the different parts of the Rails framework and how they all fit together when you type Rails new and get this huge magic set of folders and files. What are they all actually doing for you? And can we get rid of all of them and put a Rails application in a tweet? Again, my name is Nate Berkepeck. You may have seen my blog online, a blog at NateBerkepeck.com. I also have a course called The Complete Guide to Rails Performance. Normally, talking about performance and Ruby's speed is kind of my shtick. That is at railspeed.com, that course. We're not going to really talk about performance today. There is some performance benefits to this talk, which I'll talk about, but they're not really the most interesting part. I think what's interesting here is the underlying modularity of what Rails can do for you. But first, let's do a little word association. Let's do a little psychoanalysis on all our poor Rails developer minds here. When I say Rails, what do you think of? Do you think of bloated or light weight? When you have a Rails application and it's 50,000 lines, does it feel a little bit like this? When you think of Rails, do you think well-architected or do you think of spaghetti code? I've heard action controllers described as a crack den of inheritance. Do you think of object-oriented when you think of Rails? There's a Ruby web framework formally known as Lotus, not known as Hanami. I don't know if they still say this in their marketing, but they used to say that Lotus aims to bring back object-oriented programming to web development, which left me wondering where did it go? And who is bringing OOP back? When you think of Rails, do you think of modular or monolithic? There are many people on Stack Overflow who complain about CSRF not working, and the common advice is to just turn off CSRF protection. Surely that by itself is proof that people should only turn on this feature when they need it. Presumably, whoever wrote this comment also probably thinks that SSL breaks things and so all of us should just not verify our SSL certificates. When you think of Rails, do you think of fast or do you think of slow? Does your Rails application sometimes feel like it's going at a bit of a leisurely pace? Oh, wait, wait, what's that sound? Oh, it's a plug. Oh, I wrote a course about fast Rails applications. Oh, it's at realspeed.com. All right, that's all. I'm going to stop talking about it now. I'm going to stop talking about it now. My thesis here is that although we have a lot of negative mental associations sometimes, I think, with Rails, I think it's actually a lightweight, well-architected and modular framework for creating speedy web applications, but it just doesn't advertise itself that way. I think a lot of this comes from the way that our BDFL DHH talks about Rails. In his keynote last year at Rails Com 2015, he described Rails as a kind of prepper backpack for Doomsday. He wanted to be able to rebuild Basecamp by himself if all of the internet went down and he only had Rails left. He wants Rails to be able to do everything and to be able to rebuild Basecamp with just everything that comes in Rails out of the box. That's a very expansive vision. That's not like, oh, I'm going to do a one-file Sinatra app and it's going to be cute in blog posts. That sort of vision leads to a very different perception of a web framework than what other frameworks come to advertise as their simplicity or whatever like that. That doesn't necessarily mean that Rails can't be simple or can't be lightweight. What we're going to do in this talk is we're going to take the file structure and the boilerplate that you get from a Rails new command line and we're going to basically just hack it all off until we get down to 140 characters. The first thing we do after we type Rails new is we have to add a controller. Our app has to actually do something. I'm going to add a Hello World controller which is going to render Hello World in plain text. That's the only thing I'm going to add to Rails new. I've got to add a route for this, obviously, and configure routes.rb. At this point, we have 433 lines of code generated by Rails new. That's spread over 61 unique files. That is a lot. That includes the YAML configuration files generated, all the .rb files, the rackup file. It does not include blank lines or comments. This is 433 lines that are actually doing things. That's a lot to wrap your head around. Step one is to just delete all the empty folders and files. We get a lot of folders that are generated by Rails new that just are empty. I have this .keep file to force get to put them into your source control. These folders are otherwise empty. They're just there to serve as a placeholder. Rails doesn't need these things to boot up. It doesn't need empty folders to start an application, which seems obvious in retrospect, but a lot of people keep these folders around with no intent of ever using them. Some of them, the more interesting ones here that we're going to delete entirely are the entire lib folder, the entire log and temp folders. Log and temp will just be recreated if Rails needs them. And the entire vendor folder, because we're just doing a Hello World application so we don't need assets or whether or not they come from our own app or from some vendor. We're also going to delete all the sort of boilerplate empty files that don't do anything. A lot of these files, especially config initializers, a lot of these are just blank with comments. There's no actual code in these. There's no comments that tell you, hey, you should think about such and such decision. Go do that. And a lot of these application job or application helper are just blank modules that don't do anything either. There are signposts that say, hey, you should put such and such code here. They don't actually do anything functional. Same thing with the public directory. We can delete the entire public directory. The files like 500.html and 404.html, when Rails has a 500 response in the production environment, it will try to show the user 500.html. If that file doesn't exist, and you have an overridden Rails' behavior, it will just render a blank 500 response, which for our little Hello World application is totally fine. My point here is that empty is not equal worthless. I think this is actually one of the most important things that Rails Nu does, is create all these empty comment-filled files. Because what it does is it creates a common vocabulary. It says, okay, when I come to a new Rails application, I will go to the app models directory to find the domain model. I know that's where most of the business logic is gonna happen, hopefully. I know that the controllers and all the HTTP-related stuff is gonna be in app controllers. If I'm hacking away in the view and I see a jQuery plugin, I know that that's probably gonna be just gives us this common starting place, which makes it so easy for any company that works on multiple Rails applications or as consultants like myself to go from Rails application to Rails application and say, all right, well I know pretty much how this is organized, because we have this default organization that we've all sort of agreed upon by using Rails Nu. We could hash out this problem every time we started to do application, but we don't. I didn't really realize how important this was until I started doing more work with JavaScript on the server side. It's just like a free-for-all. Some frameworks don't even tell you how to organize anything, so this is especially true, it seems to me, in electron applications, where everyone just sort of has their own folder structure and each app kind of does things their own different way. In Rails, we don't have that problem. We just all have agreed that, well, let's finish it on this, and this is where how we're going to organize our applications. Step two is to delete the entire app folder. Some of these are kind of obvious. Our Hello World application doesn't need assets, so I can just delete application.js, like action cable. I'm a bit of a cord cutter, so I don't use action cable. That was a tender love pun, it wasn't mine. Don't need CSS. It's more action cable stuff. For the controllers, we're going to inline, so we're going to move the actual controller-related stuff that matters into configapplication.rb, and we're going to delete all the views and all the models, everything else in app. The only part of app that we actually care about in a Hello World application is this part, the controller. I'm eliminating application controller. That's just a common, useful pattern to have. You should usually have an application controller that has common behavior between all of your controller classes. If you don't, that's fine. You don't need an application controller. In a one controller application, we definitely don't. I'm just putting it at the bottom of configapplication.rb. I think Xavier Noria's talk, just talked before me in here, is going to be a really good compliment to this talk. If any of this stuff, because I'm going too fast here, is like, well, I don't know why it's in configapplication.rb. He talks about the entire boot process and when this file gets loaded and why it's important that I moved it here. So it's really confusing. I would watch his talk when that gets posted. Step three is delete the entire bin folder. This one's a little more obvious, I think. The bin folder is just full of a couple of useful things that make Rails development easier from a developer's perspective. Two of these files are just really simple best practices. They don't really do anything, and that's bin update and bin setup. These are just example scripts that are just intended to say, hey, successful Rails applications generally have a setup script that sets up a develop environment. It installs Redis and Postgres and all the weird things that your app needs. And so a new developer should just be able to run bin setup and then Rails server and be done. That's just a best practice. Here's an example. So you don't need that file. You can just delete it. Same with bin update, same thing.  What are bin stubs? Bin stubs basically just wrap a gem executable in a little bit of environment setup. So usually it means setting up the load path with bundler or whatever. It might set a constant, like it might say, hey, my app lives in such and such a directory. Now load the gem executable. And that's what actually gets run when we type Rails servers. It should be the bin stub that gets run. And if you actually look at bin Rails and bin rake, you'll see they also use spring. So the bin Rails sets up a new application process with spring, then does what it would normally go and do anyway. We don't need these. What we can do instead, because we're just, all we want to do is set up a little hello world server, is to use config.ru directly and use a command called rackup, which comes with the rack gem. So rackup looks for a config.ru file in the current directory, and then it treats the contents of config.ru as the body of a block inside this code. So it thinks app equals rackbuilder.new, contents of your config.ru file, and then calls .toapp on it. The config.ru file in a generated Rails new application looks like this. All rackup files, that's .ru's rackup, end in run, and then some rack-compatible application. You don't know how rack apps work, I'm going to get to that in a second, but that's all you need to know is we're going to call rackup in the current directory instead of Rails server, and it's going to execute config.ru directly, which is basically what Rails server was doing anyway, just with a lot of other fancy add-ins that we don't need for our little hello world server. So the first step for is to start using only what we need of the actual functional components that remain at this point. We're going to, so at the top of every, everyone's config application.rb, you're going to see require Rails all, and what that does is loads up all the different frameworks in Rails. The truth is that I think many applications don't actually use all the components of Rails, especially API-only applications or very simple ones like the one I'm talking about today, like Hello World. If you actually look at the Rails all file, it looks like this. I think this is the entirety of it, I didn't cut anything out here. It literally just loops through all the different framework components of Rails, requires each of them, and then we're done. So all I've done here is taken that out of an array and done it line by line and commented out the parts that we're not going to use. We're literally just going to use ActionController for this Hello World app. I don't need a database, I don't need ActionView, although ActionView gets loaded anyway. ActionMailer, I don't need it, not going to send any email. I don't need ActiveJob, definitely don't need ActionCable, and I don't need Sprockets, because I'm an API server, so I don't need any assets or have anything to do with assets. So to give you a little history lesson on even why this is possible, a gentleman named Yehuda Katz, who I think is here, not in this room, I mean, he's here around in Rails. He's there, hey, Yehuda! Wow, okay, so this is the second time I've talked about someone's framework in front of them. So in 2008, Merb merged with Rails. He merged his web framework at the altar of Rails, and at the time he had said Rails will become more modular, starting with the Rails core, and including the ability to opt in or out of specific components. This was sort of like a hallmark of Merb. You couldn't do this stuff in Rails, too. It wasn't this modular structure that we have today, but that was the way Merb worked. So when we merged Merb into Rails to get to the Rails 3 release, like extracting these different framework components. Now, some people didn't like this. Jeremy Askinis, coffee script author, had said on Twitter that all forward progress stalled for nearly two years. It's still slower than Rails, too. Bundler is a nightmare, no JS won. Case closed. Thankfully, that doesn't seem to have been the case in the four years since he said that. But I think it is true that Rails 3 wasn't really like a feature release. It was a release for cleaning the internals, making things easier for plugin authors. And part of why I'm giving this talk is I think a lot of the work that went into Rails 3 and this modularity that's been given to us isn't used enough, or at least we're not aware of it enough as Rails developers. So know this stuff so that Yehuda's work was not in vain. So the other thing we're going to lead here is our gem file. The only thing we need in our Hello World application is just gem Rails. So we're just going to get rid of the gem file eventually to get down to tweet size. We're actually going to have to get rid of Bundler, which is annoying, but it does technically work. It's important to know that Rails is very conscientious, I think, of what goes in the gem file and what goes into the Rails framework itself. And everything in the gem file is very much a suggestion. None of it is required to get a Rails server working. None of it is like official, you know, I guess TurboLinks is officially sanctioned, right, because it's in the Rails organization or whatever, but none of it is required, you can get rid of all of it if you want. One area that you kind of saw this happen was with action cable. Someone suggested during the development and the merge, let me just make action cable a gem and then put it in the default gem file. But DHH said, I think action cable at WebSockets is so important that it needs to be in the main framework. It's too important to be just in the gem file. So there's a definite decision being made here about what goes in the framework and what goes in the gem file. And so when you look at that gem file, don't think that anything in there is something that you have to be using. We're also going to dump all of the config files that we don't use anymore because I just got rid of action cable by not loading it instead of Rails with Rails.all or Rails slash all. We're not using ActiveRecord anymore, so I can delete config database.yaml. We're not using Puma, so I can get rid of Puma.rb and I'm not using Spring, so I can get rid of Spring.rb. Then at this point we've got like five files left. And now we just inline everything. So we move five files into one. There are four very important files here. Again, Xavier's talk's really important here. He talks about why there are four different files for all this stuff and why we don't inline them all into one. So we have boot.rb, environment.rb, application.rb and production.rb. And we're just going to put all of these in the rackup file. So they're all going to go into config.ru. And once you do that it looks like this. So this is what I consider the smallest practical Rails application.  So let's walk through this one line by line because I think this is important to understand. We're going to require the rail tie for action controller. We require the rail tie and not action controller directly because there's some stuff that happens in the rail tie that we want to make sure that actually gets run. We're going to define an application that inherits some Rails application. This part right here is exactly the same as it is in application.rb. We have to define a secret key. I got rid of secrets.yaml, right? So I have to define my secret key as a config point. Because this is a toy application I'm just going to set it to some meaningless string. You obviously have to do that for real in a real application. And then I've inlined config.routs.rb inside of my application definition. So normally at the top of config.routs.rb I think it says rails.application.routs.draw So we're just doing that here inside of the application itself. Finally I've got the controller at the bottom of the file here and I have to call initialize on Rails application. This runs all the initializers and all the hooks in rail ties.  So this is the smallest practical Rails application for all intents and purposes. Yeah, listen to that bell. Take a look at that. Oh my god! Listen to that horn! It's beautiful. I know. It really is a work of art. But there's a lot happening here. This is like a 10-line Rails application.  You're running dozens of initializers. Tons of features are still in this Rails application even though it's 10 or 12 lines or whatever. Where I think you can see this the most is in the middleware stack. So there's a stack of rack middleware that each request passes through before it even gets to your router. There was a talk this morning about rack middleware and more about how that works. All you're going to know is basically there are things that wrap your application and are like filters for the request. So first the request goes through this middleware and then that one, then that one, then that one, and so on and so forth. At the very bottom here is where we call the router or it gets passed off to the router. And all these middleware do something. So as some examples here Action Dispatch Request ID adds a unique ID header to every request. Rack Runtime adds a runtime header that says this request took x amount of time. Remote IP protects you from IP spoofing attacks. We have cookies in session store. We have the flash middleware that runs the flash hash. And then we have some middleware at the end for HTTP caching. So all these middleware are all doing things and you didn't have to configure any of them. They're just the default Rails middleware stack. Some of these can be eliminated now in Rails 5. We have this new config point called API only. If you set this to true it will remove the session based middleware down here. I think it removes some more. It's sort of like the similar to when you call an API. One of the things it's going to do is set API only equal to true. You can also delete middleware on your own. So if all of this boilerplate doesn't appeal to you you can just delete each middleware that your application doesn't use on its own. Now why would you do that? Middleware are not free. Each one of these is going to cost $20. Some of them are going to use some slower features of Ruby like block.call. When there's 20 of them here that does start to add up. I'm going to talk a little bit more about that in a second. Here's another hidden Rails modularity feature as we're trying to strip down our app even further. There's a little class called Action Controller Metal which is pretty cool. Action Controller Base and all Action Controller Base is Action Controller Metal plus a ton of modules like 50 modules like a ton of modules. These are just some of them like cookies, strong parameters, force SSL, etc. If all these things don't really mean anything to you that's okay and it's kind of intended but if you do feel like you want to dig into how Action Controller Base works a little bit more, if the idea of a thin controller appeals to you you can inherit directly from Action Controller Metal and build your own controller. So even the render method is actually factored out into its own module so if you inherit from Action Controller Metal basically the only thing you can do is work with the rack response directly and the response body is this. You can't even call render at this point so this isn't 100% equivalent to our Hello World application because this won't set the correct content type but you can basically start here and then just start including all the different Action Controller modules that you need for this particular controller and here's another part where I blow your mind all controllers are actually just rack apps so this is our controller and we can just run that controller in our rackup file as if it was a complete application. The dot action method takes a symbol which corresponds to an action and we can run the dot call method on this object that's returned by this and it's just a rack application. So now we can talk about rack applications. Rack applications, rack sits between Rails and your web server. Rack is like the common language that web servers and Rails speak. This is what allows you to use Pumo, Web Brick, Thin, all between and without having to change any of your code because Rails just speaks rack and the web server bindings all just speak rack as well so that they have a common interface, right? And that interface is a rack application. A rack application is just an object that responds to call and returns an array of three values. The first one is the HTTP status code. The second one is a hash, this slide is wrong, it's not an array, the second one is a hash which is the rack env or environment hash and the second one is the body which I think has to respond to the each method. So usually our responses are going to be arrays because they have to respond to dot each. So our controllers just by themselves are rack applications and when the router, the Rails router is basically working with your Rails application, it kind of doesn't know that each endpoint or when you call get hello hello index a Rails controller is basically functionally the same to it as any other rack application which allows you to do some kind of cool things. You can send routes to Sinatra applications because Sinatra applications are rack applications. As far as I know, Hanami is also a rack application so you can just mount Hanami applications inside of Rails. You can also route directly to Prox which is kind of crazy because they are rack applications that respond to call, et cetera, et cetera. So which we're going to use that in a minute. We could use that in a minute. We could make our hello world application even simpler right by just routing directly to a proc rather than even bothering with a controller. If that Action Controller Metal and all that stuff sounds interesting to you but like you don't want to start from zero, there's this cool method and it's kind of hard to read, I'm sorry, it's kind of small. ActionControllerBase.withoutModules .each and then you give it a block. You can basically start with ActionController and it'll give you a list of modules minus the ones you don't want. So we're saying ActionControllerBase and ActionControllerBase minus ParamsRapper and streaming include all those. So you can kind of start from all the ActionControllerBase modules instead of starting from zero and including them one at a time. Okay. Finally when it comes to modularity I think it's important to know that not all models need to be ActiveRecord. You can put anything you want in the models folder. Actually it doesn't have to inherit from ActiveRecordBase. ActiveRecordBase is just a class that like ActionControllerMetal just includes or extends a bunch of other modules. That's literally it if you look at the base.rb wherever it is in ActiveRecordCode and it's not any more complicated than that. So whatever is in your models folder it doesn't have to inherit from ActiveRecordBase. There's tons of cool stuff in ActiveModel which can make your plain Ruby objects sort of walk and quack like an ActiveRecordBase object but not actually have to do anything with persistence or database. So check out ActiveModel for a way of modularizing your Rails applications even further. So like I said I was going to talk about the performance story so here's what it is. If your Rails application is like not doing anything meaningful or it is an API only application using several of the main components of Rails if you don't require all the parts of the Rails framework you can save some memory. So if you don't require for example sprockets I think you can save like 10 megabytes of memory per process which is like not small potatoes. I mean like when that across four processes in a typical server like that adds up a little bit and if you start getting rid of logging there you can save a couple of milliseconds per request. So when I talked about config.middleware.delete some of those if you delete half a dozen of them you can shave some milliseconds off your request time there. Not really that big of a gain obviously. I mean most Rails servers are 100 millisecond response times right so shaving 6 milliseconds 10 milliseconds off is probably not a big deal to you unless you're at GitHub scale like you have an average response time of 50 milliseconds and so that's like 10% like awesome great I think the performance story here is really not as interesting as the modularity story and the code organization story so in general I just want you to realize that framework code is nowhere near as important as application code. Rails is not slow your application is slow the way you use Rails is slow but you're not starting from from a 5 yard what's the opposite of a head start you're not starting a negative here you're starting at the same level that pretty much everyone else is and it's the application it's everything that comes after Rails new that makes an application slow okay now the insanity that's cold golf so this is the application as we left it last this is the most practical Rails application that makes any sense and here's the world's smallest Rails application amazing beautiful now here's what it actually is so this is a shell command we're going to call rackup we're going to pass rackup a dash R option which is going to require a library we're going to require actually control a rail tie and then the dash B option this string is config.ru I think dash B actually stands for builder as in rack builder and then we're going to give it a string that's like our config.ru we're going to run an anonymous class which inherits from Rails application and then this block here is the body of the class we still have to set a secret key base I don't know why because I'm not using any secret key base related things here's a little code golf trick this question mark X is the same thing as quote X quote is just one character less I think that's only there for historical reasons because Ruby 1.8 had this weird thing where if you did question mark X it returned a number it returned the ASCII code or whatever and they couldn't get rid of that so they made it return a letter instead it doesn't matter because it's a big secret key base to something that makes Rails shut up this is very insecure don't do this but this is a toy application so it's fine and then we called .initialize on it to run all the Rails ties and set up the Rails application and this application doesn't actually do anything it's 404s as a service because there's no routes so all this Rails application can do is serve empty 404 responses but it is a Rails application and it fits in a tweet you could make it useful quote unquote useful by adding routes.draw to some proc here but then you would just have an application that served 200 responses instead of 404s so is this even practical Nate? well no not really there's two practical applications I can think of for Rails applications that fit in a file or probably not a tweet test suites for gem slash engines I think plenty of gems need a way to test with a live Rails application sometimes people just do Rails new inside of their test suite directory which ends up creating this huge 400 line monstrosity which is longer than their entire test suite you don't need to do that you can just use our one line Rails application and it's going to be functionally the same as a real Rails application so we use that technique in the Raven Ruby gem which I maintain that's the Ruby client for the century error notification service and I think every Rails or every Ruby gem that needs to test against a Rails application should be using a similar approach and also for API only applications I'm not the kind of guy that does like single page applications it only uses my Rails server as like a back end for my Angular app or whatever but if you are and you're not rendering HTML responses maybe your Rails application doesn't have anything to do with assets and all the assets are handled by Nginx or whatever there's a lot of the Rails framework that you cannot load Sprocket's an active record and the most important ones as far as memory goes and not loading those parts of the Rails framework will save you a little bit of memory and it will save you some headspace of not having to think about these components being in your global namespace but the reality is that most applications need 80% of what Rails provides and so when you see Sinatra and Sinatra is like require Sinatra, get slash do and all that and that's really nice the reality is that an application that you could get paid to work on every day is going to need about 80% or more of all these things that get provided for us in the Rails framework so while it may not win any blog post beauty contests I think the way that Rails new is set up is actually the way that most of us would minimize the work for the majority of applications so Rails is modular you just maybe never needed it so your homework today try not using Rails slash all in your Rails application, try loading the parts of the framework that you need to actually test to see if this makes any difference to you I suggest using derailed benchmarks, it has a little tool that will help you see how much memory you're using on startup so when you're not requiring these parts of the framework you want to see that number go down it's author Richard Steemans right here in the front row and also if you're thinking about deleting middleware to save some response time you can use Apache Bench that's AB to pound your application with tons of requests per second and see if it's actually improving those times consider Action Controller Metal and Active Model just take a look at those classes in the Rails codebase and see if there's any way that you can simplify your models or controllers, maybe you're using all these features that you don't actually need and then the next time maybe the next time you would reach for Sinatra, the next time you would reach for Cuba or some other simple Ruby framework, try just starting from a one line Rails application and see where that gets you instead so this talk is available in the form of a GitHub repo and if I skipped or if I went fast through any parts and you want to know how do I get from Rails new to a tweet, it's available here in the form of a commit log so if you go to NateBurkepex.tweetlink on GitHub you can follow the commit log line by line with some really long commit messages about why I did certain things it gives a little bit more of the background of it this presentation and the slides are going to be available here at in the form of Rails lightweight stack actually that's Rails underscore lightweight underscore stack markdown, screw it up there in that repo also there's a bunch of different one file Rails applications and different practical uses and different like API only uses for this kind of stuff lots of other resources there like I said my course is the complete guide at Railspeed.com I also have tweeted, I've tweeted the one tweet Rails application at my Twitter at NateBurkepex if you want to retweet it there so thank you very much for your time