Writing Microservices in Flask Using Python

After years of building applications and platforms using the Service Oriented Architecture, I became very interested in microservices last year. So much so that I chose the job offer based on the sole fact that it was providing me an opportunity to design and develop microservices-based platform on the AWS. I’ll share the pros and cons of microservices in a later post. This post is about writing microservices in Python using a micro framework called Flask.

Read More...

Should the US Allow Foreign Developers?

Hiring good developers is really difficult. It’s even more difficult when the market is red hot. The Bay Area is ripe with opportunities for job-seekers and good developers are almost impossible to come by. Today it’s easier than ever for developers to choose the job they really like, at least in the US. While it’s great for the developers, companies and especially start-ups are hurting because there just aren’t enough talented developers to go around. Start-ups and technology companies want the US government to relax its immigration policies so they can bring more developers from other countries. The Anti-immigration groups are against letting “foreigners” in. They argue that the focus should be on training more Americans to learn programming. While they are certainly not wrong about training more people to learn programming, Paul Graham argues that the technology companies are right and the training cannot match the resources elsewhere in the world:

Read More...

Interactive Emails with Email Markup

It was a pleasant surprise when itinerary for my upcoming flight automatically showed up on my Galaxy S6. I didn’t have open my Gmail and search for the confirmation email. It was right there, just when I needed it to check the departure time.

google-flight-trip (disclaimer: not my itinerary)

Read More...

Unit, Integration and End-To-End Tests - Finding the Right Balance

This is something I have regrettably noticed in many backend projects that I have worked on. Developers write “unit tests” that in reality are ‘end-to-end’ tests. They test the entire flow of the application from start to the end. There is no isolation of units and the notion of the unit is the whole system, along with all of its external dependencies like databases, queues, caches, and other services. For a web server project, these tests start the server, initialize a HTTP client, make a HTTP request and check the response to make sure it has all the expected information. If so, the test is declared a success. By treating the whole system as a unit and not testing independent units in isolation and their interplay, we loose many benefits that unit and integration tests offer.

Read More...

REST Design - Choosing the Right HTTP Method

One of the challenges when designing a REST API is choosing the right HTTP method (GET, PUT, POST etc.) that corresponds with the operation being performed. Some people incorrectly assume that they can freely choose any method as long as the client and the server agree on it. This is wrong because a request passes through many intermediaries and middleware applications which perform optimizations based on the HTTP method type. These optimizations depend on two key characteristics of HTTP methods: idempotency and safety, which are defined in the HTTP specification.

Read More...