DC Planner Web Version

I had built an Excel Solver Add-in based DC Planner long time ago. It was fine but limited to the capabilities of excel…. Recently while exploring ML I discovered a Javascript based Constraint solver (https://github.com/Wizcorp/constrained) and thought I could use it to build a online version of the DC Planner. So today using a bit on VueJS I built one and hosted on Heroku… check it out at https://dctopup.herokuapp.com/

It’s simple to use

Just Plug in your numbers for the racks and the server types and click evaluate button…and the output table populates with the result if the solution is possible

Got more racks and server types… Just add them and then click evaluate…

If the solution is not possible then you would get a solution not feasible error message….

Being the first version and made in a day, it is bound to have some bugs… Do Please report the bugs by raising an issue in https://github.com/julianfrank/dcplanner

If you like it Please do Star this project in github…

Thanks & Enjoy!

How could applications look like in the future? #2

This is in continuation to my previous blog with the same topic… https://julianfrank.wordpress.com/2018/01/21/how-could-future-apps-look-like/ … So why again??

One of my pet project was going complicated beyond control to the extent that I hardly remember why I wrote the code in a particular way :sigh: … Hence I’ve been looking for converting my tiny yet complicated monolithic application into a micro service application! Looked around and found istio a few months back and love the level of policed flexibility it provides. This is great for enterprise environments with relatively large teams handling the whole new stack… Sadly for my project that was way too much overhead and complexity for a relatively few features that I was trying to build…

Then I discovered moleculer. This is a nice framework that has all the fundamental features of micro-service ecosystem ticked and yet relatively small and less complicated for my weekend project needs…You can read about its features at a glance at http://moleculer.services/docs/0.13/ … I moved some services -> got into trouble -> cried out for help -> got support from @icebobcsi and others in its gitter.im/moleculerjs/moleculer channel -> now my app is back on track…. Very impressed!

To add to the benefits, the capability to merge and separate services across nodes means that I can code in a system with all services in one node… When deploying to production, I can split the services into separate nodes and make then run in separate container or vm instances… The Framework cares nothing about where you host except that they are able to reach each other over the network. To make things simple you can start with service discovery over TCP Broadcast! Of course for large scale deployment, other mechanisms like NATS, MQTT, Redis etc would be a better fit. My only quip was that this is locked to NodeJS. I Hope that in future, other cloud friendly languages like Golang is also supported…

Back to the topic… My idea of apps being Universally Discover-able is already a possibility Now!

What is left is the service (which I referred to as app in my previous blog) to be self-aware and adapt to work conditions as per needed….

Just imagine a situation where we got five services as part of our application: A, B, C, D, E

Now imagine a situation that the app is bombarded with two users with one user targeting A while the second user using a mix of services

A self-Aware application would in this situation split itself into multiple nodes, letting the first node focus on user 2 while creating copies to handle the high demand from user 1…

When the load is removed, the services move back to a minimal node instance back to original size….

Currently this is facilitated by K8S with careful engineering from IT. But in future I believe, the framework would take care of deciding how the service behaves and the process of mitosis by itself… Am I just day-dreaming?? I don’t know !!

console.log for golang

If you are like me coming from a Nodejs background, then there is a possibility that the whole logging using fmt.Printf and log.Printf and fmt.Errorf  in golang may prove counter intuitive…So I made up the Nodejs/JS console.log like package that works on similar lines. You can get it by importing “github.com/julianfrank/console”

import (

"github.com/julianfrank/console"

)

then you can use it just like in javascript

console.Log("Life is cool but Chennai is hot")
var city:="Chennai"

var feel:="Hot"

console.Log("%s is %s !",city,feel) //Outputs Chennai is Hot !

For Errors it gets even better as it returns the string formatted as per your pattern and returns an error object

err:=myerroneousFunction()

errorObjectIWantToPassToLogger:=console.Error("Got this error in my function %s",err.Error()

If logging to console needs to be restricted then just trn the LogMode and ErrorMode on and off

console.ErrorMode=true//Turn on Logging to console on call

console.LogMode=false//Stops Logging to console

Hope this makes life simpler! Enjoy!!