In his knowledge planet, Mr. Ding invited me to answer the following question:
I think this question is very interesting. Let’s put it on the official account. Let me share with you some of my insights on this issue.
Thank you for your invitation
Here I would like to briefly talk about some of my insights from participating in the open source project of Seata during this period:
1. How to participate in open source projects and contribute?
I always have the habit of searching some mainstream open source projects on GitHub. I started to pay attention to Seata from GitHub in May last year After the introduction of the project, I felt that its design concept was very good. Although there were still many places that were not perfect at that time, it did not hinder my praise for it. I had a strong interest in it. At that time, I germinated, and I wanted to be a contributor to the project.
Many people say that I’m not a big man, I’m not good enough, I don’t have much spare time and energy, and I don’t know whether this project is suitable for me, and so on. Some people think that I need to be a big bull in a certain field before I can participate in it. In fact, this is the biggest misunderstanding of open source. Of course, there are big bulls in open source. There are not only many, but also many of them It’s worth learning from, but it’s not necessary to be a big bull in a certain field to contribute to open source projects, but you need to spend a lot of time and energy to contribute. In this process, you can also learn a lot.
I will continue to talk about how I participated in Seata’s contribution:
I started to understand the Seata project from the official documents, and according to my own understanding, I wrote an article. At the same time, this article was reprinted by Alibaba middleware. As Mr. Ding said, contributing to open source projects is not only contributing code, but also contributing to projects.
After understanding the principle of Seata, I started to look at the source code of Seata and continued to make in-depth research. In this process, I found that there are many aspects of Seata source code that need to be improved, so I got the opportunity to contribute to the code. In the process of looking at the source code, I participated in some bugs I have a special feeling about the code optimization, because the RPC refactoring of Seata is mainly completed by me. Because I have studied the source code of rocketmq before, including remoting module, I feel that its design idea is very good, so I brought this design idea from rocketmq to Seata Seata.
I would like to add that when many people look at the source code, they see that some of the code is not very elegant and they don’t want to study it any more. I think this is very undesirable. When we look at the source code, we need to adhere to the principle of “don’t stick to the details, look at the general idea” Because everyone has their own coding style. If you feel that the writing is not good, then your chance will come. Will it be better to propose a wave of PR optimization? Moreover, an open source project has its own design concept. Don’t neglect the overall architecture design for the sake of sticking to a small section.
In the process of participating in the development, it is equivalent to playing games and upgrading. If you have contributed your own code to an open source project, Congratulations, you have successfully become the contributor of the project. At this time, in the list of contributors of the open source project, you will have your name, and your code will run with the project Everywhere, is it full of sense of achievement? If you’ve been contributing to the project consistently, it’s just around the corner to become the core developer of the project. But we need to remember that continuous contribution is not only about submitting code, but also participating in PR code review, outputting articles and answering user questions.
In a word, it’s not difficult to participate in open source projects and contribute to them. What’s difficult is whether you have a persistent heart, and what’s difficult is whether you have put your mind into action.
To do open source, we need to persevere.
2. What can we learn from open source projects?
From the above description, I spent so much time and energy, what can I get from it? Just let my code run everywhere? It’s too impetuous.
In this process, you will communicate with a group of excellent programmers and be able to do your job well. At the same time, you can also contribute your spare time to open source people. This shows that this person is not bad at ability and full of passion. At least for programming, he is full of interest. You will be slow to do an interesting open source project with these excellent people Slowly get better.
Participating in open source projects will give you a kind of learning driving force. For example, when I reconstruct the Seata RPC module, I will be driven to learn about netty, when I write configuration synchronization scripts, I will be driven to learn to write scripts (I really write Seata configuration synchronization scripts while learning), and when I study the implementation principle of Seata configuration center, I will be driven to study Seata SPI Mechanism, and to understand the characteristics of each configuration center framework, and so on, human nature is often lazy. If you study for the sake of learning, many times you will give up halfway, many times you do something halfway, often because there is no external driving force to drive you to insist. Anyone who has studied physics knows that there is no perpetual motion machine in the world, and the external driving force is the source of your persistence.
At the same time, when you study the source code or conduct PR code review, you can see a lot of Daniel’s programming ideas, which is also your most valuable source of experience. For example, the processor design idea of Seata RPC module is from rocketmq source code. If you want to get rid of daily crud and improve your coding level, come to open source and make some contribution!
There are many big bulls in open source projects. Participating in open source will make you more humble and open-minded.
The above is what I can learn from the open source project.
PS: welcome to the Seata community. Do something interesting with a group of excellent people!
Design principle of distributed transaction middleware Seata
About the author
The author, Zhang Chenghui, is good at message middleware skills, and is responsible for the maintenance of the company’s million TPS level Kafka cluster. The public number “back end advanced” maintained by the author shares the actual combat summary and detailed source code analysis of Kafka and rocketmq series from time to time. At the same time, the author is also the open source distributed transaction framework Seata of Alibaba Contributor, therefore, will share relevant knowledge about Seata; of course, the company will also share relevant knowledge about web, such as spring family bucket. The content may not be comprehensive, but it must make you feel that the author’s pursuit of technology is serious!
Official account: Advanced backend
Technology blog: https://objcoding.com/