Microservices Architecture : Best Practices

The other day I came across this article: “Microservices Architecture: All the Best Practices You Need to Know“.  There’s been a lot said and written about the microservices architectures around the web.  But I like this article in particular, because it paints a more realistic picture, in my opinion.  Big parts of it are covering the “why?” part of the whole conversation, and it presents a balanced view of pros and cons, as well as several approaches to solving the problems.

This is very refreshing after tonnes of “Microservices are amazing, and are the best thing since sliced bread” and “Microservices is nothing but hype and bubble” coverage out there.

Social networks and referrer URLs

Pretty much every social network out there is building a custom front page for each user.  Such front pages are customized with preferences and previous activity of the user.  This is an excellent functionality.  But one thing such approach often breaks is a referral URL.  Have a look at something I saw in my statistics today morning (click for larger version).

This tells me that someone somewhere on Facebook linked to one of my posts.  I know which post was linked to.  But I have no way to figure out where exactly on Facebook the link is.  I’d like to do so very much – I’m interested to see the discussion and context in which my post came up.  I’ve tried Googling for the post, but that didn’t help.  I examined logs of my web server and that didn’t help either.  I think that’s broken.

And just to be clear, this problem is not specific to Facebook.  I’ve had similar issues with Twitter and other social networks.  Some of them make the discovery job easier than others.  But all of them don’t make the source obvious.  And I think they should.

Shorter URL? Longer URL? Funny URL?

This Slashdot discussion got me started.  The discussion is about URL shortening services and their impact on the Web.  Needless to say, most people who care about the Web, hate all kinds of third-party URL manipulations with a passion.   The reasons are numerous, and here are two that annoy me the most:

  • Obscurity.  You have no idea where you are going anymore.  It can be the newest scam website, an image, a huge video, or anything else for that matter.  When you see full URL, even if you don’t always can understand the full path, at least the domain name is a hint.
  • Latency. Most (all?) URL shortening services work via a redirect.  So whenever you click on the URL to visit a page, instead of going to the page directly you are going to the web service which expands that URL first, and then redirects you further.  This takes time and gives you nothing in return.

A lot of Slashdot people feel similar.  Yet it still makes for an interesting discussion.  Here are the bits that I picked up:

  • HugeUrl.com – web service that does the opposite of what URL shortening services do.  It takes any URL and makes it huge.  Just for the fun of it.
  • ShadyUrl.com – web service that obscures given URLs, making them look very suspicious. Also, for the fun of it.
  • There are a number of browser plugins that automate the expansion of short URLs, either on-demand or as you go.  Here is one for Firefox.  Here is one for Google Chrome.
  • Last year’s Coding Horror blog post discussing the problems of URL shortening services.

Also after a brief discussion and fooling around with my colleagues, I learned about Abcd-Whatever, which is a web service that lives on an extremely long domain name and offers free email addresses.  Such email addresses are hard for people to type correctly, impossible for some SPAM bots to grab, and excellent for testing web forms.

On complexity

Sometimes I find wisdom in the most unexpected places.  Not that Matt’s blog is such a place, but I wasn’t expecting to find anything that enlightening in the comments to such a simplistic blog post – about centered backgrounds for Twitter.  The quote that I think more people should know is:

it’s hard to anticipate the complexity of something you didn’t write

Here is a beautiful screenshot for too.

A few times I found myself in the situation that I couldn’t even explain the complexity of a change that seemed so simple from the outside.  And for some time now, when I hear the question “Why can’t they just do it? It’s so simple”, I have the answer ready – “They probably have more than one good reason for not doing it”.

TinyURL coincidence

Yesterday I read the Slashdot post discussing the power of TinyUrl web service to affect accessibility of web resources.  Most of today, the TinyURL web service is down. (Switching to conspiracy voice):  Coincidence?  I think not!