Search This Blog

July 31, 2020

Microservices Architecture Versus SOA


This is my take on differences between Microservices Architecture (MSA) and Services Oriented Architecture (SOA) based on my experience of working with these architectural styles thus far. I do understand that there are companies that doesn't distinguish between these two architecture lingos and use them interchangeable. And then there are also companies that have their own definitions of how each of these architectural styles are modeled. There is no right or wrong definition here (Ouch!, the world became chaotic even before we realized). What truly matters is that knowing our audience as we speak to them. It is unwarranted chaos when our mental models are different.

So, at the very outset let me state clearly that I see these models differently by virtue of my experience. So this post is my perspective on the difference between these two architectural patterns as I had experienced it. 


  • SOA is monolithic solution like a big lion in the jungle; how it works would be pretty evident for a pair of eyes.
    MSA is distributed system constituting a set of services working together as one, like a pack of wild dogs working together to attack its target; how it works together would seem like a magic for a pair of eyes.

  • SOA is layered. The app is broken into independent functional modules owned by respective teams. In the Java EE world, each team owning the module builds and publishes its artifacts as libraries for consumption by the core app. The application thus remains monolithic, so any changes to a module meant building and deploying the entire application. This also means that the release of functional modules needs to be coordinated with that of the main application. At least that is how the teams I had been in had build the big monolithic enterprise application, the SOA way.
    MSA is about breaking the large monolithic app into independently deploy-able application where the teams owning it can have its own release cadence; although the larger release of the application still requires some bit of coordinated efforts.

  • SOA standardizes on shared release cadence requiring larger project planning to keep teams occupied and syncing efforts across teams.
    MSA liberates teams to have its own release cadence to meet the needs of the larger release cycle of the application.

  • SOA is externally focussed. It was intended to solving communication gaps with 3rd-party heterogeneous systems in a safe, secure and vendor neutral way. More often than not, the communication was outside of the trusted networks.
    MSA is internally focussed. It lays emphasis on building small and independently deployable applications that work together, for faster development and deployment of business needs. The inter-app communication challenge was a consequence of this decision. Typically, the coordinating apps are within the trusted network of the company.

  • Refactoring across bounded context is relatively simpler with SOA.
    Refactoring across bounded context is harder with MSA. This is one of the key reasons I don't recommend Microservices First Architecture, but yeah, you can always hit a middle ground that is there somewhere. 

  • SOA embraced SOAP as the de-facto communication protocol and later went on to support REST protocol too.
    MSA embraced REST as the de-facto communication protocol, but is pretty open to embracing other newer protocols for good. Inherently though, there is a dislike for SOAP/XML within the MSA community :)

  • SOA solved the integration challenges for businesses primarily in the B2B space.
    MSA solved the delivery challenges for businesses that wanted to be nimble with faster release cycles; historically, to respond to its B2C customers. 

July 29, 2020

Switch Between Java Versions In Windows 10


There are 2 Options to manage multiple java versions in your windows: 
  • jEnv : I have used this for long in my Ubuntu/Mac laptops. This doesn't support Windows platform though!
  • SDKMan : This one has a workaround for Windows 10 platform (see https://sdkman.io/install) and that leaves me no choice but try this one out.

The SDKMan Way To Switch Between Java Versions in Windows 10


Some good things about SDKMan:
  • It supports all platforms Linux/Mac/Windows.
  • It is more popular tool over jEnv today, per libhunt.
  • It supports great deal of JDKs and SDKs for quick install and use.

Installing SDKMan in Windows has the following pre-requisites:
  1. Install ConEmu which is  an advanced console window (also known as local terminal emulator). This is only an emulator and hence shares the same environment as Windows. Alternatively, you can install CygWin, which is a more popular and pioneer tool in this Linux Terminal on Windows.
  2. If you have installed Git in Windows it is likely that you have installed Git Bash. If not, please do install Git Bash (that comes bundled with Git installer for windows) with all the default recommended options as the installer suggests.
  3. The SDKMan makes use of zip command for its installation. So you may need to install GnuWin Zip
  4. It may also use the following commands in its installation script, viz., zip, unzip, tar, gzip, curl. According to the SDKMan installation page, MinGW can be used to provide this tooling. But because, I use ConEmu out of personal preference, I had to check for the validity of the following commands in my ConEmu terminal like below:

When all the above commands showed the installation path of the softwares, we can be confident that the commands would work well to install SDKMan from within ConEmu.

Now from within ConEmu terminal, we can go ahead and run installation script for SDKMan like below:
    $ curl -s "https://get.sdkman.io" | bash

Next, open a new terminal or enter:
    $ source "$HOME/.sdkman/bin/sdkman-init.sh"

Lastly, run the following code snippet to ensure that installation succeeded:
$ sdk version

Bingo, you can now go ahead and install your favourite versions of java sdk, Ant, Maven, Groovy, Gradle, etc using your now favorite SDKMan :)

Quick Cheatsheet for SDKMan



References

July 27, 2020

Persisting Higher Resolution In Ubuntu For External Monitor

