Contrasting Enterprise Node.js Frameworks: Hapi vs. Kraken vs. Sails.js vs. Loopback

I published this essay Contrasting Enterprise Node.js Frameworks: Hapi vs. Kraken vs. Sails.js vs. Loopback on the Capital One engineering blog . Feel free to leave a comment! Here’s a blurb:

Node.js/Io.js is a non-blocking I/O platform based on the JavaScript language. It has been capturing the hearts and minds of software developers for the past couple of years. It has been doing this not only for developers in startups And small companies, but more interestingly for enterprise developers as well. For example, PayPal, LinkedIn, Walmart, Netflix, eBay, Uber and other tech giants switched from Java and the likes to Node. Its popularity is attributed to better performance and having one language (JavaScript) for all layers: back-end, database and front-end.

As with any new platform, there are a lot of Node.js/Io.js frameworks to choose from. However, before we proceed, we need to define what enterprise means. For the sake of simplicity, an enterprise project is one where you have teams of more than 10 developers working on it, where you have huge traffic to handle and high stakes, meaning the services must be running 24x7x365.

Judging frameworks is highly subjective. When it comes to building enterprise-level applications, we need to consider some of the following things:

  1. Best practices and patterns: Whether the framework is DIY or provides clear patterns to use.
  2. Configuration: How easy it is to configure the framework.
  3. Convention: Is there a convention to follow if that’s the preferred route?
  4. Horizontal scaling: How easy it is to scale apps built with this framework.
  5. Testing: How to test the application.
  6. Scaffolding: How much developers have to code manually vs. using built-in code generators.
  7. Monitoring: How to monitor the application
  8. Track record: How proven a framework is, i.e., who supports it and how well it is maintained.
  9. Integration: How rich the ecosystem of plugins/connectors is.
  10. ORM/ODM: Is there an object relational/document mapper.

While performance is important, it varies on the requirements and business logic of a particular project. Running meaningful benchmark tests is non-trivial.

The main focus of this post is to compare the four Node.js/Io.js frameworks: Hapi, Kraken, Sails.js and Loopback.


The full essay is at

Joining Capital One, a Technology Startup

Most of the people outside of Capital One think of it as a bank with those visigoths commercials and the “What’s in your wallet?” slogan. Few people know that Capital One is a startup in the financial world if you compare it other big names such as Wells Fargo, Bank of America or Chase. Capital One started only a couple decades ago as a data driven technology company. Before it, there was only one type of credit card and people with less than stellar credit just weren’t eligible for it. Capital One revolutionized the credit card industry by analyzing risks and consumer profiles. It turned out to be a big success. Then came the visigoths, along with the acquisitions of traditional brink and mortar (such as Chevy Chase) and online banks (ING DIRECT which is Capital One 360).

Continue reading

How to Use Jade and Handlebars in Express.js

How to Use Jade and Handlebars in Express.js

I hated Jade as many other Node.js developes do.  But I changed 180 after I realized that it has tons of features.

At Storify and DocuSign we used Jade for EVERYTHING. We used Jade even in the browser. There is a little trick called jade-browser. It was developed by folks at Storify. I maintained it for a bit.

The funny thing is that DocuSign team used jade-browser long before they met me. They swear they hired me without knowing that I was involved in that library. :-)

Anyway, after covering Jade and Handlebars in previous posts, it’s time to apply them to do some real work. In this post, I’ll cover:

  • Jade and Handlebars usage in Express.js 4
  • Project: adding Jade templates to Blog

Continue reading

5 Hacks to Getting the Job of Your Dreams to Live a Happier and Healthier Life

5 Hacks to Getting The Job of Your Dreams

Getting a job of your dreams might be easier than you think. Apply these five hacks and see for yourself.

Study after study has showed that being satisfied and happy at a job is paramount for a healthy, productive and long life. In other words, if you’re miserable at a job, then other areas of your life will suffer as well: personal life, health, spirituality, family, friends, etc.

Here are the 5 Hacks that will help you to get your dream job:

  1. Write a book
  2. Create a strong web presence
  3. Boost your LinkedIn profile
  4. Speak at a conference
  5. Take a MOOC (Massive open-online course)

