text stringlengths 0 1.32k |
|---|
**James Snell:** \[03:44\] Right. There are other protocols that are becoming increasingly more important to the web - WebSockets, for instance. We don't have WebSocket support in there, and we shouldn't have it, because it's not already there. Quick is another one - it's a protocol that's starting to gain a lot of tra... |
With HTTP/2, the decision basically just comes to -- we already have HTTP/1; we know HTTP/2 is gonna continue to grow in relevance, we have a lot of people asking for it... It just makes a lot of sense to have it in Core and have it available. |
**Adam Stacoviak:** We also talked about - and maybe you can even end this argument, too - how you define what should and shouldn't be in Core, and you it sounded like you said - maybe I'll answer this for you, and you can agree or disagree - around web fundamentals. If it's fundamental to doing web stuff, it makes sen... |
**James Snell:** If it's not already there, then it shouldn't be added. Another example of this was URL parsing. We have URL parse, but it's fundamentally broken in a number of important ways. It's there, it fundamentally works, but there is quite a few use cases where URL parse just doesn't function correctly, so we a... |
We're not adding something that's brand new, that doesn't already exist as part of the platform; we're just evolving what's already there. That's where I think we draw the line. |
**Adam Stacoviak:** For those who may not be as familiar as you might be with NodeCore, what exactly makes up NodeCore to make you say "Don't add more to it, just keep things in modules"? |
**James Snell:** The basic protocol supports DNS, UDP, TCP, TLS, HTTP - these fundamentals of basic web application programming. That is what Core is to me. Now, there are things that are in support of that. Obviously, we have to have a file System.io, we have to have a Venting System, buffer for just basic data manage... |
Even if you look at Electron, there's basically web applications that are bundled into a native app. You cannot get away from those fundamental pieces of that basic protocol support, and that to me is what defines Node. |
**Adam Stacoviak:** It's almost what you said - I said you said, but you said it - web fundamentals. |
**James Snell:** Web fundamentals, right. |
**Adam Stacoviak:** If it's around that, it belongs in Core. Otherwise... |
**James Snell:** Otherwise push that to the ecosystem. |
**Adam Stacoviak:** ...module. |
**James Snell:** Yeah. |
**Adam Stacoviak:** So you're working on HTTP/2... What's interesting about HTTP/2 for the Node community? |
**James Snell:** That it's actually a very different protocol than HTTP/1. It has the same name, but that 2 is really important. The fact that it uses a binary framing instead of a text framing, and just line delimitation... Stateful Header Compression adds an interesting dimension of -- there is a whole lot more state... |
\[08:08\] With the Header Compression and the multiplexing stuff at the protocol levels you can get much more efficient use of your connections. When we start getting into the real-world benchmarks of real applications, rather than the peak load type of benchmarks I've been doing currently, I think we'll see much more ... |
The protocol provides no limit to the number of in-flight requests and responses you can have simultaneously over a single connection. Then you add things like push streams on top of that - it adds a significant new thing that you just have to consider of how you're building your applications and what the interactions ... |
I think there's going to be a lot of coming to terms with the protocol and getting experience with the protocol, and kind of figuring out what those best practices are, because it's still a very young protocol and there's not a lot of industry best practice to draw from. It's just kind of "Let's get it out there and ge... |
**Adam Stacoviak:** I talked to Mikeal Rogers earlier about kind of the "state of the union", so to speak, for Node.js and he was coming at it from a direction and governance side and less of a code side. But one thing he said was a really important factor in this next year - security. How does the work you're doing at... |
**James Snell:** There's two things there. With HTTP/1 in Core right now, a number of design decisions were made early on to favor performance over spec compliance. It turns out that there are a number of compliance things in the spec that says "Don't allow white space in headers", right? And there's very good reasons ... |
With HTTP/2, we're gonna be taking an approach where we're gonna be very spec-compliant. We're not favoring performance over that. We're not sacrificing one over the other. It is going to be absolutely compliant to the specification, without taking those performance shortcuts. And that is something that I am emphasizin... |
\[11:47\] The other important thing is that even though HTTP/2 does not require TLS - per the spec you can do plain text if you want - the browser implementation's the primary client of HTTP/2 right now... Chrome, Firefox, Safari and some of the others, they require that they will only talk to HTTP/2 server over TLS. I... |
The one limiting factor there is Node hasn't really had a great reputation as a TLS terminator. A lot of people, just as the best practice, put a proxy in front of it, and then they'll reverse proxy back over a plaintext connection back to Node just to ensure the performance. A lot of that has to do with the way the cr... |
**Adam Stacoviak:** What gets you the most excited about HTTP/2 being available? I know you're working on things like -- we've talked about the state of things, but what's the most exciting to you that's gonna change things for...? |
**James Snell:** Just getting it into the hands of developers and seeing what they do with it. It is a very young protocol, it is brand new and I have my issues with it. I was actually involved with the working group for a while that was actually creating it, and I was one of the co-editors on the draft. It was early o... |
I love seeing all the different ways that people are using Node today in ways we didn't even imagine that they could or would. And I wanna see that also with the protocol, just the experimentation and all the different new types of applications that could be developed, or all the different ways that it could be innovat... |
**Adam Stacoviak:** Any ideas, any pontification you could do on what could be built? |
**James Snell:** There are all kinds of opportunities for more interesting RESTful APIs... Push streams are something really interesting, and so far they've only been looked at as a way of pre-populating a request cache, right? "I'm gonna push it out so you don't have to do it." But I think with REST APIs push streams ... |
One person I was talking and one of the ways that they were prototyping stuff and using HTTP/2 is they would create a tunnel over an HTTP/2 connection where they would open a connection with a client, but then once the connection was established it would switch roles and allow the server to act as the client, and the c... |
You can't do that with HTTP/1, but because of the multiplexing and the communication model that exists in HTTP/2, that kind of stuff is allowed, it's something you can do. HTTP/2 is gonna enable new extensibility models, new possibilities for new kinds of protocols that kind of co-exist with the HTTP/2 semantics. And w... |
\[16:26\] There's a lot of new types of innovations I think that could come out of it, but we need to build a collective experience working with it in order to be able to tease those things out. |
**Adam Stacoviak:** You mentioned some things you're not happy with with the HTTP/2 protocol, and I couldn't let you not tell me what those are. \[laughter\] What are the "gotchas", what are the things that are just bugging you about this protocol? |
**James Snell:** Staple Header Compression - it's very effective, right? Headers in HTTP are very repetitive; you're sending the same data over and over again - cookies, user agent strings, all these kinds of things. When it comes to actually what's transmitted over the wire, it's a lot of waste, like a date. In HTTP/1... |
HPACK, which is the staple Header Compression protocol in HTTP/2 uses this state table that's maintained at both ends. There is actually two in each direction: the center has two, the receiver has two. The receiver gets to say how much state is actually stored, the center gets to say what's actually stored in that tabl... |
But for the entire life of the connection of that socket, however long that socket is kept open, you have to maintain the state, and that doesn't exist in HTTP/1 today. HTTP/1 is a completely stateless protocol, and HTTP/2 switches that and makes it where you have to maintain state. You have to maintain this server aff... |
Even over multiplexed requests, all of those requests and responses share the same state tables. It adds an additional layer of complexity that just didn't exist previously. Personally, I don't think it was needed; I think that there are other ways... |
**Adam Stacoviak:** What would you have done differently? |
**James Snell:** I actually worked on the spec as one of the co-authors and I had a proposal for just using a more efficient binary coding of certain headers like dates, right? Instead of representing numbers as text, representing them as binary, right? The compression ratios work as good, but you could transmit that d... |
**Adam Stacoviak:** Right. It makes sense to shrink it, rather than... \[cross-talk 00:21:46.08\] I kind of agree with you on the state, because it seems like it's adding this extra layer of -- it's almost like somebody shakes your hand and doesn't let it go. |
**James Snell:** \[19:49\] Yeah, in a lot of ways that's exactly what it is. Now, Google has a ton of experience with Speedy, and a lot of what's in HTTP/2 came out of the work that Google did on Speedy and I have a huge amount of respect for everything they did and have provided. HPACK also came out of Google, so they... |
I disagreed with some of those conclusions, but the working group decided, "You know what? This is what we're gonna move forward with, and that's what they did." At this point it's like, "I don't like it, but that's what it is, and that's what we're moving forward on." |
Some of the other things in terms of additional complexity is HTTP/2 has its own flow control, has its own prioritization; you can have streams depend on other streams, and when you set the priority on one, it sets the priority for the entire graph. There's just a lot there that doesn't exist in HTTP/1. How much of tha... |
This additional complexity is something that in NodeCore we're looking at this and we have to decide how much of that do we pass on to the user, versus how much of that do we do ourselves? If we do it all ourselves, we're providing fewer knobs for the users to turn, to tune things, and we're making it less interesting ... |
The additional complexity is not something we can easily deal with. It's something we have to kind of... |
**Adam Stacoviak:** It's right there in your face, you have to do something about it. |
**James Snell:** Right, you have to do something about it. |
**Adam Stacoviak:** So stateless compression - that's one thing; maybe give me the flipside of that. I guess you've already kind of described it to a bit with the complexity, but what's the worst that could happen? |
**James Snell:** The server affinity issue is actually the biggest issue here. A lot of the proxy software vendors had some real significant problems with HTTP/2 as it was being defined, and you had a lot of criticism being put forward -- I can't remember his name, but the author of Varnish proxy, he's very public in h... |
You can't do what a lot of the proxies do currently, which is just kind of read the first few lines, determine where you're gonna route that thing to, then stop and just forward it on... Which is a super efficient way of doing it. You have to process the entire block of headers, then make the determination of whether y... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.