[Script Info] Title: [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text Dialogue: 0,0:00:16.84,0:00:22.54,Default,,0000,0000,0000,,JOSH SZMAJDA: All right. You guys ready to\Ntalk about SOA? Woo! Dialogue: 0,0:00:22.54,0:00:29.54,Default,,0000,0000,0000,,I'm Josh. Hi. How you doing? I'm the CTO Dialogue: 0,0:00:30.85,0:00:33.39,Default,,0000,0000,0000,,at Optoro. We make software for retailers.\NHelp them Dialogue: 0,0:00:33.39,0:00:36.47,Default,,0000,0000,0000,,deal with their stuff at scale. I'm working\Non Dialogue: 0,0:00:36.47,0:00:41.07,Default,,0000,0000,0000,,a project called RACK-AMQP. RACK-AMQP is a\Ncollection of Dialogue: 0,0:00:41.07,0:00:46.94,Default,,0000,0000,0000,,different projects, including an RC, some\Nclient libraries, and Dialogue: 0,0:00:46.94,0:00:51.04,Default,,0000,0000,0000,,most notably, Jackalope, which is a new Ruby\Nweb Dialogue: 0,0:00:51.04,0:00:55.58,Default,,0000,0000,0000,,application server, like Unicorn, Passenger,\NThin, or, or anything Dialogue: 0,0:00:55.58,0:00:58.90,Default,,0000,0000,0000,,like that. Except that it's special-purpose.\NIt's for service-oriented Dialogue: 0,0:00:58.90,0:01:03.51,Default,,0000,0000,0000,,architectures. And it doesn't actually speak\NHTTP at all. Dialogue: 0,0:01:03.51,0:01:07.90,Default,,0000,0000,0000,,So. Why am I doing this crazy thing? Well, Dialogue: 0,0:01:07.90,0:01:11.06,Default,,0000,0000,0000,,my app drove me to it. My app is Dialogue: 0,0:01:11.06,0:01:14.11,Default,,0000,0000,0000,,huge. It's really complicated. This is kind\Nof a Dialogue: 0,0:01:14.11,0:01:16.07,Default,,0000,0000,0000,,services diagram of my app. Or where we'd\Nlike Dialogue: 0,0:01:16.07,0:01:18.22,Default,,0000,0000,0000,,to go with it. Dialogue: 0,0:01:18.22,0:01:21.10,Default,,0000,0000,0000,,There's over three-hundred and fifty models\Nin one Rails Dialogue: 0,0:01:21.10,0:01:25.38,Default,,0000,0000,0000,,application. The test suite takes over eight\Nhours. It's Dialogue: 0,0:01:25.38,0:01:29.90,Default,,0000,0000,0000,,kind of a headache. You could put it. So Dialogue: 0,0:01:29.90,0:01:31.48,Default,,0000,0000,0000,,we decided the way to move forward with it Dialogue: 0,0:01:31.48,0:01:34.11,Default,,0000,0000,0000,,is to break it up into smaller applications\Nthat Dialogue: 0,0:01:34.11,0:01:37.38,Default,,0000,0000,0000,,work together. And, of course, that means\NSOA. Dialogue: 0,0:01:37.38,0:01:40.81,Default,,0000,0000,0000,,Now, I mean, SOA is really wrapped up in Dialogue: 0,0:01:40.81,0:01:45.27,Default,,0000,0000,0000,,a lot of pretty awful baggage, when you come Dialogue: 0,0:01:45.27,0:01:48.67,Default,,0000,0000,0000,,down to it. SOA, you think about enterprise\Nservice Dialogue: 0,0:01:48.67,0:01:53.31,Default,,0000,0000,0000,,buses. You think about strict interface definitions.\NVersions. I Dialogue: 0,0:01:53.31,0:01:55.40,Default,,0000,0000,0000,,mean it's a lot of complexity that you have Dialogue: 0,0:01:55.40,0:01:59.57,Default,,0000,0000,0000,,to worry about. Extra load balancers. More\Nconfiguration. More Dialogue: 0,0:01:59.57,0:02:02.41,Default,,0000,0000,0000,,distributed tracing and monitoring. I mean,\Nit's a, it's Dialogue: 0,0:02:02.41,0:02:04.28,Default,,0000,0000,0000,,a real pain. Dialogue: 0,0:02:04.28,0:02:06.89,Default,,0000,0000,0000,,So I, I hate SOA, right. It makes me Dialogue: 0,0:02:06.89,0:02:12.14,Default,,0000,0000,0000,,feel like this. So, but when you get down Dialogue: 0,0:02:12.14,0:02:14.69,Default,,0000,0000,0000,,to it, SOA is actually not all of that. Dialogue: 0,0:02:14.69,0:02:19.77,Default,,0000,0000,0000,,SOA is really just independent actors communicating.\NThey're working Dialogue: 0,0:02:19.77,0:02:25.31,Default,,0000,0000,0000,,together to get something useful done. So,\Nreally, SOA Dialogue: 0,0:02:25.31,0:02:29.79,Default,,0000,0000,0000,,can mitigate complexity by enforcing simplification.\NEach service only Dialogue: 0,0:02:29.79,0:02:32.54,Default,,0000,0000,0000,,has to think about its own little bubble.\NIt Dialogue: 0,0:02:32.54,0:02:34.18,Default,,0000,0000,0000,,only has to worry about its little component.\NAnd Dialogue: 0,0:02:34.18,0:02:35.45,Default,,0000,0000,0000,,it doesn't have to think about anything else\Nthat Dialogue: 0,0:02:35.45,0:02:38.02,Default,,0000,0000,0000,,goes on in its entire system. Dialogue: 0,0:02:38.02,0:02:39.82,Default,,0000,0000,0000,,You can let your system architect worry about\Nwhat's Dialogue: 0,0:02:39.82,0:02:40.97,Default,,0000,0000,0000,,going on across the whole thing. All you have Dialogue: 0,0:02:40.97,0:02:42.08,Default,,0000,0000,0000,,to do is pay attention to your one little Dialogue: 0,0:02:42.08,0:02:45.34,Default,,0000,0000,0000,,service and you can be pretty happy. Dialogue: 0,0:02:45.34,0:02:48.16,Default,,0000,0000,0000,,So, when you get down to it again, SOA Dialogue: 0,0:02:48.16,0:02:51.57,Default,,0000,0000,0000,,is really just independent actors communicating.\NNow that communicating Dialogue: 0,0:02:51.57,0:02:54.22,Default,,0000,0000,0000,,bit is important. How they communicate actually\Ndetermines how Dialogue: 0,0:02:54.22,0:02:57.71,Default,,0000,0000,0000,,your application behaves. And the kinds of\Ncommunication you Dialogue: 0,0:02:57.71,0:03:00.74,Default,,0000,0000,0000,,can use impacts the kind of application you\Ncan Dialogue: 0,0:03:00.74,0:03:01.86,Default,,0000,0000,0000,,write. Dialogue: 0,0:03:01.86,0:03:05.01,Default,,0000,0000,0000,,So, the typical communication pattern that\Nwe're most familiar Dialogue: 0,0:03:05.01,0:03:08.14,Default,,0000,0000,0000,,with as programmers is sort of direct messaging.\NI Dialogue: 0,0:03:08.14,0:03:10.65,Default,,0000,0000,0000,,am an object. I can send a message to Dialogue: 0,0:03:10.65,0:03:13.41,Default,,0000,0000,0000,,my friend. My friend is gonna give me back Dialogue: 0,0:03:13.41,0:03:15.68,Default,,0000,0000,0000,,a response. It's very normal. It's what, in\Nfact, Dialogue: 0,0:03:15.68,0:03:18.85,Default,,0000,0000,0000,,we use all the time with HTTP. But when Dialogue: 0,0:03:18.85,0:03:20.16,Default,,0000,0000,0000,,you think about it, what we actually want\Nto Dialogue: 0,0:03:20.16,0:03:21.71,Default,,0000,0000,0000,,do is be able to send different kinds of Dialogue: 0,0:03:21.71,0:03:24.79,Default,,0000,0000,0000,,messaging structures. We want to publish that\Nsomething happened Dialogue: 0,0:03:24.79,0:03:27.29,Default,,0000,0000,0000,,in my system and have people subscribe to\Nthat Dialogue: 0,0:03:27.29,0:03:30.47,Default,,0000,0000,0000,,event and take some interesting action. Dialogue: 0,0:03:30.47,0:03:31.98,Default,,0000,0000,0000,,It's all about decoupling. I don't have to\Nknow Dialogue: 0,0:03:31.98,0:03:33.65,Default,,0000,0000,0000,,about my neighbor anymore. I just need to\Nknow Dialogue: 0,0:03:33.65,0:03:36.18,Default,,0000,0000,0000,,that I did something, and then somebody else\Nmight Dialogue: 0,0:03:36.18,0:03:37.88,Default,,0000,0000,0000,,care that, oh, you did something. That's great.\NLet Dialogue: 0,0:03:37.88,0:03:38.80,Default,,0000,0000,0000,,me do something about that. Dialogue: 0,0:03:38.80,0:03:41.62,Default,,0000,0000,0000,,But again, like I said, let me. We're Rails Dialogue: 0,0:03:41.62,0:03:44.78,Default,,0000,0000,0000,,developers. We're used to writing web applications.\NWe speak Dialogue: 0,0:03:44.78,0:03:47.86,Default,,0000,0000,0000,,HTTP all the time. HTTP allows us to do Dialogue: 0,0:03:47.86,0:03:50.31,Default,,0000,0000,0000,,direct messaging, so that's what we tend to\Ndo. Dialogue: 0,0:03:50.31,0:03:52.34,Default,,0000,0000,0000,,I'd say most SOAs out there, when they get Dialogue: 0,0:03:52.34,0:03:54.48,Default,,0000,0000,0000,,off the ground, they start building web applications\Nthat Dialogue: 0,0:03:54.48,0:03:56.89,Default,,0000,0000,0000,,speak with each other through HTTP. It's what\Nwe're Dialogue: 0,0:03:56.89,0:03:58.43,Default,,0000,0000,0000,,familiar with. Dialogue: 0,0:03:58.43,0:04:01.12,Default,,0000,0000,0000,,But what would we actually like our transport\Nmechanism Dialogue: 0,0:04:01.12,0:04:05.23,Default,,0000,0000,0000,,to be? We want it to be, you know, Dialogue: 0,0:04:05.23,0:04:08.92,Default,,0000,0000,0000,,data structure independent. HTTP specifies\Nthat there be a Dialogue: 0,0:04:08.92,0:04:11.33,Default,,0000,0000,0000,,body, but it doesn't specify the format of\Nthe Dialogue: 0,0:04:11.33,0:04:13.17,Default,,0000,0000,0000,,body. We want it to be fast. We want Dialogue: 0,0:04:13.17,0:04:17.69,Default,,0000,0000,0000,,it to be open, transparent, understandable,\Nclear. You know, Dialogue: 0,0:04:17.69,0:04:20.28,Default,,0000,0000,0000,,debuggable. Observable. And flexible. Dialogue: 0,0:04:20.28,0:04:25.83,Default,,0000,0000,0000,,So, is HTTP all of those things. We also Dialogue: 0,0:04:25.83,0:04:30.08,Default,,0000,0000,0000,,need, not only direct request response type\Nof messaging, Dialogue: 0,0:04:30.08,0:04:33.98,Default,,0000,0000,0000,,like RPC, but we also need pub, subscribe,\Nand Dialogue: 0,0:04:33.98,0:04:38.18,Default,,0000,0000,0000,,broadcast. Additionally, we don't need more\Nload balancers. More Dialogue: 0,0:04:38.18,0:04:43.12,Default,,0000,0000,0000,,SSL certificates. Distributed logging. Trying\Nto figure out what's Dialogue: 0,0:04:43.12,0:04:44.86,Default,,0000,0000,0000,,going on in this service over here versus\Nthat Dialogue: 0,0:04:44.86,0:04:47.21,Default,,0000,0000,0000,,one over there. It's a nightmare. Dialogue: 0,0:04:47.21,0:04:50.15,Default,,0000,0000,0000,,And, you know, looking up the various services\Nin Dialogue: 0,0:04:50.15,0:04:51.71,Default,,0000,0000,0000,,your system, it's a pain. So, again, I mean, Dialogue: 0,0:04:51.71,0:04:54.74,Default,,0000,0000,0000,,HTTP, you know, it has, it is blind. It's Dialogue: 0,0:04:54.74,0:04:57.67,Default,,0000,0000,0000,,fast. It's open, clear, it's well-understood.\NIt's what we Dialogue: 0,0:04:57.67,0:05:01.68,Default,,0000,0000,0000,,know. It's really great for RPC. It's a better Dialogue: 0,0:05:01.68,0:05:02.50,Default,,0000,0000,0000,,alternative. Dialogue: 0,0:05:02.50,0:05:07.66,Default,,0000,0000,0000,,And that's AMQP. AMQP is blind, also. It doesn't Dialogue: 0,0:05:07.66,0:05:10.22,Default,,0000,0000,0000,,care what data you're transmitting across\Nit. It's extremely Dialogue: 0,0:05:10.22,0:05:12.86,Default,,0000,0000,0000,,fast. It's an open system. It's great for\Nall Dialogue: 0,0:05:12.86,0:05:16.50,Default,,0000,0000,0000,,messaging pattern. Not just direct messaging,\Nbut pub/sub, and Dialogue: 0,0:05:16.50,0:05:21.06,Default,,0000,0000,0000,,queue-based messaging. It's centralized, which\Nin terms of a Dialogue: 0,0:05:21.06,0:05:23.65,Default,,0000,0000,0000,,service-oriented architecture is very beneficial,\Nin that you have Dialogue: 0,0:05:23.65,0:05:26.12,Default,,0000,0000,0000,,one point to manage, one point to pay attention Dialogue: 0,0:05:26.12,0:05:28.71,Default,,0000,0000,0000,,to everything at. And the only issue is that Dialogue: 0,0:05:28.71,0:05:30.24,Default,,0000,0000,0000,,it's not what we're familiar with. It's not\Nwhat Dialogue: 0,0:05:30.24,0:05:32.03,Default,,0000,0000,0000,,we know. You know, again, we're web developers.\NWe're Dialogue: 0,0:05:32.03,0:05:34.28,Default,,0000,0000,0000,,not AMQP developers. At least not the most\Nof Dialogue: 0,0:05:34.28,0:05:34.92,Default,,0000,0000,0000,,us. Dialogue: 0,0:05:34.92,0:05:36.50,Default,,0000,0000,0000,,So it's a challenge. Dialogue: 0,0:05:36.50,0:05:40.02,Default,,0000,0000,0000,,So the RACK-AMQP project that I'm working\Non is Dialogue: 0,0:05:40.02,0:05:44.28,Default,,0000,0000,0000,,really designed to make AMQP simple. We are\Ntrying Dialogue: 0,0:05:44.28,0:05:47.18,Default,,0000,0000,0000,,to introduce as few opinions as absolutely\Nnecessary in Dialogue: 0,0:05:47.18,0:05:49.51,Default,,0000,0000,0000,,order to make this possible. And to give you Dialogue: 0,0:05:49.51,0:05:51.49,Default,,0000,0000,0000,,a stepping stone into the world of AMQP where Dialogue: 0,0:05:51.49,0:05:54.34,Default,,0000,0000,0000,,you can start to integrate more advanced concepts\Ninto Dialogue: 0,0:05:54.34,0:06:00.54,Default,,0000,0000,0000,,the system, without having to relearn your\Nentire world. Dialogue: 0,0:06:00.54,0:06:03.61,Default,,0000,0000,0000,,So it also lets us continue to build what Dialogue: 0,0:06:03.61,0:06:06.59,Default,,0000,0000,0000,,we know. Because it's built on Rack, you know, Dialogue: 0,0:06:06.59,0:06:09.58,Default,,0000,0000,0000,,we're web-developers. We can continue to use\Nthe web Dialogue: 0,0:06:09.58,0:06:11.81,Default,,0000,0000,0000,,concepts that we're familiar with. We can\Ndeveloper locally Dialogue: 0,0:06:11.81,0:06:13.57,Default,,0000,0000,0000,,on our web machines using the systems that\Nwe're Dialogue: 0,0:06:13.57,0:06:15.88,Default,,0000,0000,0000,,comfortable with. And then when we deploy,\Nwe simply Dialogue: 0,0:06:15.88,0:06:18.44,Default,,0000,0000,0000,,deploy it to Jackalope, instead of to Unicorn\Nor Dialogue: 0,0:06:18.44,0:06:22.26,Default,,0000,0000,0000,,Passenger or whatever, and it's magically\Nin this world Dialogue: 0,0:06:22.26,0:06:24.02,Default,,0000,0000,0000,,of AMQP. Dialogue: 0,0:06:24.02,0:06:27.77,Default,,0000,0000,0000,,So. How does that work? Well, let's look at Dialogue: 0,0:06:27.77,0:06:29.22,Default,,0000,0000,0000,,AMQP a little bit more in depth, first. So Dialogue: 0,0:06:29.22,0:06:32.24,Default,,0000,0000,0000,,AMQP is the advanced messaging queue, message\Nqueueing protocol. Dialogue: 0,0:06:32.24,0:06:34.49,Default,,0000,0000,0000,,It is an open standard. It's developed by\NOasis, Dialogue: 0,0:06:34.49,0:06:37.69,Default,,0000,0000,0000,,which is an open standards body. It, again,\Nlike Dialogue: 0,0:06:37.69,0:06:41.61,Default,,0000,0000,0000,,I said, uses a centralized distribution pattern.\NThat centralized Dialogue: 0,0:06:41.61,0:06:44.40,Default,,0000,0000,0000,,distribution pattern allows you to do the\Nvarious kinds Dialogue: 0,0:06:44.40,0:06:46.66,Default,,0000,0000,0000,,of messaging that are really handy for us.\NThe Dialogue: 0,0:06:46.66,0:06:49.75,Default,,0000,0000,0000,,pub/sub and the other interesting thing. This\Nimplies that Dialogue: 0,0:06:49.75,0:06:51.89,Default,,0000,0000,0000,,we have a broker in the center that all Dialogue: 0,0:06:51.89,0:06:54.51,Default,,0000,0000,0000,,of our services connect to and transmit messages\Nthrough Dialogue: 0,0:06:54.51,0:06:56.61,Default,,0000,0000,0000,,that broker. And that broker can make intelligent\Ndecisions Dialogue: 0,0:06:56.61,0:06:58.93,Default,,0000,0000,0000,,about how to route those messages. Dialogue: 0,0:06:58.93,0:07:02.57,Default,,0000,0000,0000,,AMQP messages themselves, they have headers\Nand bodies, just Dialogue: 0,0:07:02.57,0:07:06.00,Default,,0000,0000,0000,,like HTTP. There are well-known fields, like\Ncontent type Dialogue: 0,0:07:06.00,0:07:11.94,Default,,0000,0000,0000,,and priority, in this case. And we can actually Dialogue: 0,0:07:11.94,0:07:14.83,Default,,0000,0000,0000,,leverage the conventions that we understand\Nfrom HTTP to Dialogue: 0,0:07:14.83,0:07:18.94,Default,,0000,0000,0000,,pull AMQP into the world. So AMQP, like I Dialogue: 0,0:07:18.94,0:07:21.01,Default,,0000,0000,0000,,mentioned, has these headers and bodies. It\Nhas well-known Dialogue: 0,0:07:21.01,0:07:23.82,Default,,0000,0000,0000,,fields. And HTTP essentially has headers and\Nbodies and Dialogue: 0,0:07:23.82,0:07:26.78,Default,,0000,0000,0000,,also well-known fields. So we can essentially\Nemulate HTTP Dialogue: 0,0:07:26.78,0:07:30.25,Default,,0000,0000,0000,,over AMQP without too much trouble. And, again,\Nthe Dialogue: 0,0:07:30.25,0:07:32.46,Default,,0000,0000,0000,,AMQP supports the RPC messaging pattern, which\Nis what Dialogue: 0,0:07:32.46,0:07:34.24,Default,,0000,0000,0000,,HTTP is. Dialogue: 0,0:07:34.24,0:07:36.86,Default,,0000,0000,0000,,So, one of the parts of the project is Dialogue: 0,0:07:36.86,0:07:41.61,Default,,0000,0000,0000,,the AMQP HTTP RC, which, it simply does as Dialogue: 0,0:07:41.61,0:07:44.57,Default,,0000,0000,0000,,little as it has to to define the structure. Dialogue: 0,0:07:44.57,0:07:46.06,Default,,0000,0000,0000,,It's just a documentation on how we're doing\Nthe Dialogue: 0,0:07:46.06,0:07:48.24,Default,,0000,0000,0000,,mapping. One of the other goals is that we Dialogue: 0,0:07:48.24,0:07:50.47,Default,,0000,0000,0000,,want to make inner-operability with other\Nlanguages and other Dialogue: 0,0:07:50.47,0:07:54.15,Default,,0000,0000,0000,,platforms really easy. So having an RC will\Nallow Dialogue: 0,0:07:54.15,0:07:55.72,Default,,0000,0000,0000,,it, allow us to have just a central document Dialogue: 0,0:07:55.72,0:08:00.23,Default,,0000,0000,0000,,to refer back to in constructing other servers. Dialogue: 0,0:08:00.23,0:08:01.57,Default,,0000,0000,0000,,So let's look at HTTP a little bit more Dialogue: 0,0:08:01.57,0:08:03.27,Default,,0000,0000,0000,,in-depth. How does HTTP work? Well, you know,\Nwhen Dialogue: 0,0:08:03.27,0:08:06.64,Default,,0000,0000,0000,,we send a request, we send a specific request Dialogue: 0,0:08:06.64,0:08:09.31,Default,,0000,0000,0000,,to a server, to a, you know, specific IP Dialogue: 0,0:08:09.31,0:08:11.71,Default,,0000,0000,0000,,address and port. And we get back a response. Dialogue: 0,0:08:11.71,0:08:15.01,Default,,0000,0000,0000,,And, of course, the request has things like\Nthe Dialogue: 0,0:08:15.01,0:08:19.41,Default,,0000,0000,0000,,HTTP verb, the path, headers, the bodies.\NAnd the Dialogue: 0,0:08:19.41,0:08:21.22,Default,,0000,0000,0000,,response comes back with a response code. Dialogue: 0,0:08:21.22,0:08:23.54,Default,,0000,0000,0000,,It's all stuff we're familiar with. So all\Nwe Dialogue: 0,0:08:23.54,0:08:26.50,Default,,0000,0000,0000,,had to do is map that into AMQP terms, Dialogue: 0,0:08:26.50,0:08:28.49,Default,,0000,0000,0000,,which is essentially what we've done here.\NAnd this Dialogue: 0,0:08:28.49,0:08:29.70,Default,,0000,0000,0000,,is just a reference for just a few of Dialogue: 0,0:08:29.70,0:08:32.09,Default,,0000,0000,0000,,the things that we're doing. Like content\Ntype. There's Dialogue: 0,0:08:32.09,0:08:34.13,Default,,0000,0000,0000,,already a content type header in AMQP, so\Nwe Dialogue: 0,0:08:34.13,0:08:36.78,Default,,0000,0000,0000,,just reuse that. Some things didn't make sense.\NLike Dialogue: 0,0:08:36.78,0:08:41.05,Default,,0000,0000,0000,,the protocol for example. In HTTP you've got\NHTP Dialogue: 0,0:08:41.05,0:08:45.94,Default,,0000,0000,0000,,or HTPS or HTTP plus dev or whatever. But Dialogue: 0,0:08:45.94,0:08:48.79,Default,,0000,0000,0000,,with AMQP, your protocol's already negotiated\Nwhen you connect Dialogue: 0,0:08:48.79,0:08:50.33,Default,,0000,0000,0000,,to the broker. So it doesn't really make sense Dialogue: 0,0:08:50.33,0:08:51.89,Default,,0000,0000,0000,,for us to worry about that in the messages Dialogue: 0,0:08:51.89,0:08:55.20,Default,,0000,0000,0000,,we're passing around the system. Dialogue: 0,0:08:55.20,0:08:57.49,Default,,0000,0000,0000,,The host name becomes, essentially, the routing\Nkey. The Dialogue: 0,0:08:57.49,0:08:59.93,Default,,0000,0000,0000,,queue target that we're sending to in AMQP.\NAnd Dialogue: 0,0:08:59.93,0:09:03.29,Default,,0000,0000,0000,,it makes it really simple. So, this looks\Nlike Dialogue: 0,0:09:03.29,0:09:07.05,Default,,0000,0000,0000,,this, essentially, in code. This is an example\Nof Dialogue: 0,0:09:07.05,0:09:09.91,Default,,0000,0000,0000,,how you could write a client that speaks AMQP, Dialogue: 0,0:09:09.91,0:09:12.83,Default,,0000,0000,0000,,HTTP. You create a call-back queue. We'll\Nget back Dialogue: 0,0:09:12.83,0:09:15.22,Default,,0000,0000,0000,,to that in one sec. You publish a message Dialogue: 0,0:09:15.22,0:09:17.57,Default,,0000,0000,0000,,that looks like an HTTP message to the target Dialogue: 0,0:09:17.57,0:09:19.76,Default,,0000,0000,0000,,queue. And then you wait for a response. Dialogue: 0,0:09:19.76,0:09:21.71,Default,,0000,0000,0000,,Now, the callback queue is actually a really\Nimportant Dialogue: 0,0:09:21.71,0:09:26.27,Default,,0000,0000,0000,,thing here. AMQP is a hundred percent queue\Nbased. Dialogue: 0,0:09:26.27,0:09:29.14,Default,,0000,0000,0000,,It's all asynchronous under the hood. But,\Nyou know, Dialogue: 0,0:09:29.14,0:09:31.71,Default,,0000,0000,0000,,we want to write a synchronous system. HTTP\Nis Dialogue: 0,0:09:31.71,0:09:34.08,Default,,0000,0000,0000,,synchronous. I send a request. I wait for\Nthe Dialogue: 0,0:09:34.08,0:09:37.28,Default,,0000,0000,0000,,response, or receive the response and move\Non. So, Dialogue: 0,0:09:37.28,0:09:41.09,Default,,0000,0000,0000,,to do that in AMQP, we create a respond Dialogue: 0,0:09:41.09,0:09:43.33,Default,,0000,0000,0000,,queue that we are going to listen to in Dialogue: 0,0:09:43.33,0:09:46.68,Default,,0000,0000,0000,,the broker. It's an anonymous queue. There's\Na great Dialogue: 0,0:09:46.68,0:09:49.28,Default,,0000,0000,0000,,convention. We're doing this in AMQP. It's\Nvery easy. Dialogue: 0,0:09:49.28,0:09:50.63,Default,,0000,0000,0000,,So we create a response queue, we get the Dialogue: 0,0:09:50.63,0:09:52.00,Default,,0000,0000,0000,,name of that queue, and then as part of Dialogue: 0,0:09:52.00,0:09:53.95,Default,,0000,0000,0000,,the message we send to our target, we say, Dialogue: 0,0:09:53.95,0:09:56.43,Default,,0000,0000,0000,,here's the response queue to reply back at.\NAnd Dialogue: 0,0:09:56.43,0:09:58.35,Default,,0000,0000,0000,,then we simply wait for the response on that Dialogue: 0,0:09:58.35,0:10:00.25,Default,,0000,0000,0000,,call-back queue to come back. So that lets\Nus Dialogue: 0,0:10:00.25,0:10:02.71,Default,,0000,0000,0000,,get the synchrony that we're familiar with,\Nthat we Dialogue: 0,0:10:02.71,0:10:06.16,Default,,0000,0000,0000,,need, with HTTP style programming, while still\Nhaving an Dialogue: 0,0:10:06.16,0:10:09.13,Default,,0000,0000,0000,,asynchronous system under the hood. Dialogue: 0,0:10:09.13,0:10:13.89,Default,,0000,0000,0000,,RACK, of course, we're all using RACK today.\NEven Dialogue: 0,0:10:13.89,0:10:15.81,Default,,0000,0000,0000,,if you're not familiar with it. RACK, of course, Dialogue: 0,0:10:15.81,0:10:18.19,Default,,0000,0000,0000,,is what runs all Ruby web application servers.\NTurns Dialogue: 0,0:10:18.19,0:10:21.12,Default,,0000,0000,0000,,out that RACK actually doesn't care about\NHTTP. All Dialogue: 0,0:10:21.12,0:10:23.73,Default,,0000,0000,0000,,that RACK really defines is that you had defined Dialogue: 0,0:10:23.73,0:10:26.87,Default,,0000,0000,0000,,a call method that receives an environment,\Nwhich is Dialogue: 0,0:10:26.87,0:10:29.92,Default,,0000,0000,0000,,basically a hash, and it responds back with\Na Dialogue: 0,0:10:29.92,0:10:34.08,Default,,0000,0000,0000,,three-element array. The HTTP response code,\Nheaders, and the Dialogue: 0,0:10:34.08,0:10:34.77,Default,,0000,0000,0000,,body. Dialogue: 0,0:10:34.77,0:10:37.23,Default,,0000,0000,0000,,That hash doesn't actually have to be anything\Nbut Dialogue: 0,0:10:37.23,0:10:39.65,Default,,0000,0000,0000,,a hash. It just has to look like an Dialogue: 0,0:10:39.65,0:10:42.85,Default,,0000,0000,0000,,HTTP environment. So emulation was actually\Npretty simple. So Dialogue: 0,0:10:42.85,0:10:45.73,Default,,0000,0000,0000,,this is basically how it looks. We subscribe\Nto Dialogue: 0,0:10:45.73,0:10:48.07,Default,,0000,0000,0000,,a queue on the server, and then for every Dialogue: 0,0:10:48.07,0:10:51.29,Default,,0000,0000,0000,,message we receive back for that queue, we\Nunpack Dialogue: 0,0:10:51.29,0:10:53.91,Default,,0000,0000,0000,,some things into variables. We create what\Nlooks like Dialogue: 0,0:10:53.91,0:10:56.91,Default,,0000,0000,0000,,the HTTP environment and we have the request\Nmethod Dialogue: 0,0:10:56.91,0:10:58.38,Default,,0000,0000,0000,,and query string. If you ever wrote CGI way Dialogue: 0,0:10:58.38,0:11:00.29,Default,,0000,0000,0000,,back in the day, this might look familiar\Nto Dialogue: 0,0:11:00.29,0:11:01.90,Default,,0000,0000,0000,,you. Dialogue: 0,0:11:01.90,0:11:04.00,Default,,0000,0000,0000,,And then we essentially pass that environment\Nonto our Dialogue: 0,0:11:04.00,0:11:06.70,Default,,0000,0000,0000,,RACK application, receive the response from\Nthe RACK app Dialogue: 0,0:11:06.70,0:11:09.91,Default,,0000,0000,0000,,and then publish that back to the response\Nqueue. Dialogue: 0,0:11:09.91,0:11:11.85,Default,,0000,0000,0000,,So this is what Jackalope is doing for us. Dialogue: 0,0:11:11.85,0:11:15.77,Default,,0000,0000,0000,,Jackalope is emulating HTTP for our RACK applications.\NAnd Dialogue: 0,0:11:15.77,0:11:18.54,Default,,0000,0000,0000,,it just works. I'll show you a demo at Dialogue: 0,0:11:18.54,0:11:20.37,Default,,0000,0000,0000,,the end. You don't have to modify your code Dialogue: 0,0:11:20.37,0:11:22.56,Default,,0000,0000,0000,,at all. You can just simply deploy to it, Dialogue: 0,0:11:22.56,0:11:26.11,Default,,0000,0000,0000,,and it's speaking AMQP instead of HTTP. So\Nthat's Dialogue: 0,0:11:26.11,0:11:28.73,Default,,0000,0000,0000,,it. We're done. We can go on vacation, right? Dialogue: 0,0:11:28.73,0:11:31.86,Default,,0000,0000,0000,,Well. I didn't talk about how to actually\Nput Dialogue: 0,0:11:31.86,0:11:36.93,Default,,0000,0000,0000,,this in production, other than just use Jackalope.\NSo Dialogue: 0,0:11:36.93,0:11:40.51,Default,,0000,0000,0000,,you have to choose a broker in AMQP. So Dialogue: 0,0:11:40.51,0:11:43.22,Default,,0000,0000,0000,,what we're using is RabbitMQ. RabbitMQ is\Na well-known Dialogue: 0,0:11:43.22,0:11:46.39,Default,,0000,0000,0000,,AMQP broker. If you're doing any AMQP you're\Nprobably Dialogue: 0,0:11:46.39,0:11:50.77,Default,,0000,0000,0000,,using RabbitMQ, most likely. It's used by\Ngiants out Dialogue: 0,0:11:50.77,0:11:53.32,Default,,0000,0000,0000,,there. I mean, Google, VMWare, NASA. All these\Npeople Dialogue: 0,0:11:53.32,0:11:54.73,Default,,0000,0000,0000,,are using Rabbit pretty heavily. Dialogue: 0,0:11:54.73,0:12:00.11,Default,,0000,0000,0000,,It's extremely scalable. It's fault-tolerant.\NIt's distributable. And it's Dialogue: 0,0:12:00.11,0:12:02.57,Default,,0000,0000,0000,,secure. It does everything you'd ever want.\NAnd it Dialogue: 0,0:12:02.57,0:12:05.10,Default,,0000,0000,0000,,also gives you a really great management console.\NWe Dialogue: 0,0:12:05.10,0:12:06.30,Default,,0000,0000,0000,,can go in and see what's going on in Dialogue: 0,0:12:06.30,0:12:08.37,Default,,0000,0000,0000,,your system. Like I mentioned, the distributed\Nlogging we Dialogue: 0,0:12:08.37,0:12:09.70,Default,,0000,0000,0000,,saw in the, in the last talk, if you Dialogue: 0,0:12:09.70,0:12:11.27,Default,,0000,0000,0000,,were here for that, trying to get an idea Dialogue: 0,0:12:11.27,0:12:12.88,Default,,0000,0000,0000,,of what's going on across your system can\Nbe Dialogue: 0,0:12:12.88,0:12:15.63,Default,,0000,0000,0000,,challenging. Rabbit doesn't tell you everything\Nyou'd want to Dialogue: 0,0:12:15.63,0:12:17.18,Default,,0000,0000,0000,,know, but it at least gives you an idea Dialogue: 0,0:12:17.18,0:12:19.66,Default,,0000,0000,0000,,of what queues are being used. Their depths\Nat Dialogue: 0,0:12:19.66,0:12:22.08,Default,,0000,0000,0000,,the point. The kind of information that can\Nhelp Dialogue: 0,0:12:22.08,0:12:23.88,Default,,0000,0000,0000,,you get, at least get a handle on it. Dialogue: 0,0:12:23.88,0:12:26.98,Default,,0000,0000,0000,,Additionally, you're gonna have to think about\Nhow you Dialogue: 0,0:12:26.98,0:12:28.55,Default,,0000,0000,0000,,talk to the real world. I mean, AMQP is Dialogue: 0,0:12:28.55,0:12:30.61,Default,,0000,0000,0000,,all well and good behind the scenes, but how Dialogue: 0,0:12:30.61,0:12:33.29,Default,,0000,0000,0000,,do I continue to interact and serve my clients Dialogue: 0,0:12:33.29,0:12:35.26,Default,,0000,0000,0000,,that I actually care about, to the point of Dialogue: 0,0:12:35.26,0:12:36.11,Default,,0000,0000,0000,,getting paid, right. Dialogue: 0,0:12:36.11,0:12:39.07,Default,,0000,0000,0000,,So this is the architecture we typically use\Nat Dialogue: 0,0:12:39.07,0:12:41.47,Default,,0000,0000,0000,,Optoro. We have our Rabbit server in the middle, Dialogue: 0,0:12:41.47,0:12:43.79,Default,,0000,0000,0000,,and all the various services sitting on Jackalope\Nthat Dialogue: 0,0:12:43.79,0:12:45.85,Default,,0000,0000,0000,,talk to Rabbit. And then additionally we have\None Dialogue: 0,0:12:45.85,0:12:48.32,Default,,0000,0000,0000,,or more API services that are continuing to\Nbe Dialogue: 0,0:12:48.32,0:12:50.96,Default,,0000,0000,0000,,deployed on Unicorn, in our case. They talk\Nto Dialogue: 0,0:12:50.96,0:12:54.82,Default,,0000,0000,0000,,the outside world and internally translate\Nthe, the needs Dialogue: 0,0:12:54.82,0:12:57.74,Default,,0000,0000,0000,,through AMQP and the rest of the system. Dialogue: 0,0:12:57.74,0:12:58.92,Default,,0000,0000,0000,,One of the things we actually published for\Neach Dialogue: 0,0:12:58.92,0:13:01.60,Default,,0000,0000,0000,,of our services is a client gem that kind Dialogue: 0,0:13:01.60,0:13:04.60,Default,,0000,0000,0000,,of isolates the worry, the worry about exactly\Nwhich Dialogue: 0,0:13:04.60,0:13:07.71,Default,,0000,0000,0000,,transport we're using away from the consumer,\Nthe API Dialogue: 0,0:13:07.71,0:13:10.89,Default,,0000,0000,0000,,here. So it actually is, is really simple. Dialogue: 0,0:13:10.89,0:13:12.85,Default,,0000,0000,0000,,And so the way that we do that is Dialogue: 0,0:13:12.85,0:13:15.86,Default,,0000,0000,0000,,we typically have been using HTTParty for\Nour HTTP Dialogue: 0,0:13:15.86,0:13:18.76,Default,,0000,0000,0000,,communication needs. So we wrote, as one of\Nthe Dialogue: 0,0:13:18.76,0:13:22.94,Default,,0000,0000,0000,,other projects part of RACK-AMQP, is AMQParty,\Nwhich is Dialogue: 0,0:13:22.94,0:13:26.79,Default,,0000,0000,0000,,just a API-compliant version of HTTParty.\NSo we can Dialogue: 0,0:13:26.79,0:13:30.62,Default,,0000,0000,0000,,actually just drop in the AMQParty constant\Nin place Dialogue: 0,0:13:30.62,0:13:32.80,Default,,0000,0000,0000,,of the HTTParty constant, and you can see\Ndown Dialogue: 0,0:13:32.80,0:13:35.61,Default,,0000,0000,0000,,below, that transport variable, we typically\Nconfigure that at Dialogue: 0,0:13:35.61,0:13:39.31,Default,,0000,0000,0000,,boot time to be either HTTParty or AMQParty.\NAnd Dialogue: 0,0:13:39.31,0:13:40.92,Default,,0000,0000,0000,,everything, again, just works. Dialogue: 0,0:13:40.92,0:13:43.10,Default,,0000,0000,0000,,We change the, the url a little bit, too. Dialogue: 0,0:13:43.10,0:13:44.67,Default,,0000,0000,0000,,But we do that all part of the, part Dialogue: 0,0:13:44.67,0:13:47.43,Default,,0000,0000,0000,,of this setup for each server. For each client. Dialogue: 0,0:13:47.43,0:13:51.62,Default,,0000,0000,0000,,Of course, if you don't want to use HTTParty, Dialogue: 0,0:13:51.62,0:13:54.00,Default,,0000,0000,0000,,some people like the various other options\Nthat are Dialogue: 0,0:13:54.00,0:13:57.00,Default,,0000,0000,0000,,out there, we also are publishing RACK-AMQP\Nclient, which Dialogue: 0,0:13:57.00,0:13:59.60,Default,,0000,0000,0000,,is what H, AMQParty is built on. It, it's Dialogue: 0,0:13:59.60,0:14:03.04,Default,,0000,0000,0000,,a very simple API. You get a client, you Dialogue: 0,0:14:03.04,0:14:06.92,Default,,0000,0000,0000,,tell it which Rabbit to connect to. You send Dialogue: 0,0:14:06.92,0:14:09.91,Default,,0000,0000,0000,,a request to your target queue with your uri Dialogue: 0,0:14:09.91,0:14:12.41,Default,,0000,0000,0000,,as part of it, with any, you know, your Dialogue: 0,0:14:12.41,0:14:13.68,Default,,0000,0000,0000,,HTTP method and all that. You get back your Dialogue: 0,0:14:13.68,0:14:16.19,Default,,0000,0000,0000,,response. It's synchronous. It's simple. It's\Nactually built on Dialogue: 0,0:14:16.19,0:14:18.67,Default,,0000,0000,0000,,Bunny, which is a really great AMQP gem out Dialogue: 0,0:14:18.67,0:14:21.78,Default,,0000,0000,0000,,there, and that also is very easy to use. Dialogue: 0,0:14:21.78,0:14:27.54,Default,,0000,0000,0000,,Additionally, we're publishing a sample SOA\Nusing Rails. It's Dialogue: 0,0:14:27.54,0:14:32.79,Default,,0000,0000,0000,,a work-in-progress at the moment. BUt the\Nuserland and Dialogue: 0,0:14:32.79,0:14:34.43,Default,,0000,0000,0000,,userland_client are mostly built as, you can\Nsee where Dialogue: 0,0:14:34.43,0:14:37.12,Default,,0000,0000,0000,,things are at the mo- at the current state. Dialogue: 0,0:14:37.12,0:14:38.60,Default,,0000,0000,0000,,It kind of gives you an idea about how Dialogue: 0,0:14:38.60,0:14:41.51,Default,,0000,0000,0000,,we think about SOA at Optoro, and how you Dialogue: 0,0:14:41.51,0:14:45.35,Default,,0000,0000,0000,,might be able to use Jackalope and the RACK-AMQP Dialogue: 0,0:14:45.35,0:14:47.05,Default,,0000,0000,0000,,project in your own projects. Dialogue: 0,0:14:47.05,0:14:52.19,Default,,0000,0000,0000,,So userland is a, is Rails service that essentially Dialogue: 0,0:14:52.19,0:14:54.56,Default,,0000,0000,0000,,publishes a user's concept out into the world.\NAnd Dialogue: 0,0:14:54.56,0:14:56.79,Default,,0000,0000,0000,,then userland_client is a gem that consumes\Nthe userland Dialogue: 0,0:14:56.79,0:15:00.26,Default,,0000,0000,0000,,service and interface uses the userland gem\Nto talk Dialogue: 0,0:15:00.26,0:15:02.10,Default,,0000,0000,0000,,to the userland service. Dialogue: 0,0:15:02.10,0:15:07.33,Default,,0000,0000,0000,,And so then, you know, how fast is this? Dialogue: 0,0:15:07.33,0:15:11.06,Default,,0000,0000,0000,,Well, there's this bench mark I've got. I'll\Nshow Dialogue: 0,0:15:11.06,0:15:13.48,Default,,0000,0000,0000,,you it in just a sec. The only weird Dialogue: 0,0:15:13.48,0:15:15.02,Default,,0000,0000,0000,,thing we have to do here is tell AMQParty Dialogue: 0,0:15:15.02,0:15:16.32,Default,,0000,0000,0000,,which Rabbit to talk to, and you kind of Dialogue: 0,0:15:16.32,0:15:18.04,Default,,0000,0000,0000,,saw that in the, in the client gem a Dialogue: 0,0:15:18.04,0:15:19.71,Default,,0000,0000,0000,,little bit, so that's a little bit of setup Dialogue: 0,0:15:19.71,0:15:21.29,Default,,0000,0000,0000,,we do. Again, like I said, when we make Dialogue: 0,0:15:21.29,0:15:24.30,Default,,0000,0000,0000,,the decision about which, whether HTTParty\Nor AMQParty. So Dialogue: 0,0:15:24.30,0:15:26.27,Default,,0000,0000,0000,,we tell it which Rabbit. And then, inside,\Nwe, Dialogue: 0,0:15:26.27,0:15:30.62,Default,,0000,0000,0000,,five hundred times, request this JSON using\NAMQParty and Dialogue: 0,0:15:30.62,0:15:33.17,Default,,0000,0000,0000,,then five hundred times request the same thing\Nusing Dialogue: 0,0:15:33.17,0:15:33.45,Default,,0000,0000,0000,,HTTParty. Dialogue: 0,0:15:33.45,0:15:37.45,Default,,0000,0000,0000,,So here, I'll show you that in, in use. Dialogue: 0,0:15:37.45,0:15:41.36,Default,,0000,0000,0000,,Let's see. OK. Dialogue: 0,0:15:41.36,0:15:48.36,Default,,0000,0000,0000,,Let's make this big. All right. So here I'm Dialogue: 0,0:15:49.39,0:15:53.08,Default,,0000,0000,0000,,gonna boot the app using Unicorn. So Unicorn\Nis Dialogue: 0,0:15:53.08,0:15:57.08,Default,,0000,0000,0000,,listing on port 8080. Wow. That's really big.\NTrust Dialogue: 0,0:15:57.08,0:15:59.55,Default,,0000,0000,0000,,me, it's 8080 there. I'm gonna boot the same Dialogue: 0,0:15:59.55,0:16:02.10,Default,,0000,0000,0000,,map using Jackalope. The only difference I\Nhave to Dialogue: 0,0:16:02.10,0:16:03.28,Default,,0000,0000,0000,,do to boot the app is I have to Dialogue: 0,0:16:03.28,0:16:05.33,Default,,0000,0000,0000,,say with the right queue name, so it's going Dialogue: 0,0:16:05.33,0:16:08.12,Default,,0000,0000,0000,,to listen to the test dot simple queue. Dialogue: 0,0:16:08.12,0:16:10.42,Default,,0000,0000,0000,,So there it is running. And then down here Dialogue: 0,0:16:10.42,0:16:13.17,Default,,0000,0000,0000,,I'm gonna starty the bench mark. And like\NI Dialogue: 0,0:16:13.17,0:16:16.39,Default,,0000,0000,0000,,said, it's gonna five hundred times hit each\Nservice. Dialogue: 0,0:16:16.39,0:16:18.63,Default,,0000,0000,0000,,What it actually does is hit each service\Nthree Dialogue: 0,0:16:18.63,0:16:20.38,Default,,0000,0000,0000,,times, just to make sure that it's warm, and Dialogue: 0,0:16:20.38,0:16:22.73,Default,,0000,0000,0000,,then it can go through and hit it all Dialogue: 0,0:16:22.73,0:16:24.65,Default,,0000,0000,0000,,the way through. And there we go. Dialogue: 0,0:16:24.65,0:16:26.94,Default,,0000,0000,0000,,So you can see, it's two point nine seconds Dialogue: 0,0:16:26.94,0:16:30.05,Default,,0000,0000,0000,,total to do five hundred AMQP requests, and\Nthree Dialogue: 0,0:16:30.05,0:16:33.30,Default,,0000,0000,0000,,point six seconds total to do five hundred\NHTTP Dialogue: 0,0:16:33.30,0:16:37.04,Default,,0000,0000,0000,,requests. I was actually surprised when I\Ngot this Dialogue: 0,0:16:37.04,0:16:40.75,Default,,0000,0000,0000,,result. Jackalope is beta. I mean, it's, we're\Nusing Dialogue: 0,0:16:40.75,0:16:43.93,Default,,0000,0000,0000,,it at Optoro, but it's not really been battle-tested. Dialogue: 0,0:16:43.93,0:16:46.95,Default,,0000,0000,0000,,But it's faster, at the moment. So why is Dialogue: 0,0:16:46.95,0:16:47.73,Default,,0000,0000,0000,,it faster? Dialogue: 0,0:16:47.73,0:16:51.67,Default,,0000,0000,0000,,Well, maybe I haven't written all the code\Nyet. Dialogue: 0,0:16:51.67,0:16:55.53,Default,,0000,0000,0000,,But more likely it, more likely it's because\Nof Dialogue: 0,0:16:55.53,0:16:59.80,Default,,0000,0000,0000,,this concept in TCP called the slow-start\Nphenomonon. And Dialogue: 0,0:16:59.80,0:17:02.63,Default,,0000,0000,0000,,also, your whole TCP negotiation. So each\None of Dialogue: 0,0:17:02.63,0:17:06.70,Default,,0000,0000,0000,,these five hundred HTTP requests, close the\Nconnection, open Dialogue: 0,0:17:06.70,0:17:10.77,Default,,0000,0000,0000,,the connection, send the message, receive\Nthe response. When Dialogue: 0,0:17:10.77,0:17:12.80,Default,,0000,0000,0000,,you open the TCP connection you go through\Na Dialogue: 0,0:17:12.80,0:17:14.97,Default,,0000,0000,0000,,whole sinaq phase, which I didn't put slides\Nin Dialogue: 0,0:17:14.97,0:17:17.31,Default,,0000,0000,0000,,for and maybe should have. But it's. Dialogue: 0,0:17:17.31,0:17:20.63,Default,,0000,0000,0000,,I highly recommend checking out Eliot Gregorich's\Ntalks, by Dialogue: 0,0:17:20.63,0:17:23.68,Default,,0000,0000,0000,,the way, about how HTTP works, how TCP works. Dialogue: 0,0:17:23.68,0:17:27.07,Default,,0000,0000,0000,,But basically, you go through protocol negotiation\Nfor any Dialogue: 0,0:17:27.07,0:17:32.28,Default,,0000,0000,0000,,TCP connection, and then there's a feature\Nof TCP Dialogue: 0,0:17:32.28,0:17:34.35,Default,,0000,0000,0000,,called the slow-start feature, which essentially\Nallows you to Dialogue: 0,0:17:34.35,0:17:37.64,Default,,0000,0000,0000,,negotiate your connection speed. And that's\Nreally great when Dialogue: 0,0:17:37.64,0:17:39.60,Default,,0000,0000,0000,,you're talking over the internet, and you're\Nnot sure Dialogue: 0,0:17:39.60,0:17:42.09,Default,,0000,0000,0000,,of the latency or the availability of routers\Nto Dialogue: 0,0:17:42.09,0:17:44.70,Default,,0000,0000,0000,,be decent along the way. But when you're doing Dialogue: 0,0:17:44.70,0:17:47.72,Default,,0000,0000,0000,,internal applications, it just gets in your\Nway. It Dialogue: 0,0:17:47.72,0:17:48.52,Default,,0000,0000,0000,,just slows you down. Dialogue: 0,0:17:48.52,0:17:52.37,Default,,0000,0000,0000,,So AMQP, we hold a persistent connection to\Nthe Dialogue: 0,0:17:52.37,0:17:55.35,Default,,0000,0000,0000,,AMQP broker. We do one sinaq cycle, and then Dialogue: 0,0:17:55.35,0:17:57.99,Default,,0000,0000,0000,,we get our maximum connection speed and we\Nstay Dialogue: 0,0:17:57.99,0:18:00.31,Default,,0000,0000,0000,,there. And then we can multiplex information\Nover that Dialogue: 0,0:18:00.31,0:18:03.18,Default,,0000,0000,0000,,single connection and it works really well.\NNow, you Dialogue: 0,0:18:03.18,0:18:05.07,Default,,0000,0000,0000,,could write that with HTTP if you did a Dialogue: 0,0:18:05.07,0:18:08.69,Default,,0000,0000,0000,,keep-alive connection, held over that connection\Nand talk to Dialogue: 0,0:18:08.69,0:18:09.56,Default,,0000,0000,0000,,the same thing back and forth. Dialogue: 0,0:18:09.56,0:18:11.28,Default,,0000,0000,0000,,But, the bottom line is that most of us Dialogue: 0,0:18:11.28,0:18:13.38,Default,,0000,0000,0000,,don't do that when we write HTTP. We're using Dialogue: 0,0:18:13.38,0:18:17.92,Default,,0000,0000,0000,,something like HTTParty or, I always forget\Nthe tiforce Dialogue: 0,0:18:17.92,0:18:21.00,Default,,0000,0000,0000,,or tif- whatever it is. Sorry. Dialogue: 0,0:18:21.00,0:18:21.81,Default,,0000,0000,0000,,Most of the time, you know, we drop the Dialogue: 0,0:18:21.81,0:18:23.74,Default,,0000,0000,0000,,connection, you know, in between requests.\NWe don't hold Dialogue: 0,0:18:23.74,0:18:25.62,Default,,0000,0000,0000,,it open. It's just not something we think\Nabout. Dialogue: 0,0:18:25.62,0:18:29.86,Default,,0000,0000,0000,,So using AMQParty or any of the libraries\Nthat Dialogue: 0,0:18:29.86,0:18:32.36,Default,,0000,0000,0000,,we're published, it holds that open and it\Njust Dialogue: 0,0:18:32.36,0:18:34.54,Default,,0000,0000,0000,,makes it more efficient overall. Dialogue: 0,0:18:34.54,0:18:36.31,Default,,0000,0000,0000,,So I hope that's the primary explanation of\Nwhy Dialogue: 0,0:18:36.31,0:18:43.31,Default,,0000,0000,0000,,it's so much faster. So I just wanted to Dialogue: 0,0:18:44.34,0:18:45.93,Default,,0000,0000,0000,,mention a few references, a few things that\Nwere Dialogue: 0,0:18:45.93,0:18:47.87,Default,,0000,0000,0000,,really inspriring when we kind of went down\Nthis Dialogue: 0,0:18:47.87,0:18:49.88,Default,,0000,0000,0000,,road. You know, this is really a departure\Nfrom Dialogue: 0,0:18:49.88,0:18:53.34,Default,,0000,0000,0000,,what we're used to in Rails. And the Architecture: Dialogue: 0,0:18:53.34,0:18:55.97,Default,,0000,0000,0000,,The Lost Years talk and Matt Wynne's original\NHexegonal Dialogue: 0,0:18:55.97,0:18:58.32,Default,,0000,0000,0000,,Rails talks were all about departing from\Nwhat we're Dialogue: 0,0:18:58.32,0:19:00.43,Default,,0000,0000,0000,,used to, I think. So those are really interesting. Dialogue: 0,0:19:00.43,0:19:02.91,Default,,0000,0000,0000,,If you haven't checked those out, definitely\Ndo. Dialogue: 0,0:19:02.91,0:19:05.34,Default,,0000,0000,0000,,Additionally, Martin Fowler posted a recent\Narticle that was Dialogue: 0,0:19:05.34,0:19:08.45,Default,,0000,0000,0000,,awesome, called Micro Services. Definitely,\Ndefinitely read this if Dialogue: 0,0:19:08.45,0:19:12.19,Default,,0000,0000,0000,,you are looking into service-oriented architectures.\NIt lets you Dialogue: 0,0:19:12.19,0:19:14.79,Default,,0000,0000,0000,,not think about that heavy-weight bloat that\Nwe think Dialogue: 0,0:19:14.79,0:19:16.65,Default,,0000,0000,0000,,about with SOA. Dialogue: 0,0:19:16.65,0:19:19.31,Default,,0000,0000,0000,,It's really a revisitation of the idea of,\Njust, Dialogue: 0,0:19:19.31,0:19:22.61,Default,,0000,0000,0000,,you have independent services that are collaborating\Nto get Dialogue: 0,0:19:22.61,0:19:24.82,Default,,0000,0000,0000,,something done in a very simple way. And that's Dialogue: 0,0:19:24.82,0:19:27.53,Default,,0000,0000,0000,,really, again, also influenced the direction\Nwe're taking here. Dialogue: 0,0:19:27.53,0:19:30.90,Default,,0000,0000,0000,,We want to introduce as few specific choices\Nas Dialogue: 0,0:19:30.90,0:19:33.09,Default,,0000,0000,0000,,possible to just kind of give us a simple Dialogue: 0,0:19:33.09,0:19:36.68,Default,,0000,0000,0000,,transport to, to build on top of. Additionally,\Nthe Dialogue: 0,0:19:36.68,0:19:39.53,Default,,0000,0000,0000,,Ruby AMQP gem has some awesome docs about\Nhow Dialogue: 0,0:19:39.53,0:19:42.53,Default,,0000,0000,0000,,AMQP works, how to use it with Ruby. And Dialogue: 0,0:19:42.53,0:19:45.51,Default,,0000,0000,0000,,RabbitMQ also publishes some really great\Ndocumentation on what Dialogue: 0,0:19:45.51,0:19:47.62,Default,,0000,0000,0000,,AMQP is, how it works. How to use it Dialogue: 0,0:19:47.62,0:19:49.60,Default,,0000,0000,0000,,in the organization in your applications. Dialogue: 0,0:19:49.60,0:19:51.65,Default,,0000,0000,0000,,And there's also this really great article\NI found Dialogue: 0,0:19:51.65,0:19:55.03,Default,,0000,0000,0000,,about how HTTP works, in general. It's, I\Nthink Dialogue: 0,0:19:55.03,0:19:58.43,Default,,0000,0000,0000,,a piece of school material from a university\Nin Dialogue: 0,0:19:58.43,0:19:59.96,Default,,0000,0000,0000,,Singapore. Definitely check it out. It's got\Nreally great Dialogue: 0,0:19:59.96,0:20:00.73,Default,,0000,0000,0000,,diagrams. Dialogue: 0,0:20:00.73,0:20:06.75,Default,,0000,0000,0000,,Thanks. Again, I'm Josh. I'm at jszmajda on\Nthe Dialogue: 0,0:20:06.75,0:20:09.73,Default,,0000,0000,0000,,Twitters. I am the CTO at Optoro. We have Dialogue: 0,0:20:09.73,0:20:12.72,Default,,0000,0000,0000,,blinq dot com. We have retailers with their\Nreturned Dialogue: 0,0:20:12.72,0:20:14.71,Default,,0000,0000,0000,,goods and excess goods, help them figure out\Nwhat Dialogue: 0,0:20:14.71,0:20:16.81,Default,,0000,0000,0000,,it is, what the current value is and move Dialogue: 0,0:20:16.81,0:20:18.07,Default,,0000,0000,0000,,it quickly. Dialogue: 0,0:20:18.07,0:20:20.13,Default,,0000,0000,0000,,Additionally, I am the host of the Ruby hangout. Dialogue: 0,0:20:20.13,0:20:22.48,Default,,0000,0000,0000,,Just a quick blurb for the Ruby hangout, it's Dialogue: 0,0:20:22.48,0:20:25.22,Default,,0000,0000,0000,,a online meetup. It's really handy when you\Ncan Dialogue: 0,0:20:25.22,0:20:27.85,Default,,0000,0000,0000,,go face-to-face and talk to people if you\Nhave Dialogue: 0,0:20:27.85,0:20:28.96,Default,,0000,0000,0000,,a local meet up. If you don't have a Dialogue: 0,0:20:28.96,0:20:30.63,Default,,0000,0000,0000,,local meet up or if you're too busy or Dialogue: 0,0:20:30.63,0:20:32.51,Default,,0000,0000,0000,,if you can't make it for whatever reason,\Nthe Dialogue: 0,0:20:32.51,0:20:35.57,Default,,0000,0000,0000,,Ruby hangout is an online meet up to, essentially, Dialogue: 0,0:20:35.57,0:20:38.25,Default,,0000,0000,0000,,give you that local meet up feel, as much Dialogue: 0,0:20:38.25,0:20:40.06,Default,,0000,0000,0000,,as we can online. So check that out. It's Dialogue: 0,0:20:40.06,0:20:41.90,Default,,0000,0000,0000,,a lot of fun. I'm one of the co-organizers Dialogue: 0,0:20:41.90,0:20:44.11,Default,,0000,0000,0000,,of the DC Ruby Users group. And I want Dialogue: 0,0:20:44.11,0:20:46.40,Default,,0000,0000,0000,,to give a quick shoutout to Jonathan. Thanks\NJon. Dialogue: 0,0:20:46.40,0:20:49.56,Default,,0000,0000,0000,,He's on my team, helped me get Jackalope over Dialogue: 0,0:20:49.56,0:20:52.80,Default,,0000,0000,0000,,the, over the finish line. So super helpful\Non Dialogue: 0,0:20:52.80,0:20:53.28,Default,,0000,0000,0000,,that. Dialogue: 0,0:20:53.28,0:20:55.65,Default,,0000,0000,0000,,All the code's on GitHub. Github dot com slash Dialogue: 0,0:20:55.65,0:20:59.42,Default,,0000,0000,0000,,rack dash amqp slash rack dash amqp is where Dialogue: 0,0:20:59.42,0:21:01.60,Default,,0000,0000,0000,,the RC lives and has bookmarks to the other Dialogue: 0,0:21:01.60,0:21:06.32,Default,,0000,0000,0000,,parts of the project. And I would love to Dialogue: 0,0:21:06.32,0:21:10.30,Default,,0000,0000,0000,,take your questions, because that talk was\Nway short. Dialogue: 0,0:21:10.30,0:21:12.84,Default,,0000,0000,0000,,And I've got, actually, a whole bunch of stuffed Dialogue: 0,0:21:12.84,0:21:16.10,Default,,0000,0000,0000,,Jackalopes up here for good questions. So\Nplease feel Dialogue: 0,0:21:16.10,0:21:18.30,Default,,0000,0000,0000,,free to come grab one.