Thursday, September 15, 2016

What a micro-service isn't - part 1

A micro-service is usually a web service . All web services aren't micro-services. To get promoted, you need to do a lot more.
Once you add caching, load balancing, failover, integrate logging aggregation and follow it with metrics and dashboards and alerts, then publish documentation on the intranet portal, you're probably good to go.
Your teensy-weensy web service is now a grown-up ,card-carrying member of society of services that make up your organization.
The current poison of choice is REST, mostly because it's simple - never underestimate simple - and open source - never underestimate availability of developers/coders  as  factor in setting the culture of a field.

Let's take each one by one.


  • Caching
There are multiple types of this. Usual suspects are Varnish on the outside and one of Ehcache, Memcached, Redis, Hazelcast etc  on the inside for application cache. Teracotta has gained an advantage by going one step further and providing easy-to-configure Hibernate level 2 caching so that Java developers need to only wag their fingers very little to get it going.
  • Load balancing & Failover
I'm ashamed to admit that I don't know what software provides load balancing. I assume nginx does, but I don't know. Some people roll their own.
Failover is easy - you make exactly one more copy of your web -service. Or better still,  install the same thing on another app server, preferrably on another hardware server, preferrably one more in another colo.
You'll also need a reverse proxy somewhere in the mix.
  • Logging aggregation & metrics
Hadoop for the win !!! we can now aggregate ALL your logs for 15 days for $$$$ and give you a unified browser based search interface.
No more SSHing into remote servers in the midlde of the night and doing a tail -f .
You just have to remember the proprietory (TM) query syntax and hope you don't need to use a regex to extract some field from your log statements to figure out what's going on when paged.
Search for "SPLUNK" on the interwebs.

  • Metrics and dashboards and alerts
See above.  Also this. Nagios and ChekMK are like plumbers. Grungy, dirty but cannot be done without. They provide metrics and graphs . So does New Relic. All of them run agents on your hardware.
  • Documentation
Swagger. That's all I'm going to say about this.

And once you relax, knowing that you're good to go, remember you aren't.
There's Security to worry about. OpenID or OAuth . And tokens. And user directories.
And domain names and  SSL certificates. And a mail server / service.
And your org ALSO needs 
  • CI (Continuous Integration)
Usually Jenkins integrated with your Github which runs your JUnits and then deploys.
Usually. 
It could also be Jenkins integrated with your SVN which runs your TestNGs.
Or  Microsoft Team Foundation Server and deploy by hand. 
More often than not, CI is only C till the compilation part. 
Chickening out before the deploy, or keeping the 'deploy' part for a dramatic hi-priority conference call/remote login session  at midnight is pretty common.
  • Automated Deploy !
There's Chef, Puppet, Capistrano. shell scripts.  A $$$$$ licensed version of IBM Urban Deploy (which just runs your shell scripts).
  • A/B testing & Experiments
Ideas come from statistics. Finch .
  • Analytics 
See next.
  • Hadoop for the Marketing team
We don't know what they do with this, but apparently we can use computers to keep the room warm against the terribly powerful air-conditioning by counting words in files three times each.
 And Informatica licenses. Also SAS licenses . And maybe a Revo R license because SAS doesn't do arrays or some such.
Squiggly colored lines on a white checked background are the key to unlocking budgets.

Care and Feeding of your Developers -
 what you need 
  • reddit and imgur for distractions and knowledge, hacker-news if you have hired Intellectuals 
  • youtube for music while working
  • an O'reilly Safari account  
  • coffee machine & free snacks
  • IntelliJ helps
  • one Hipster rails developer to show others what cool looks like

Observant reader that you are you will now notice that the heading is about what a micro-service isn't, and the blog post is all about what it is .  
It is in such paradox that sanity thrives and flourishes in this beloved industry of ours, and lets us use terms like agile-waterfall with a straight face, where sprints scheduled one after the other technically constitute a marathon which , as life coaches advice us  - should not be sprinted.

Let me leave you with something more solid than pop-philosophical ramblings.

A micro-service is not a UI. So budget for that too.

Labels:

0 Comments:

Post a Comment

<< Home