Menú Principal

Wednesday, May 30, 2012

My Review of REST API Design Rulebook

Originally submitted at O'Reilly
REST API Design Rulebook
Designing Consistent RESTful Web Service Interfaces

An Attempt to Unify the REST APIs
By Eder Andres Avila Niño from Paipa, Colombia on 5/30/2012
4out of 5
Pros: Easy to understand, Concise
Best Uses: Novice, Intermediate, Student
Describe Yourself: Developer
This a good book for beginners willing to understand what a REST API is about, its characteristics, HTTP methods and media resources in a short, concise, panoramic way. This book is an attempt to collect the best practices to expose the external behavior that a client, web or mobile, expects from a REST API server for processing requests and returning responses. For beginners, it offers a foundational knowledge about what a REST API should provide; and for experienced developers it offers an implicit 'audit' checklist to evaluate if their APIs are REST compliant.

For those software and web developers that want to enter to the REST API development, 'REST API Design Rulebook' is a good starting point since it explains through five sets of rules the underlying knowledge of a REST API, their structures, methods, documentation and suggested exposure to client applications and other APIs. On my opinion, and keeping proportions, this book, as a design pattern does, gives to developers the common vocabulary to discuss, specify, design, develop and test RESTful APIs.

The book's chapters are easy, quick reading, except chapter 5 'Representation Design' which is the one that requires more intellectual effort because it explains how to structure well-formed formats for message body (i.e. JSON), hypermedia (i.e. links), media schemas and API errors. Be careful with this chapter since it introduces a new Internet format not yet approved (the WRML), but on author's opinion this new format will become the client–server more verbose with respect to the format of a returned document (i.e. resource).

However, experienced REST developers may already know and have implemented many of the rules defined in the book, and instead be more interested in how to design the back-end service layers that conform to a RESTful API avoiding RPC or RMI practices, if possible. Such inner workings are not covered, but I think they could benefit from this book by performing a 'REST API compliant test' by taking this rulebook as a checklist.

By taking that implicit checklist approach, this book also has the side effect of providing several criteria to evaluate if a software framework that claims to help to the development of REST APIs indeed offers a full set of features that compliant with REST behavior, much more than routing HTTP requests and isolating from user interface artifacts.

Finally, in chapter 7 'Final Thoughts' the author depicts the need to unify a methodology to design a REST API that decreases disparities between APIs and improves team communication. Author depicts his solution known as the WRLM, akin to, say UML and RUP. On my opinion, a more detailed example included in this chapter would have been useful to show us the WRML's full potential rather than visiting the official web page.

In conclusion, 'REST API Design Rulebook' is a good starting point to understand how a REST API is composed, to acquire the proper vocabulary and to apply a more planned API design process. As a side effect, this rulebook helps to evaluate the RESTfulness of an existing API or developer framework.

Note: This review is in exchange for the O'Reilly Bloggers Review Program (http://oreilly.com/bloggers).

I review for the O'Reilly Blogger Review Program

Wednesday, May 16, 2012

Node: Up and Running – Review




Node: Up and Running

Node: Up and Running is a book for JavaScript programmers who want to get started with the foundations of Node.js as a nonblocking runtime environment and web server, covering essential features, popular third-party APIs and programming suggestions for building web applications and services, this time using JavaScript as the programming language on the server side. Node: Up and Running is for the reader the starting point to understand the main components like servers, events, callbacks and modules from which a Node.js application is made of.

This is a short, concise book that explains how Node.js gives solution to support thousands of asynchronous requests through its event-loop mechanism and core functionality. In chapters 1 to 5, we can find the structure of a basic, raw HTTP Node.js server, what request callbacks mean, and how to organize these callbacks to obtain clarity and consistence. We can also find basic utility functionality dealing with IP addresses, clusters and child processes, and how to encrypt public and private application keys.

In chapters 6 and 7, this book explains briefly the most popular third party Node.js modules from which we can actually use for building useful web applications and services. We can briefly learn how to setup database connections, operations and queries, ho to build a basic, managed HTTP server with the Expressjs module for web page rendering; and how to work with WebSockets, the new feature found in recent version of web browsers for persistent connection with the server. Final chapter 8 explains to how to publish our own Node.js modules to share with the community.

