Grandma, "Event-Driven" is just a fancy word for magic. Don't worry about it.
Explain “Event-Driven” Web Servers to Your Grandma
11–20 of 38 posts
Re: Explain “Event-Driven” Web Servers to Your Grandma
#12The hardware is doing fundamentally the same thing either way, but in the threaded model, it's also doing a lot of other stuff that you probably don't care about.
So, to explain it to my grandma: It's just a simpler way to think about it. There isn't really a big difference.
Re: Explain “Event-Driven” Web Servers to Your Grandma
#13"Event-driven" architecture doesn't imply a fundamentally different way of handling requests than thread-based. The only difference is that in an event-driven architecture, the scheduling is handled in the userspace code. In a thread-based architecture, it's done in the kernel. The advantage of doing it in the userspace code is that it can be done in a simpler, more specialized way. The hardware is doing fundamentall…
No, the advantage of doing it in userspace code is that you can paper over the deficiencies of the layers under the one you are working in with significant manual effort. Node.js introduced the concurrency problems when it selected Javascript as one of the layers, it doesn't get much credit in my mind for then solving them at great effort and with horrible damage done to the resulting program structures. The problems Node.js solves are not fundamental to programming, they are fundamental to Javascript.
Pick something like Erlang and the problem never exists in the first place. You don't have to paper over the deficiencies in the lower levels, because the levels below the code you're writing aren't deficient for concurrency in the first place.
I should point out that in general this is not necessarily a bad thing; alas, there's always some way your lower layers are deficient, and it's far worse when they make it impossible to paper over the problem. Still, you will never end up with simpler code. More specialized, oh my yes, but certainly not simpler. And the wisdom of picking a layer that is fundamentally deficient for your core target problem then papering over it seems pretty limited to me.
Re: Explain “Event-Driven” Web Servers to Your Grandma
#14[deleted]
Re: Explain “Event-Driven” Web Servers to Your Grandma
#15Hmm, perhaps a closer analogy: Traditional Web Server: The pizza shop receives a call for the initial order and starts the pie. Then the customer calls back periodically to check if the pie is done because the pizza shop cannot call back or deliver.
In a traditional web server, the person making pizzas only makes one at a time and can't do anything else until that pizza is done and delivered. In an evented model, each pizza maker makes many pizzas at once, and just watches for events (the oven timer goes off) and acts on them. (takes the pizza out) Sometimes if a task is taking him too long, he'll ask an assistant to work on it so that he can get back to making pies.
Re: Explain “Event-Driven” Web Servers to Your Grandma
#16Grandma, "Event-Driven" is just a fancy word for magic. Don't worry about it.
Why are people upvoting this comment? not fully implemented and readily available != magic.
Re: Explain “Event-Driven” Web Servers to Your Grandma
#17"Event-driven" architecture doesn't imply a fundamentally different way of handling requests than thread-based. The only difference is that in an event-driven architecture, the scheduling is handled in the userspace code. In a thread-based architecture, it's done in the kernel. The advantage of doing it in the userspace code is that it can be done in a simpler, more specialized way. The hardware is doing fundamentall…
"The advantage of doing it in the userspace code is that it can be done in a simpler, more specialized way." No, the advantage of doing it in userspace code is that you can paper over the deficiencies of the layers under the one you are working in with significant manual effort. Node.js introduced the concurrency problems when it selected Javascript as one of the layers, it doesn't get much credit in my mind for then…
Re: Explain “Event-Driven” Web Servers to Your Grandma
#18[deleted]
I agree. Maybe i'm not on the same page as the article author on what he meant by "event driven" but if he's talking about websockets/comety web servers, then as I mentioned in a comment below, the difference is that in a traditional web server the customer has to keep calling back to know the status of the pizza (polling) versus having the pizzeria deliver or call the customer back for pickup (server push). Fewer co…
Re: Explain “Event-Driven” Web Servers to Your Grandma
#19http://www.quora.com/Can-someone-explain-poll-epoll-in-Layma...
Re: Explain “Event-Driven” Web Servers to Your Grandma
#20Explain "web server" to your grandma. Oopsie.
It's like a waiter at a restaurant- you tell it what you want and a few moments later, the waiter (or server) returns what you've ordered.
Good?