A simple comparison of a "monolithic" chat app vs a "microlithic" one
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Monolith and "Microlith"

Here are two examples of an extremely basic chat application one being a "monolith" that doesn't scale horizontally and one taking a page from some microservices inspired architecture. (The second one isn't truly, authentically, organically, artisinal microservices but it gets the point across).

Check out my blog page for this example for more information.


To run:

cd monolithic
npm install
npm start

This'll kick off a server listening on port 3000. Because this implementation stores all long polling client requests in memory, this WILL NOT work when scaled horizontally (which is the point of this demo).

To push to Bluemix:

  1. Create a Bluemix account
  2. Provision and run a Node.js runtime
  3. In your terminal log in (cf login)
  4. In your terminal push this code from the monolithic directory cf push <name of app>


This app uses the MQ Light service as a message bus between different clients. While this isn't a "true" microservice architecture (perhaps for that there should be a separate service maintaining client requests, etc), it is certainly "microservice inspired."

The idea is to have a nice compare/contrast for cloud deployment vs non-cloud ready chat applications.

To run locally:

  1. Provision a Node.js runtime
  2. Create and bind an instance of the "MQ Light" service to it
  3. Copy the environment variables from your runtime into a VCAP_SERVICES.json file that is a sibling of app.js
  4. cd microservices
  5. npm install
  6. npm start

Note that this only works with your node engine at most 4.x.x (as required by the mq light library).

To push to bluemix:

  1. follow the steps above
  2. cf push <name of app>