What I liked most of Node: Up and Running is that it offers suggestions to avoid pitfalls when dealing with callback chaining, why a ‘try…catch’ block doesn’t catch an asynchronous exception and how to distribute the work load on several CPUs when possible (chapter 3). Programming good callback chaining and monitoring mechanisms is important to improve readability and maintainability, and to avoid possible hang-out conditions due that certain I/O events may take long time to be processed, like downloading a file and querying a database.

I think the benefit after reading Node: Up and Running is that the reader gets an initial understanding of how a Node.js HTTP server works and how to combine core with third-party functionality. That is, this book gives the reader an overview of how the Node.js world is structured and its possibilities becoming JavaScript available on both server and client sides. Yahoo! said this fact is a potential transformation in software architecture.

However, if the reader really wants to build a web server he/she should look for more information about Node.js frameworks like Expressjs, Restify and Mojito since this book only introduces the basics. But, Node: Up and Running opens the doors to understand how a Node.js HTTP server works so the readier will be able to understand the vocabulary, the mechanics and the good practices offered by each module and framework.

A negative point to this book is the absence of how to structure the different layers of a Node.js application like the business, data access and security layers. The book doesn’t show how to break functionality into several JavaScript files. I think a final chapter 'Putting it all together' would have been useful.

Finally, I want to say that there’s a difficulty to imitate some code examples because the directory structure was not specified. You’ll notice this when reading the Twitter App on chapter 2. That may change if O’Reilly Media publish the accompanying source code or a book update. Meanwhile, you can read the errata section at the publishers web site.

Note: This review is in exchange for the O'Reilly Bloggers Review Program (http://oreilly.com/bloggers).

I review for the O'Reilly Blogger Review Program

My Review of Node: Up and Running

Originally submitted at O'Reilly

This book introduces you to Node, the new web development framework written in JavaScript. You'll learn hands-on how Node makes life easier for experienced JavaScript developers: not only can you work on the front end and back end in the same language, you'll also have more flexibility i...


By from on 5/16/2012


out of 5

Thursday, May 3, 2012

My Review of Introduction to Tornado

Originally submitted at O'Reilly
Introduction to Tornado
Modern Web Applications with Python

Overcome your Fear to Try Tornado
By Eder Andrés Ávila Niño from Paipa, Colombia on 5/3/2012


4out of 5
Pros: Concise, Easy to understand, Helpful examples
Best Uses: Student, Novice
Describe Yourself: Developer
Introduction to Tornado is a rapid book for starting to get in touch with Tornado, an open source framework led by Facebook, Inc., for developing asynchronous web services in Python, covering topics like request handlers, forms, templates, MongoDB, initial authentication, OAuth, and Nginx.

With Introduction to Tornado you can learn and practice the fundamentals of the capabilities given by the Tornado framework to build web services that support hundreds of asynchronous requests, user authentication via cookies and OAuth, MongoDB document storage and retrieval, and deployment in an Nginx server environment. That is, some of the top leading technologies today to provide to end consumers fast, scalable, secure web applications that follow the RESTful architecture.

Without doubt, this book will help you overcome your fear to try this Python framework for starting to develop web applications, web services and web APIs that want to benefit of thousands of asynchronous accesses. And maybe, Tornado could be the technology you're looking for begin your startup business offering to your customers the same service quality provided by services like Twitter and Facebook.

The reader should be warned about his/her expectations, however. As I said, this book is helpful for overcoming the fear to try the Tornado web server, but not to master it. In fact, as you can see Introduction to Tornado is a short book of 136 pages divided in 8 chapters that cover the foundation of each Tornado's feature ranging from small web services and ending with the final deployment. So, after reading this book you won't be a Tornado's master chief, but a Tornado's recruit, I mean enthusiast. Besides, you need to read more about RESTful architecture, user authentication, and Nginx developing by your own.

But, I recommend Introduction to Tornado because each Tornado's feature is explained through a short, comprehensive application accompanied by a clear discussion which motivates the reader chapter by chapter and after finishing the book to continue exploring the different development possibilities by using Tornado as an asynchronous web server.

Personally, I'm delighted with this book because it has explains a little more the rationale about some features like classes, callbacks and settings that other tutorials I found on-line. I hope in the future we can get more complements to the book's contents and more extras from the authors.

Note: This review is in exchange for the O'Reilly Bloggers Review Program (http://oreilly.com/bloggers).