Explore the open source development journey of the Seata project

Seata is an open source distributed transaction solution dedicated to providing high-performance and easy-to-use distributed transaction services under a microservice architecture. During this year's Open Source Summer event, I joined the Apache Seata (Incubator) community, completed the Open Source Summer project, and have been actively participating in the community since then. I had the honor to share my developer experience at the Yunqi Conference-Developer Showcase. In this article, I will share with you my journey as a developer in the Seata community and the experiences and insights I have gained along the way. I hope that through my story, I can inspire more people to embark on this challenging and inspiring open source road and make their own contribution to the prosperity of the open source community.

Related background

Before I formally describe my experience, I'd like to provide some background information to explain why and how I get involved in open source. Regarding the reasons for participating in open source, I believe everyone has different motivations. Here are some of the main reasons I think:

  • Learning:Participation in open source gives us the opportunity to contribute to open source projects developed by different organizations, interact with industry experts, and provides learning opportunities.
  • Skill improvement:In my case, I usually use Java and Python for backend development. But while participating in the Seata project, I had the opportunity to learn the Go language and broaden my backend technology stack. Additionally, as a student, it was difficult for me to gain access to production-grade frameworks or applications, and the open source community provided me with this opportunity.
  • Interests:My friends are all keen on open source. They enjoy programming and are passionate about open source.
  • Job Hunting:Participating in open source enriches our portfolio and adds weight to our resume.
  • Work needs:Sometimes participating in open source is to solve problems encountered at work or to meet work needs.

These are the reasons for participating in open source. For me, learning, skill improvement and interest are the main motivations for participating in open source. Whether you are a student or an employee, if you are willing to participate in open source, don't hesitate, anyone can contribute to open source projects. Age, gender, job and location don't matter, the key is your passion and curiosity about open source projects.

The opportunity for me to get involved in open source was when I participated in the Open Source Summer event organized by the Software Institute of the Chinese Academy of Sciences.

Open Source Summer is an open source activity for university developers. The community releases open source projects, and student developers complete project development under the guidance of instructors. The results of the projects are contributed to the community, incorporated into the community warehouse, and receive project bonuses and certificates. Open Source Summer is an excellent opportunity to step into the open source community. It is also my first formal contact with open source projects, and this experience has opened a new door for me. Since then, I have deeply realized that it is extremely fun and meaningful to participate in the construction of open source projects, share your technical achievements, and allow more developers to use what you have contributed.

The picture I share below is the official public data of Open Source Summer. The number of participating communities and students has been increasing year by year since 2020, and the activities are getting better and better. It can be seen that there are 133 participating community projects this year. Each community provides several topics, and each student can only choose one topic. It is a relatively complicated task to find the community you want to participate in and the topic that suits you among so many communities.

Taking into account the activity of the community, the fit of the technology stack, the guidance of new people, etc., I finally chose to join the Seata community.

Seata is an open source distributed transaction framework that provides a complete distributed transaction solution, including AT, TCC, Saga and XA transaction modes, and can support multiple programming languages ​​and data storage solutions. It has been 5 years since it was open sourced in 2019, and there are more than  300 in the community. >  customers. It can be said that it is a distributed transaction solution. standard.  There is a relationship between integrating and being integrated among multiple communities, and it has been applied to business systems by thousands of20 more mainstream RPC frameworks and RDBMS, and 10 stars, it is a very mature community. At the same time, Seata is compatible with 24k+Multiple contributors, the project has received 

On October 29, 2023, Seata was officially donated to the Apache Software Foundation and became an incubation project. After incubation, Seata is expected to become the first top-level distributed transaction framework project of the Apache Software Foundation. This donation will also promote the broader development of Seata and have a profound impact on the construction of the ecosystem, thereby benefiting more developers. This important milestone also brings broader development space for Seata.

development journey

After introducing some basic information, I will share my development journey in the Seata community in the following article.

Before officially starting development, I carried out a lot of preparation work. Because Seata has gone through five years of development and accumulated hundreds of thousands of lines of code, there is a certain cost of getting started directly involved in development. I shared some preparation experiences in the hope that it can provide some inspiration to everyone.

