8 System Design Principles I learned After Doing It Wrong More than 50 Times!



At Squad, we strive to build awesome products to solve customer(internal and external) needs. As a product engineer, paramount part of your job is to design and build products. Dig deep into the root cause of the problems, design solutions and implement them as the end product.

Over the course of my journey so far, here are the 8 system and product design principles that I’ve learned from other awesome people at Squad, from feedback and simply doing it not right enough multiple times.

1. What is the underlying problem that led to the feature request?

At Squad, you don’t just code the requirements into the software. As a product engineer, it’s your responsibility to remove the layers and expose the root problem that led to the feature requirement.

Get to know the root cause of the problem that you are trying to solve. Or even better, as the lean principles say “genchi genbutsu” i.e go and see it yourself.

2. How can you make the feature more robust, reliable and usable?

Once the essential feature requirements are finalized, we must press on how can we make the feature more robust, reliable and usable?

Things to ponder upon and take into consideration can be :

  1. The persona of the users that’s going to use that.
  2.  Scenarios in which that feature would be used. Ex, if in the case of fires, than show more data than needed for faster resolutions.
  3. Building in the quality in the product itself or “Jidoka” as said in lean.

3. What is the first iteration going to be?

Given the time and resources you have., what is the best possible first iteration of the product going to be? If it’s a large system or something you are building from scratch, there are always going to be iterations.

The main idea here should be to move fast and get things shipped. Good enough and shipped on time is always better than perfect and in-development forever.

4. How easy will it be to make iterations on the current feature?

The design should incorporate all the non-functional requirements to make future iterations easy.

Scale the feature? Change a component? Use a different 3rd party service? Your implementation should be flexible enough to incorporate and encourage these enhancements.

Design patterns are your best friend here.

5. What are the potential bottlenecks with scale?

Scale-land is where everyone wants to be, but it is scary. It breaks what was not supposed to break and has witnessed more horror stories than a haunted castle.

What are the potential bottlenecks that are not a problem now, but will break at 5X, 10X or 100X scale?

List them down on the feature ticket, or better document it in the code itself.

6. What’s the data that has to be captured and how will it be consumed?

Every feature in the product will need some data that needs to be captured to track it. It can be but not limited to:

  1. Action logs.
  2. Event logs.
  3. Metrics
  4. Failures.
  5. Anamolies.

What affects this majorly is how that data will be consumed? Store it in a structure that will make the consumption of data easy and efficient. Afterall, the only motive to store data is to use it.

7. How good the developer experience will be when interacting with the code base of that feature?

There can be many developers who’ll use or modify the code that you are going to write.

How will be their experience when doing that? Ex. Will the test cases you wrote, make them feel confident enough to make changes fast?

Few points to consider:

  1. Is the code well documented?
  2. Are test cases strong enough?
  3. Is the code, re-usable where it makes sense?
  4. Are functions small and code, simple to read?

8. What metrics will determine that the feature has been implemented successfully?

Finally, after all the fun-time you had creating the feature, what will determine that the feature has been implemented successfully?

The data you tracked will be of paramount importance here.

It can be the case that to track this quantitatively is not possible, but can you track the qualitatively in that case?

The idea here is that you can’t improve what you can’t measure?

Processing 100,000 requests? Fewer errors by the users? 95% work done by the new system instead of old one?

This can and will involve more stakeholders of the team and not just the developer.


Obviously, this is not the exhaustive things to take into consideration while designing a system or a product as an engineer. This just covered what I have learned so far by just doing things wrong or not right enough multiple-times.

It’s fun to build stuff! Continuously improve (“Kaizen” in lean)! Keep iterating! Keep shipping!



That’s all, folks!



Deploying a nginx application using Kubernetes for Self-Healing and Scaling

Kubernetes is an open source system for automating deployment, scaling and management of containerized applications. A more technical term for it is, container orchestrator which is used to manage large fleets of containers.

Minikube is an all-in-one single node installation for trying out kubernetes on local machines. And the following post covers deploying a nginx application container using kubernetes in minikube.

