I am working on building an auto-scaling docker cluster for our testing environment. I have no idea on the machine cluster, auto-scaling api and deployment framework, but I have to make decision on which framework to use and build the system. It is a challenge for me. There are lots of failure and lots of learning.
Failure one: Know the feature, but does not understand how they solve the problem.
Schedule is tight, I don’t have time to learn everything from zero. I start from reading article comparing ECS, kubernetes and mesos, after skiming through the introduction in their official pages. But start fast does not mean good progress, I cannot make decision after reading several articles, because I don’t know which feature is important and which is matter to me.
At that time, I want to get hands on experience so I can understand the framework in a better way. These will take more time on learning unrelated stuff, such as setting up and configuring the framework. In the worst case, we may found the framework we spent lots of time on it does not suit our need!
It will be great if we understand how the framework works without trying it. It seems impossible. But if we can focus on testing the feature we need, we already save lots of effort. To do this, we must have a good understanding on the problems framework going to use. We don’t need to understand every details, but at least having an overview of the problems.
A good framework solve a problem in an easy way. To pick a framework, we must understand the problems and how the framework solve them.
Failure two: Without refine the requirement
There is no silver bullet. There does not exist a single framework good at solving all kinds of problems. Every framework have their feature and design. It is really difficult to compare them, as the pros and cons are difficult to quantize the pros and cons of the features.
To find out the best framework which match our need, we need a marking scheme. The marking scheme can be a list of requirement.
Listing requirements is a really simple step, we always think we have know what we need, we understand the problem we have to solve. Write down the requirement is often skipped as it is too simple. But in most case, it is not as simple as you think.
No matter how simple the problem is, never skip the step writing down the requirement. Read every single words in your requirement. Think carefully to clarify every ambiguous word in the requirement. Evil is in the detail, every ambiguity mislead you to the wrong decision.
Failure three: Dig too deep into the API ( which most of them are not useful )
Understanding what feature does a it provided is an important step when picking a framework, but reading the API documentation is not a good way to do it.
I read the ECS API documentation and understand how to use the service. But at the end, I still miss some APIs I need. Even I read the APIs, I still don’t know how to use it, because I cannot remember every details important to me. The time spent on reading the API documentation is kind of wasted, because I have to read it again after I understand every detail of the problem I am going to solve.
Workflow on choosing a suitable framework
Step 1. Understand the problem
This is the most important step, we have to make sure we understanding the problem completely. Any ambiguous will lead us to make a wrong decision later. When we discover the mistake during implementation, the effort to fix it is doubled or even more.
To understand a new problem, I suggest
- Learn the related knowledge about this kind of problem
- Search how others break it down into smaller problems
- Search how others solve the problems
These help use to understand the structure of the problems, give us some direction to learn the frameworks.
Step 2. List the use cases
This step is important for us to understand the requirements. Idea in our head is incomplete and inconsistent. Writing down the user stories can reveal the flaw of our idea. You may found the solution in your mind is missing some component to solve the problem. These missing puzzles will be a hint to pick a suitable framework.
Step 3. Draft the requirement from the use cases
After step 1 and 2, we have a well understanding of the problem. We should not miss any important points now. We can list the requirement from the use case easily. In this step, we should prioritize the requirements.
There may have no framework to help us solve all problems easily, we may need to write some code or having some workaround. The priority help us to identify the importance of different features of framework, which help us a lot on quantizing the value of frameworks.
Step 4. Check the documentation of framework
After we got marking scheme, we can start grading the framework. We can search the documentation and the API by our requirements. If the time is enough, don’t miss the APIs which are not directly related to your requirement. It may inspire us to have a more efficient solution or a simpler way to solve the problem.
Tips: We can google the pros and cons of frameworks in this step, we should now able to understand the technical article and identify the article is related to our problem or not.
Step 5. Go back to step 3 until you can decide which framework to use
If you have any new idea, don’t hesitate to go back to step 3. The requirements may not perfect, we can update it when we find a better way to solve the problems. Repeating the steps of requirement refinement and framework research can give us more confidence on our decision, also lower the chance we missed something during planning.
Step 6. Work on the technical specification and then implement the solution
After the research, we understand our problems and tools. We know what feature is going to be implement, which API we are going to use. We can predict behavior of the system implemented from user stories. In this stage, there should be no big surprise.