1. Documents and blogs are first-hand materials

Text materials such as documents and blogs can help newcomers to the community quickly understand the project background and code structure.

First of all, the official documentation is the most important reference material. From here you can learn everything the official thinks you need to know.

Blogs, second only to official documents, are generally written by developers or in-depth users. The difference from documents is that blogs may go deeper into a specific project, such as the theoretical model of some projects, project structure, and a certain project. Source code analysis of each module, etc.

Public accounts, similar to blogs, generally contain technical articles. Another advantage of public accounts is that you can subscribe to push notifications and use your spare time to read some technical articles.

In addition, some online sharing in the open source community or slides made public in offline Meetups are also very meaningful text materials.

In addition to official materials, there are many third-party materials for learning. For example, you can learn about the specific implementation and practice of the project through use cases shared by users; you can understand the project's ecology through the integrated documents of the third-party community; Video tutorials to learn. But out of all these materials, I think the official documentation and blogs are the most helpful.

2. Familiar with using frameworks

Of course, the textual information just mentioned does not need to be read in all aspects. It will be shallow after reading it on paper. After reading it, you can start to practice it when you feel that you almost understand it. You can follow the "Get Started" chapter of the official document to gradually understand the basic process of the project. Another approach is to find officially provided examples or demos, build and run them, understand the meaning of the code and configuration, and understand the project's needs, goals, and existing functionality and architecture by using the project.

For example, Seata has a warehouse called seata-samples, which contains more than 20 use cases, such as Seata and Dubbo integration, and SCA and Nacos integration cases, which can basically cover all supported scenarios.

3. Roughly read the source code to grasp the main logic

During the preparation phase, it is also important to briefly read the source code to grasp the main logic of the project. Knowing how to effectively grasp the main content of a project is a skill that requires long-term accumulation. First, it is helpful to understand the conceptual, interaction, and process models of the project through the aforementioned preparatory steps.

Taking Seata as an example, through official documents and actual operations, you can understand the three roles in the Seata transaction field: TC (Transaction Coordinator), TM (Transaction Manager) and RM (Resource Manager). As an independently deployed server, TC is used to maintain the status of global and branch transactions and is the key to Seata's high availability; TM is used to interact with TC to define the start, commit or rollback of global transactions; RM is used to manage branch transaction processing Resources, interact with TC to register branch transactions and report the status of branch transactions, and drive branch transaction commits or rollbacks. Having a rough understanding of the interactions between these roles makes it easier to grasp the main logic of the project.

With the impression of these models engraved in my mind, it is relatively easy to extract the backbone of the source code. For example, Seata TC transaction coordinator, as the server side, is a separate application independent of business deployment. In order to analyze the source code, you can directly start the server locally and start tracing by starting the class. You can analyze some initialization logic such as service registration, global lock initialization, etc. There are also interactive logic codes that can be traced through RPC calls, such as how TC persists global transactions and branch transactions, and how to drive global transactions to commit or rollback.

However, the framework code of the embedded client does not have a startup class entry that can be analyzed. In fact, you can start with a sample and find its reference to the framework code to read it. For example, a very important annotation in Seata is GlobalTransaction, which is used to identify a global transaction. If you want to know how TM analyzes this annotation, we can use the IDE's search function to find the GlobalTransaction interceptor and analyze the logic.

There is also a little tip to share with you. Generally speaking, unit testing focuses on the functions of a single module. You can understand the input, output, and logical boundaries of a module by reading the unit test. You can also read the code along the call chain of the unit test. It is also a very important means to understand the source code.

Everything is ready and all we need is the east wind. After sufficient preparations have been made, the next step is for the district to actively participate in the community.

There are many ways to participate. The most common way to participate is to view the project's Issues list. The community usually marks some Issues with special labels for new contributors, such as "good-first-issue", "contributions-welcome" and "help-wanted" etc. You can filter tasks of interest through these tags.

In addition to Issues, GitHub also provides a discussion function, where you can participate in some public discussions and get new ideas.

In addition, communities often hold regular meetings, such as weekly or bi-weekly meetings, where you can attend to learn about the latest developments in the community, ask questions, and communicate with other community members.

Summary and thoughts