If you don’t have, then this link has it all to install minikube and kubectl (command line tool to access minikube) : Download and install minikube and kubectl

Step 1 : Making minikube up and running

Ensure that minikube is running.


Step 2 : Open the minikube dashboard

Minikube comes with a GUI tool that opens in the web browser. Open the minikube dashboard with following command :


It should open the dashboard in a browser window and it’ll look something like this:


Looks cool! No?

Step 3 : Deploy a webserver using the nginx:alpine image

Alpine linux is preferred for containers because of its small size. We’ll be using the nginx:alpine docker image to deploy a nginx powered webserver.

Now, go the deployments section and click the create button, which will open an interface like below.


Fill in the details as shown in the image.

We can either provide the application details here, or we can upload a YAML file with our Deployment details.

As shown, we are asking kubernetes to create a deployment with nginx:alpine image as container and that we want 3 pods (or simply instances) of that.

A pod in kubernetes is a scheduling unit, a logical collection of one or more containers that are always scheduled together.

Go on and click that awesome deploy button!

Step 4 : Analyzing the deployment

Once we click the deploy button. Kubernetes will trigger the deployment. Deployment will create a ReplicaSet. A ReplicaSet is a replication controller that ensures that specified number of replicas for a pod are running at any given point of time.

Flow is something like this:

Deployment create ReplicaSets, ReplicaSets create Pods. Pods is where the real application resides.


As expected, we have our deployment, replica set and pods in place.

We can also, check our deployment via command line using kubectl.


Step 5 : Create a Service and expose it to the external world with NodePort

So far, we have our pods up and running. But how do we access them?

This is where a service comes into play. K8S provides a higher level abstraction called as a service that logically groups pods and policy to access them. This grouping is done via labels and selectors.

Then we expose the service to the world by defining its service type and service redirects our request to one of the pod and load balances them.

Create a my-nginx-webserver.yaml file with the following content:


apiVersion: v1
kind: Service
  name: my-nginx-web-service
    run: my-nginx-web-service
  type: NodePort
  - port: 80
    protocol: TCP
    app: my-nginx-webserver

Enter the following commands to create a service name my-nginx-web-service


We can now verify that our service is running :


Step 6 : Accessing the application

Our application is running inside the minikube VM. To access the application from our workstation, let’s first get the IP address of the minikube VM:


Now head to the address and port number of the service we got in above step.


And our app is running! Amazing, give yourself a pat now!

Taste of self-healing feature of the kubernetes system :

One of the most powerful feature of kubernetes is self-healing capabilities (just like Piccolo. DBZ, anyone?). While defining our app we created a replica set with 3 pods. Let’s go ahead and kill one pod and kubernetes wil create another one to maintain the running pod count 3.


As we can see in the image. We deleted the bottom-most pod and K8S created a new one instantly.

Such kubernetes! Much HA (High Availability)!

Taste of scaling with Kubernetes:

Now, our app is receiving a crazy amount of traffic and three nginx pods are not enough to handle the load. Kubernetes allows us to scale our deployments with almost zero effort.

Let’s go ahead and spin up a new pod.



Click OK. Now let’s go and check our pods.


As we can see in the image, we have now 4 pods running to handle the increased traffic.

Isn’t it amazing? We just horizontally scaled our application with the power of kubernetes.

This was just the tip of the iceberg what Kubernetes can do. I am also exploring the kubernetes and containerized architecture just like you, hopefully we’ll be back with another post soon with more kubernetes stuff!

That’s all, folks!

Estimation Peril: How To Estimate Software Projects Effectively(or How Not To Lie)


Consider, you are a rockstar engineer and you are given a task by your favorite person, your project manager, to show some new fields in the dashboard.

As usual, you are asked to estimate it as soon as possible. You think that well, seems like a quickie and you are tempted to estimate it a day. But you, being burnt before, decided to look at the fields that are to be added carefully. These fields are for analytics. You think, ok, let’s make it 2 days then. But being more cautious, you dig deeper and find that those analytics are not even being tracked on the app.

