I've seen various interesting presentations recently about the joys of Micro Services (http://martinfowler.com/articles/microservices.html) and also wonder how we might use those concepts with Hapi.JS.
The CTO of Mail Online (largest online newspaper on the planet) name checks HAPI and its plugin system in relation to micro-services :
http://www.nearform.com/nodecrunch/how-node-js-has-revolutionized-the-mailonline
A micro-services architecture is used, which was inspired by Fred George, which is a slightly different take on the hapi plugin architecture, structuring applications to be maintainable as they get bigger is a key challenge going forward and micro-services is a solution to this. The MailOnline are also heavy users of Joyent (On Premise SDC and public cloud).
There are also new node frameworks set up specifically for micro-services (senecajs.org)
Has anyone seen any case studies (and ideally tutorials) on leveraging Hapi in this way?
Hapi. js (derived from Http-API) is an open-source Node. js framework used to build powerful and scalable web applications. Hapi is commonly used to build Application Programming Interface servers, HTTP-proxy applications, and websites. Hapi.
Express is less opinionated than Hapi, making it more abstract. While both frameworks can be extensible and adaptable, they can provide the same functionalities through different architectures.
js being event-based is a very good fit for microservices. With things like streams and real-time capabilities, choosing Node. js for your next microservice should be a no brainer.
The event-driven architecture of Node. js makes it a perfect choice for microservices, being fast, highly scalable, and easy to maintain.
Sure, you can use HapiJS, any other web framework, or even just plain old node libraries.
Microservices are just about structuring an application (or applications) in smaller bits, rather than a monolithic app. They are not a silver bullet or anything complicated, in fact they are generally quite simple.
HapiJS's role would be to expose data over HTTP, which should be fine unless you are building an extremely performance sensitive app.
Of course, one thing that microservices enables is the use of different technologies. You could try out different web frameworks for each service and see which you prefer - they are all capable of doing the same things.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With