 Welcome to the session on RATPAC. The idea here is to give a foot for thought, like we have been building a STTP application. By that, I mean both the traditional web applications plus the rest services, what they're using. So we have been building these for quite some time, but can that be done in a better way? Can there be a better programming model for that right on JVM? I'm sure all of you have learned a lot about functional programming and might have got inspired by that. But if your day job is to develop pretty much on JVM, then how some of these good ideas can be brought on to JVM and use them. So RATPAC is one such effort. So you could call it anywhere between a library and a framework. It's not so opinionated as many frameworks, but it's a good tool for developing a lightweight, say, microservices or gateway to microservices, REST API for mobile device or so. So that's where RATPAC stands. RATPAC was started about maybe three years back as a groovy version of Sinatra. But later on people found that much more can be done on that right by changing the programming model. So as of today, RATPAC core is totally a Java 8 library. On top of that, you have a small groovy layer, which makes it very easy to write a few DSLs rather than writing full-fledged methods. But Java 8 does have lambdas, which will make the life a little bit easier. But if I were to do everything in Java 8, probably we can look at only a few examples. So it might take quite a bit of time to explain how old programming is. So that kind of readability is what groovy DSL will bring in. I don't have any more slides, so I'll right away get into the code and explain all the concepts or the programming model for what I want to highlight using code. But before jumping on to that, the traditional programming model is the thread per request. So whenever a request come, I mean, the server would have already created few hundred threads and is ready to serve the request. So whenever a request comes, a thread is allocated for that request. And throughout the processing of that request, the thread is allocated only to that particular request. But serving request involves several IOs, maybe calling the reading file, making the database calls, or maybe calling some web services and getting the response. So all these times, the thread will get blocked. So what this leads to is that non-optimum utilization of resource.