Now to complete the story, you’ll have to track the analytics, send them to the server, make the backend accept those and store them, show these on the dashboard, write tests etc….

What seemed a simple task is now a 1-2 week thing. Very hard to estimate. And your manager was expecting a response like, “would be done by end of day”.

What is the problem with estimates?

The main problem with an estimate is that the “estimate” gets translated into commitment. And when you miss a commitment, you breed distrust.

Most estimations are poor because we don’t know what they are for. They are uncertain. A problem that seemed simple to you on the whiteboard, turned out not to be so simple. There were non-functional requirements, codebase friction, some unfortunate bugs etc. We deal with uncertainty.

There is a rule in software engineering that everything takes 3X more time than you think it should, and this holds true even when you know this and take it into account!

Estimates can go the other way too, that is when you overestimate. This is as dangerous as underestimating.

What should an estimate look like?

An estimate should have 3 characteristics :

  1. Honest (Hardest)
  2. Accurate
  3. Precise

1. Honest : 

You have to be able to communicate bad news when the news is bad. And when the continuous outrage of your managers and stakeholders is on your face, you need to be able to continue and assert that the news is bad.

Honesty is important as you breed trust. You are not eliminating disappointment, rage and people getting mad, but you will eliminate distrust.

2. Accurate :

You are given a task and you estimate it to take somewhere between now to the end of the universe. That’s definitely accurate, it’ll be done within that time.

We won’t breed distrust, but we definitely will breed something else.

Which brings us to the 3rd characteristic.

3. Precise : 

An estimate should have just the right amount of precision.

What is the most honest estimation that you can make? I don’t know!

This is as honest as it can get. You really don’t know. But this estimation is neither accurate not precise.

But when we try to make precise estimates, we must note that we are assuming that everything goes right. We get the right breakfast, traffic doesn’t suck, your co-worker is having a good day, no meetings, no hidden requirements, no non-functional complexities etc.

Estimating by work break down

The most common way to estimate a complex task is to break it down into smaller tasks, into sub-tasks. And then those sub-tasks into sub-sub-tasks and so on until each task in hand is manageable and ideally not more than 4 hours of work.

Imagine this forming a tree, with executable tasks at the bottom as leaves. You just estimate the leaves and it all adds up.

This approach works, but there are 2 problems :

  1. We missed the integration cost
  2. We missed some tasks

There is a fundamental truth to work break down structure estimates:

The only way to estimate using work break down chart accurately, to know what are the exact sub-tasks, is to implement the feature!

What to expect from an estimate?

Estimates are uncertain. There is no guarantee that your estimate will work itself out. And that’s OK. It’s your manager’s job to manage that risk. We are not asking them to do something outside of their job.

The problem arises when you make a commitment. If you make a commitment, you must make it. Be ready to move heaven and earth to make it. But if you are not in a position to make a commitment, then don’t make one.

Because he’s going to set up a whole bunch of dominos based on that commitment, and if you fail to deliver, everything fails.

Some interesting links :


Uncle Bob on Estimates: https://www.youtube.com/watch?v=eisuQefYw_o

Happy Estimating!

That’s all, folks!


Mastery By Robert Greene : Reading Experience


“The problem with all students, he said, is that they inevitably stop somewhere. They hear an idea and they hold on to it until it becomes dead; they want to flatter themselves that they know the truth. But true Zen never stops, never congeals into such truths. That is why everyone must constantly be pushed to the abyss, starting over and feeling their utter worthlessness as a student. Without suffering and doubts, the mind will come to rest on clichés and stay there, until the spirit dies as well. Not even enlightenment is enough. You must continually start over and challenge yourself.”

Mastery is a book that takes a deep dive into the so-called “superpowers” of masters in various fields and connects it directly to the pillars of mastery like grit, dedication, patience, creativity and intuition.

It contains life studies of legends like Vinci, Darwin, Faraday etc to contemporary legends like Carlo Rodriguez, Santiago Calatrava, Paul Graham etc. And time, again and again, it stands upon elusive pillars like grit, creativity, patience, etc which drives one towards mastery, not just god gifted super powers.

