Book Review: Instant Vert.x
Wednesday, October 16, 2013 |I recently acquired a copy of Instant Vert.x (Kindle version here) by Simone Scarduzio. It’s a short book (54 pages), so here’s my short-ish review. :)
Your first question might be, "What is Vert.x"? From its web site,
Vert.x is a lightweight, high performance application platform for the JVM that’s designed for modern mobile, web, and enterprise applications.
While that description says it’s for the JVM, the library itself is polyglot, supporting Java, JavaScript, CoffeeScript, Ruby, Python or Groovy, or a combination thereof.
With that out of the way, so you’ll have an idea of what’s being discussed (and thus be able to decide if you care to keep reading :), let’s turn to the book. The book starts off with an introduction much more robust than what I just gave. :) The author gives a good description of what the platform offers, as well as a good introduction to some of the basic terms associated with Vert.x.
After the introduction, the author then walks his reader through setting up the environment: Java, Jython (optional), JRuby (optional), and, finally, Vert.x itself. While Vert.x modules, or "verticles" can be written in a number of different languages, they all run eventually on the JVM. The steps for installing Jython and JRuby, then, are simply to make the reader’s life a little easier, should he be interested in using one of those two languages. The installation section closes with one small example, implemented in each of the support languages, giving the reader a good sampling of what that would look like. The rest of the book uses Javascript exclusively.
The next two chapters walk the reader through writing simple, but complete implementations (meaning working, but not necessarily feature-rich or robust) of a web server and an "IRC-style" chat server. The chat server example is a bit more complex than the web server, due, in part, to the more complex nature of the system, introducing handler functions and a pub/sub even bus.
The next-to-last chapter discusses the "top 8 features you need to know about":
-
HTTP server, HTTP clients and event bus
-
Transport layer security (SSL) for HTTP
-
Asynchronous requests with SockJS-based EventBus bridge
-
EventBus bridge: breaking out of the request-response model
-
Using all the cores - multiple instances and shared data
-
Cache max size and eviction policies
-
Scaling out - clustering
-
Creating a module
-
Installing third-party modules
Finally, we end with a list of people and places you should get to know.
With all that said, my take on the book: Not knowing anything about Vert.x when I started this book, I really enjoyed it’s brevity, and it’s pace. There seems to be a tendency with technical books to jump straight to the gory details of subject (for which there is a time and place :), leaving newcomers a bit dazed and confused. This book, though, as I’m sure all the books in Packt’s "Instant" series are designed to do, gives a great, surface-level introduction to the technology, explaining just enough to get you going. Now, having read the book and having a better, high-level understanding of what Vert.x is, I feel better-prepared to start digging through it’s web site or a bigger, more complete text on the subject.
I do have a few nits, though. As a Java guy, I would have liked to see the examples in Java. The problem with that, though, is I’m sure there’s a Python guy somewhere going to make a similar statement. :) Also, it could very well be that the best practice amongst Vert.x officiandos to use Javascript. I know Javascript, but I found myself having to read the code a little more slowly than I would have had to with Java. The flip side is that if he had used Java, the book would probably be twice as long. :P
On a nontechnical note, the text also could have used a little better editing. There were some parts of the text that read really oddly. Those tend to jump out at me and give me a bit of heartburn (I know. I’m sure regular readers of my blog are currently forming the word "kettle" in their minds ;). That kind of thing may or may not be an issue for you, but, in case it is, you’ve been warned. Lastly, the Kindle edition (and I’m sure the print edition, as well) just ends. No summary, etc. I found myself wildly swiping and poking at my tablet trying to find the next page before I realized there wasn’t one. Neither of these "issues" are real problems, of course, but I mention them just to be a fair.
Overall, I enjoyed the book. The examples were clean and small, and the explanations of what was being done and why were sufficient to help me understand what was going on. While all of the topics in the book can be found for free on the internet (as with every technical book), it’s nice to have all of those ideas aggregated in one place, and this is a good place to start if you’re interested in Vert.x.