You can use these five hacks to get the job of your dreams in pretty much any industry or field. And most of them will cost you nothing or close to nothing!

Of course, any of these hacks are useless if you don’t know what your dream job is. If you are not sure, then before reading any further, answer these questions:

  • How much money do you want to make in a year or an hour?
  • How much maximum commute can you tolerate (e.g., 30min, 1hr)?
  • Do you like a certain area of your city?
  • Do you want to work with certain technologies or in a particular industry?
  • What kind of benefits do you want to have (ideally)?

Go crazy with these questions, let your fantasies go wild… yet remain realistic, otherwise you won’t believe it’s possible.

We are not separate people when we go to work and come back from it. We cannot separate our jobs from the rest of our lives. The quality of your job and its factors are in direct proportion to your happiness and physical and mental health.

So let’s start with my favorite hack.

Continue reading

The Astonishing Power of High Performance JavaScript, Without The Headache or A Steep Learning Curve

The Astonishing Power of High Performance JavaScript, Without Headache or Steep Learning Curve

Stop struggling to code front-end the hard way. React.js is performing fast DOM manipulations and is easy to learn.

I stumbled upon some guy from Zurich, Switzerland who was arguing that you don’t need MVC (model, view, controller) with React.js.


I love controversial topics! How refreshing to hear such a brave opinion after almost a decade of MVC-domitaion.

VIDEO —>>>> The Astonishing Power of High Performance JavaScript, Without Headache or Steep Learning Curve from Azat Mardan on Vimeo.

Continue reading

Write Templates Like A Node.js Pro: Handlebars Tutorial

Write Templates Like A Node.js Pro: Handlebars Tutorial

I’ve wrote how I struggled with Jade, but I had no choice except to master it. However, before beginning to understand Jade, I admired Handlebars GREATLY. I did it mostly for its simplicity and similarity with plain HTML.

If you want to write templates for Node.js apps, then consider Handlebars. This short tutorial will get you started on the path of becoming a pro. And if you haven’t even heard about Handlebars, then you’re missing out big time!

Here’s the outline of this post:

  • Handlebars syntax
  • Handlebars standalone usage

Continue reading

To Engineers Who Tried to Use Jade Template Engine and Can’t Get Started

To Engineers Who Tried to Use Jade Template Engine and Can’t Get Started

When I started working at Storify as a Node.js Engineer. The tech stack was Express and Jade. I hate to admit it, but I struggled with Jade a lot!

Before, I mostly worked with Underscore, and Handlebars. I attempted to modify some HTML in the Jade templates. Other times I would only change the text. Those were trivial updates, but very often they cause the whole server to crash.

I was failing miserably to learn by trail and error. I hated Jade. I was starting to hate editing templates as well. Then I had a light bulb moment: I need a tutorial. I went to the official docs. I wish this article existed at that time. After spending just an hour learning Jade, I was able to use Jade and make all the changes to templates smoothly.

Smart people learn by their mistakes, and wise people learn from others. Don’t repeat my folly. Skim through this Jade tutorial to harness the power of this wonderful template language.

Continue reading

Warning: NoSQL is Becoming More Popular. Master MongoDB With This Handbook on Mongoose for $2 ONLY

Mongoose Guide


There is a Kickstarter campaign for the Mongoose Guide book.

The campaign closes in a few weeks. Only people who backed it will get the book and bonuses.

Right now, you can get tons of bonuses…

the book itself is just $2, so hurry up.

Check this out —>>> Mongoose Guide.

Software Engineers: Learn MongoDB with Mongoose and Node.js and Earn a Caribbean Vacation

Continue reading

How To Use Mocha With Node.js For Test-Driven Development to Avoid Pain and Ship Products Faster

Mocha With Node.js For Test-Driven Development

Test-driven development (TDD) , as many of you might know, is one of the main, agile development techniques. The genius of TDD lies in increased quality of code, faster development resulting from greater programmer confidence, and improved bug detection (duh!).

Historically, web apps have been hard to autotest, and developers relied heavily on manual testing. But, certain parts such as standalone services and REST API can be and should be tested thoroughly by the TDD. At the same time, rich user interface (UI) / user experience (UX) can be tested with headless browsers such as PhantomJS.

Continue reading