The book condemns that people are not willing to do what it really takes to become masters in their fields and label it as something that can be only achieved by born geniuses.

It starts with covering the importance of the apprenticeship phase. The phase that constitutes the beginning of everyone’s career, even of true masters like Faraday, who did the apprenticeship  at a scientist’s lab for 7 years before going on his own to make history.

During the apprenticeship,  one should focus immensely on learning the vocabulary of the field in depth with patience. Then experiment with his/her own tastes.

Next, comes the creative active phase, where after learning the tools of the trade and becoming proficient in important skills, masters experiment. They mix and match things, blend various fields and concepts and bubble up ideas.

The book presents various strategies for the creative active phase like:

  1. The Authentic voice: Learn the vocabulary of the field first.
  2.  The Fact of Great Yield: Look for anomalies with profound ramifications.
  3. Mechanical Intelligence: Key to building anything right is repetition.
  4. Natural Powers: Enjoy the laborious process.
  5. The Open Field : Create space for yourself in crowded space.
  6. The Evolutionary Hijack: Creativity and adaptability are inseparable.
  7. The Dimensional Thinking: Feel the breathing element in your field.

My favorite quote from this segment of the book was:

Languages evolve in haphazard manner, influenced by the influx of new groups into a society and stages by passage of time. They are not mathematical formulas but living, evolving organism.

Next, the author puts the spotlight on the vitality of “the ultimate reality“. Life is interconnected and it all started with a single cell two billion years ago.

Mastering a field can not be done in isolation with other things. Any field that we are working on, it has been shaped by events, minds that have worked on it and time. It is simply not right to build artificial walls around subjects and study them in isolation.

Strategies suggested in the book to get the rational intuitive feel:

  1.  Connect to Your Environment: Become a consummate observer.
  2. Play to Your Strengths: Have a supreme focus on your strengths.
  3. Transform Yourself Through Practice: Get the fingertip feel.
  4. Internalize the Details: Have the patience to give attention to even the most minute details
  5. Widen Your Vision: Get the global perspective.
  6. Submit to the Other: Loose the sense of superiority when learning from someone.
  7. Synthesize all forms of knowledge

My favorite quote from this part was:

Things push and pull into each other and breathe together, and are one.

To conclude, Mastery is a great book to help people shape their mind in a way that knows what to expect and what it takes to travel on the path of mastery. And that mastery is not a destination but a lifelong journey. One should maintain a beginners mind as they grow old like zen masters.

When you read a great book at the right time, it can only go in the category of Supremely Fucking Awesome.






The Blue Ocean Strategy : How To Create Uncontested Market Space and Make the Competition Irrelevant

When Henry Ford made cheap, reliable cars people said, ‘Nah, what’s wrong with a horse?’ That was a huge bet he made, and it worked.
The whole idea of The Blue Ocean Strategy is to create uncontested market spaces that creates new demands and make the competition irrelevant.

The book describes Red Oceans as known market places that have bloody competition among businesses trying to win customers. Here there is a fixed existing demand of which every company wants a share.

The Blue Ocean on the other hand is an uncontested market place that creates demand for itself, which is not known to others. This makes competition irrelevant. Focus is on creating, not competing.

Value Innovation :

Value innovation occurs when company align innovation with utility, price and cost positions. Instead of using competition as the benchmark companies focus on taking leaps ion value for customers.

Idea behind value innovation if to break out of Value-Cost trade off.

Reducing Costs :

Reduced costs for the products are achieved by eliminating and reducing the factors that the conventional industry competes on.

Best example to illustrate this is the case study of Ford Model T.

Ford eliminated all factors like multiple colors and design variants and focused only on creating better cars for the masses.

Identifying Blue Oceans :

Identifying blue oceans needs managers and strategists of the company to brain storm on the strategy canvas. Where each manager holds his/her department accountable.

The strategy canvas’ focus must be shifted from competition to alternatives and from customers to non-customers.

Reconstruct Market Boundaries :