My Context

Monitor: 32 inches display LG FHD Monitor 
OS: Ubuntu 20.04 

Problem Statement

Even though the display resolution of my external monitor supports 1920x1080, it is not shown. I want to see this resolution as default when my Ubuntu OS is loaded and I login in.

Solution Recipe


Note: We will use xrandr for this, which is a CLI to RandR (Resize and Rotate) X Window System extension.
 
First thing first, you got to know how your external monitor is recognized by your ubuntu. For this run the following command in your terminal:
xrandr --listactivemonitors
The output will have one of VGA-1 or DP-1 or HDMI-1. In my case it is DP-1. Depending on the value you get in your terminal, you may have to change the below script accordingly.

Type cvt 1920 1080 (to get the --newmode args for the next step).

Type sudo xrandr --newmode "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync , where 1920x1080 is the resolution and 60.00 is the screen refresh rate.

Type sudo xrandr --addmode DP-1 "1920x1080_60.00" .

Now close the terminal and go to Settings > Display settings and change it to 1920x1080. Enjoy your FHD until you reboot.

To persist these display resolutions, create a script called external_monitor_resolution.sh in the directory /etc/profile.d/. using sudo vim /etc/profile.d/external_monitor_resol.sh. and let the contents of the file have the above commands like below without sudo:
xrandr --newmode "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
xrandr --addmode DP-1 "1920x1080_60.00"

Bonus

To temporarily try to see if your desired settings fit your purpose you can test it out temporarily like below:
xrandr -q to know your current display resolution
xrandr -s 1920x1080 to set change resolution temporarily until reboot
xrandr -r 60 to set refrest-rate temporarily until reboot
xrandr -s 1920x1080 -r 60 to set both screen resolution and refresh rate temporarily until reboot
sudo lshw -c video to check for the currently used graphic driver. Alternatively, you may also install mesa-utils and run glxinfo -B.

July 25, 2020

Can you talk about your most challenging technical problem?


This is a question that is invariably asked in technical interviews. You are perhaps smart enough to answer this question following some template answer by googling for it. This blog post is not intended to help you in that endeavor.

The purpose of this post is to seek genuine answers for that pertinent question. This post is my (strongly) opinionated view of things in the realm of software development on what constitutes a challenge in technical problem. Should you see it this way or otherwise, I would love to see your perspective.

Spoiler Alert : If you have worked with me, this post is likely redundant for you, for we might have discussed and debated about it at length.

My Perspective


More often than not the challenge of cracking technical problems is not just with the technical problem alone in silo. It is compounded by the context that surrounds it making the technical problem what it is -- truly challenging. Don't trust me on this? Take any technical framework from your very favorite programming language and see what problems it proposes to address as solution. 

Invariably it will speak about improving your business value. As technical as it may sound, it is still the  business value delivery that counts in titling your decision making. 

I give you an example or two to begin with leaving the rest as exercise for your thoughtful weekend.

Take AWS Cloud as our first example, they say, "AWS offers reliable, scalable, and inexpensive cloud computing services." where each of "reliable", "scalable" and "inexpensive" is a business challenge manifesting itself as technical problem. AWS introduced cloud to the world and are leading the cloud race. Now here is your question -- if you were tasked to build such cloud platform as a CTO, do you think your challenge is same as that of the tech-team that built AWS Cloud? If your answer is YES, you can't be more wrong.

As second example, go to ,Ruby On Rails website to see how DHH sells the framework -- "Imagine what you could build if you learned Ruby on Rails…". RoR truly is a big framework today and has its pros & cons. And here is your question -- if you were tasked to build a competing framework that is at least as good as RoR, do you think your technical challenge is same as that of RoR team? Would you take the business context into account in weighing your challenge?

In my decade and half or so years of experience, the one thing that I have come to witness is the tech teams treating technical problems in isolation. Guess the consequence? Rift between engineering and product managements. Are we not seeing frequently enough of how the product management "dismisses" engineering teams concerns? Don't we see engineering teams "challenging" product management for their decisions?


In reality though, there are more such technical problems but without a name. Being a first mover has its own set of challenges and advantages. Becoming a competitor by building a competing product has its own set of challenges and advantages. 

Same technical problem present in different contexts (be it business, team, technology, etc) could weight itself as a different challenge with respect to how it is to be tamed. 

This can be well understood by looking inwards into out product development challenges in our teams. We all love stories of others failures, right? So here goes two stories of failures from my experience leaving you with questions to think about the situation, and then possibly connect it with your experience to find answers to those set of questions.

1. Buggy Feature As Show Stopper


I was once in a web development project where our Business Analysts agreed to implement a jazzy feature-rich browser-based text-editor  to incorporate rich-text fields in the forms.  The development team in all their enthusiasm agreed to it at the beginning of the project. The front-end engineer saw it as one time opportunity to build a online rich-text editor that is compatible to all agreed browsers. Days before the first release of the product, the customer hits back at the development team that the rich-text editor is buggy in select set of browsers and that they can't go live this way.