I first joined the Seata community through the Open Source Summer event. I completed my project, implemented some new functions for Seata Saga, and also made a series of optimizations. But I don't stop there, because I gained the most valuable developer experience in my student career during Seata's open source experience, and I continued to be active in the community through the above-mentioned participation methods. This is mainly due to the following aspects:

  • communication and socializing

The mentorship system provided me with vital support. During the development process, the close collaboration between me and my mentor Yixia played a key role in adapting to the community culture and workflow. He not only helped me adapt to the community, but also provided me with programming ideas and shared with me some experiences and insights at work, which were very helpful to my development. In addition, Qing Ming, the founder of the Seata community, also provided a lot of help, including establishing connections with other students, helping me with code reviews, and also providing me with many opportunities.

  • Positive feedback

During the development of Seata, I experienced a virtuous cycle. Many details provide me with a lot of positive feedback, such as my contributions being widely used and benefited by users, and development being recognized by the community. This positive feedback reinforces my desire to continue contributing to the Seata community.

  • Skill improvement

Furthermore, participating in the development of Seata has also greatly improved my abilities. Here, I can learn production-level code, including performance optimization, interface design, and boundary judgment skills. Can directly participate in the operation of an open source project, including project planning, arrangement, communication, etc. Of course, you also understand how a distributed transaction framework is designed and implemented.

In addition to these valuable developer experiences, I also learned some personal insights about participating in open source from this experience. To inspire other students who are interested in participating in the open source community, I made a simple summary:

  • Understand and learn community culture and values

Every open source community has different cultures and values. Understanding the culture and values ​​of a community is critical to successful participation in the community. Observing and understanding how other members of the community develop and communicate on a day-to-day basis is a great way to learn about the culture of a community. Respect the opinions of others and be tolerant of different viewpoints in the community.

  • Dare to take the first step

Don't be afraid to face difficulties, taking the first step is key to participating in the open source community. You can start by collecting Issues with labels such as "good-first-issue" and writing documents and unit tests. The important thing is to overcome your fear of difficulties and actively try and learn.

  • Be confident in your work

Don't doubt your abilities. Everyone starts from scratch and no one is born an expert. Participating in the open source community is a learning and growth process that requires continuous practice and accumulation of experience.

  • Actively participate in discussions and continue to learn different technologies

Don’t be afraid to ask questions, whether it’s about the specific technology of your project or challenges during development. At the same time, don’t limit yourself to one area. Try to learn and master different programming languages, frameworks, and tools, which can broaden your technical horizons and provide valuable insights for your projects.

Through my open source journey, I have accumulated valuable experiences and skills that have not only helped me grow into a more valuable developer, but also given me a deep understanding of the power of the open source community. However, I am not just an individual participant, I represent part of the Seata community. As an open source project that is constantly growing and evolving, Seata has great potential and faces new challenges. Therefore, I would like to emphasize the importance and future potential of the Seata community. It has entered the incubation stage of the Apache Software Foundation. This important milestone will bring broader development space for Seata. Seata welcomes more developers and contributors to join. Let us jointly promote the development of this open source project and contribute to the progress of distributed transactions.

Author: Yin Xiangkun, Tsinghua University, Seata Open Source Summer student participant

Original link

This article is original content from Alibaba Cloud and may not be reproduced without permission.

Tang Xiaoou, founder of SenseTime, passed away at the age of 55 In 2023, PHP stagnated Wi-Fi 7 will be fully available in early 2024 Debut, 5 times faster than Wi-Fi 6 Hongmeng system is about to become independent, and many universities have set up “Hongmeng classes” Zhihui Jun’s startup company refinances , the amount exceeds 600 million yuan, and the pre-money valuation is 3.5 billion yuan Quark Browser PC version starts internal testing AI code assistant is popular, and programming language rankings are all There's nothing you can do Mate 60 Pro's 5G modem and radio frequency technology are far ahead MariaDB splits SkySQL and is established as an independent company Xiaomi responds to Yu Chengdong’s “keel pivot” plagiarism statement from Huawei
{{o.name}}
{{m.name}}

Guess you like

Origin my.oschina.net/yunqi/blog/10322143