The author proposed a 6 step framework for identifying blue oceans in new market places :

  1. Look across alternative industries
  2. Look across strategic groups within industries
  3. Look across complementaries
  4. Look across the chain of buyers
  5. Look across functional and emotional appear to buyers
  6. Look across time

Reaching Beyond Existing Demands

To reach the customers in new markets, think of non-customers before customer differentiations.

There are 3 tiers of non-customers :

  1. Jump Ship : These can switch to competitors on any moment.
  2. Refusing : These are using competitors products.
  3. Distant : Product doesn’t appeal to these customers.

Examples of Blue Ocean Strategies Implemented by Famous Companies :

  1. Ford :

Ford standardized the car and made the options limited. This increase the quality of the car and brought the price point down.

2. GM :

General Motors found their blue ocean in making the cars fun, fashionable and comfortable.

3. Watson :

Watson computers introduced tabulators for businesses for the first time. They also introduced leasing pricing models which made it easy for businesses to own a tabulator.

4. Apple :

Apple created Apple II and tapped the new market for ready-made, easy to use personal computers.

5. Dell :

Dell on the other hand, found its blue ocean by changing the purchasing and delivery experience of the buyer. It allowed customization of the machines according to the needs of the buyer.

It is evident from the above examples that blue oceans are not unleashed by technology innovation per se but by linking technology to elements valued by buyers.

Strategy for Blue Ocean Implementation :

Two views on industry structure are related to strategic actions.

  1. Structuralist View :

Based on market structure to conduct and performance. This view on strategy deals with making sure that the company is making money in the red oceans.

2. Reconstructionist View :

This view is based on endogenous growth. It focuses on creativity not systematic approaches.

This view is responsible to find blue oceans for the company.

Both the views towards strategy are necessary to assert the company is making money is also exploring new markets to remain competent in future too.


Learning How To Learn : Course Experience

The human brain has 100 billion neurons, each neuron connected to 10 thousand other neurons. Sitting on your shoulders is the most complicated object in the known universe.

What is learning? Well basically, forming and consolidation neural patterns.

Recently I took the course “Learning How to Learn” on Coursera. I really wanted to figure out the best way to enhance my learning. And this course has been really helpful. It provides you with the right tools and tips to construct your own learning schedule. Methods shown in the course are scientifically proven and helps you understand your brain better.

Here is a quick summary of what I learned in the course :

WEEK 1 :

There are two modes of thinking :

  1. Focused Mode
  2. Diffused Mode

Focused Mode is where our mind is concentrating on following neural patterns that it is already familiar with and Diffused Mode where our mind is sort of relaxed and is ready to find new neural patterns.

Why we procrastinate?

Studies have shown that we procrastinate because when we are about to start a task that we are uncomfortable with our brain activates the parts that correspond to pain and thus wants to stay away with it.

Solution? Well, just get started. With practice this feeling will go away.

Don’t think too much and just “eat that frog”.

WEEK 2 :

Chunking : A chunk is a small interconnectable piece of information that you can learn at a time.

Basic idea behind chunking is to get a bigger idea of the topic that you are going to study and divide it into meaningful chunk. These chunks then get interconnected to to help brain learn effectively.

Mastery is just the art of increasing the number of chunks that you can interconnect.

Personally, I feel chunking is a great way to tackle procrastination too.

Illusion of competence :

When you are done with learning a topic. Force yourself to recall it.

What motivates you? Having a feeling of motivation and excitement towards learning helps the brain learn more effectively as feeling motivated releases dopamine which causes happiness.

Overlearning and Einstellung :

One should be beware of overlearning i.e repeating several times topics you already know. This causes the brain to go into Einstellung, which means that brain refuses to explore new neural patterns and becomes rigid to ones we already know very well.

Week 3 :

Habits are energy saver mode of our brains. When a habit has been formed our brain doesn’t overload itself with information and zombie mode kicks in.

Habit can be described with following parts :

  1. The Cue : Triggers that launches the zombie mode.
  2. The Routine : Habitual response in reaction to the cue.
  3. The Reward : Habits exist because we get reward.
  4. The Belief : To change habits we need to believe that we can change them.