Quiz Time : As an engineering leader, what do you think has gone wrong and why? How would you have averted this kind of situation? When faced with a situation like this how would you go about resolving this issue?

2. Dream Tech And Dreadful Timelines


In one of the product development endeavor for a startup that I had the privilege of leading the team, here is what happened. We acquired the project mid-way through the product development done by another team.  Our management decided to redo the project again with latest front-end tech and proper Agile engineering practices adopted.  For the curious, the reason for re-write was that the old code-base wasn't clean and without test coverage. It chose to adopt ReactJS when it was first announced its 0.01 candidature as open-source and it was raging hot topic in the tech world, because it was from Facebook. ReactJS took a paradigm shift in front-end development from the world of jQuery like libraries. 

And by the way, the management also decided to re-look at other components involved and decided to replace an expensive commercial VOIP solution with a cheaper one that fits business feasibility. The seed team was just 2 developers (including me) and we were supposed to grow the team to 5 quickly in a month's time assuming we could find right talent in a months time. The project started and the team went about hiring for candidates with penchant for front-end development using ReactJS and the efforts went in vain.  We decided to change tact and also hunt for great back-end engineers that could code in Ruby on Rails and could manage to add just one more to the team. We then were quick to hire a few freshers in the hope of training them on the job. We missed the first milestone and then the next. Damn, the time was ticking mercilessly without an iota of sympathy for the situation that the new development team is in. Our client's patience was at its tail's end... 

Quiz Time : As an engineering leader, how do you see this situation? What do you think could have gone wrong? What do you think I or us in leadership team could have done differently to have averted this situation?


Conclusion


Always remember, it is the business the drives technology and not the other way around. So, if you were to talk about your technology solution without the business context, you haven't learned your lessons yet!

July 15, 2020

10 Tips To Fail AWS Cloud Migration


In my working on cloud migrations of varied scale with several organizations from startups to large enterprises, there has been some repetitiveness in the gotchas that I witnessed. This blog post is a satirical recollection of these to help you in your endeavors of cloud migration in general, and AWS Cloud in particular. Why AWS cloud specifically? See later section that answers this.
  1. Compare the cost of on-premise servers with AWS on-demand servers and blame AWS to be expensive 
  2. Use wrong EC2 instance types for your application servers and/or database servers only to call out AWS to be non-performant
  3. Design your VPC poorly and crib at AWS for being unnecessarily too complex
  4. Poorly configure your Security Groups and yell at AWS for being so insecure
  5. Swear by your out-dated knowledge of AWS to shout out on the limitations of AWS
  6. Not knowing where you are (knowledge of your existing systems and its operational needs)
  7. By not accounting for AWS services that you can and should leverage, you can always lay your claim on existing systems to be too complex for cloud migration
  8. By including workloads to reduce your architectural tech-debts as part of cloud-migration to AWS, you can comfortably paint a scary picture to your management
  9. Try offshoring the migration work to 3rd-party consulting vendor blindly
  10. Not trusting a 3rd-party consulting vendor and so bringing in an other one into the cloud migration game play

July 3, 2020

Should I buy refurbished laptop from Amazon?

This post is based on my experience with amazon.in and guess it to be true on all other platforms as well. At least you can check out and verify for these pointers before you make that decision to buy renewed/refurbished laptop on Amazon with your hard earned money.

I see this question propping up in several forums and on many different occasions. In the recent past, I had my 5 year old dell laptop that gave up because its motherboard failed. One of the options that I had in my mind was to re-use the HDD and the 16GB DDR4 RAM of that old laptop in the one that I purchase next as secondary. 

I had come to a conclusion that it is not worth buying a refurbished/renewed laptop at all. Why? For the following reasons, most of which I see as BIG #RedFlags:
  • You got to remember that Amazon provides a platform for 3rd party sellers to sell their products as well. So in your search for refurbished laptops you wouldn’t want to choose some random 3rd party seller who Amazon doesn’t endorse. You could only rely on Appario in India, which is Amazon’s subsidiary for selling these kind of renewed laptops. Typically they seem to be selling the products higher than that of other sellers; call it enjoying Amazon’s brand value.
  • amazon.in would state that the product comes with minimum 6 months seller warranty but what precisely is this period they wouldn’t publish. Even Amazon’s own subsidiary Appario in India, that sells renewed/refurbished laptops wouldn’t answer straight to this question but will parrot this generic answer. This is my first hand experience on this platform.

  • The price difference between new and this one in most occasions aren’t worth it, because in case of new laptops you can buy extended warranty for 2/3/5 years (depending on the brand) to insure yourself from expensive maintenance/repair costs. You don’t get this option with renewed laptops, which is a clear indication of its quality and life expectancy. Think about it, when the seller themselves don't trust their product for its life expectancy, why do you want to invest your precious little money, whatever it be on it.  
So what is the way out? Gift yourself a new one! 

ProTip : Buy new by comparing prices on varied e-commerce platforms. And don't forget checking for offers from company's site as well.

That is all I have to warn you with. Hope you make wise decision with your money. Good luck!