Understanding how habits are formed and work can help us develop new good habits and get rid of the bad ones. 10 years from now everyone is going to know about your bad habits, your success is going to represent you. Now is the time to get rid of them.

Avoid Procrastination? Focus on process not the product.

Also, make your to-do list for the next day the night before. This will allow your diffuse mode to work on it while you will be sleeping.

WEEK 4 :

There is a difference in smartness of people. Smartness equals having a larger working memory.

But people with smaller working memory are scientifically proven to be more creative.

Deliberate Practice, practicing hard stuff again and again, can lift the normal brain to the realm of naturally gifted. Practicing certain neural patterns deepens the mind.

How to become a better learner?

Exercise : Exercising created new neurons in brain.

Life experiences : Gaining varying life experiences also enhances the brain.

Analogies and Metaphors : Can be used to learn and memorize effectively.

And finally ,

Virtue of less brilliant is perseverance and grit.

This course has been great for understanding how our brain works in nutshell. At least know you know how it works, you can make it work for you.

I am trying to become good at things that are way complex than what I have worked on till now. This was the reason why I took the course.

My takeaways were to practice, persevere and have patience.

I have started next course “Introduction to Algorithms by MIT”. This is a course that I always wanted to finish completely. Hopefully this time I can do that.

See you next time!


Zen and the Art of Motorcycle Maintenance : Reading Experience

The Japanese motorcycle maintenance guide says “ Assembly of Japanese bicycle requires great piece of mind”. There is a thing about everything you build, including bikes. If you build it with non-serene mind, then you build your problems into it.

The book takes you on a cross country bike journey that will teach you mind opening lessons that leave lasting impressions on your mind. Your mind will simple refuse to contract itself to older stage.

One of the most important lesson that book teaches you is to enjoy the common little things that life has for you. There is as much Buddha in cogs of bike, as there is at the top of the mountain.

Towards the beginning of the book the author says, “If you want to set out for the most amazing bike journey, you have learn the art of motorcycle maintenance.” The quote has so many meanings at different levels that your mind can explore the words in infinite ways.

As the bike journey progresses, author makes the point that the key to be doing great work is to be completely involved in it. Not like mechanics who listen music while working on the bike with no intention to make it great, the noise of the tools should be music.

How we see the world affects how we think about it. There are two ways to see the world, the classical way where everything is logical and the other is the romantic way.

Classical way of thinking runs the knife on views, something is cut. And when the logic in the logic is found, the beauty of the unknown is lost.

Romantic way of thinking is all about enjoying the continuum of things.

Quality is the thing that author says that you know what it is, but still you can not define it. Like you know what makes a tomato soup good, but yet you can not define what makes up its quality, both materialistic and spiritual.

World consists of three things : Mind, Matter and Quality.

The author was a student of University of California at one point, before his nervous breakdown. Studying there he made some amazing point on the thinking of Plato and Aristotle. How dialectic way of thinking is different from rhetoric way of thinking, but at the same time one doesn’t proves the other wrong.

My two the favorite quotes from the book are :

  1. “The only zen you’ll find at the top of the mountain, is the zen you take with you”.
  2. “The test of the machine is the satisfaction it gives you. There isn’t any other test. If the machine produces tranquillity it’s right. If it disturbs you it’s wrong until either the machine or your mind is changed.”

This is the best book that I have ever read. No matter what you are doing in your life and how old are you, this books touches your mind at levels so deep that you didn’t even think it was possible. But you’ll have to keep the beginner’s mind to learn.

As the author states, “sometimes it is better to travel than to arrive”. I was carried away with the philosophical ideas presented in the book and the serenity that the country side description provides.

Knowing that Chris, the son of the author, with whom he set out for this bike journey is dead was a little sad. But again in snap that increases the importance of all the lesson and the author was expounding throughout the book about life and zen.

A recommended read for everyone.

The next book that I have picked is “The Blue Ocean Strategy”.