Everywhere | The Java Ecosystem of Amazon Cloud Technology

Java has been a popular programming language since its inception. Thanks to its rich ecology and well-maintained packages and frameworks, Java has a huge developer community. This computer language, which was born in 1995, quickly became the first choice for enterprise-level application and even mobile application development with its cross-platform characteristics of "write once, run anywhere" and the characteristics of modern languages ​​such as object-oriented and generic programming. Amazon Cloud Technology has also been continuously investing in Java to enrich the entire Java ecosystem.

The Amazon cloud technology developer community provides developers with global development technology resources. There are technical documents, development cases, technical columns, training videos, activities and competitions, etc. Help Chinese developers connect with the world's most cutting-edge technologies, ideas, and projects, and recommend outstanding Chinese developers or technologies to the global cloud community. If you haven't paid attention/favorite yet, please don't rush over when you see this, click here to make it your technical treasure house!

Whether in the world or in China, the scale of developers is growing faster and faster. Developers will choose the language they are familiar with to build, compile and generate code. Although there are many programming languages ​​available in the market, Java has always been the language of choice for many developers.

The Apache Software Foundation's 2020 survey pointed out that the number of source codes built using the Java language far exceeds that of other programming languages, which shows how much developers love the Java language. In addition, the results of the TIOBE programming language ranking survey show that from 2001 to 2022, the Java language has always been in the top three programming languages, and was the most popular programming language among developers in 2005 and 2015 respectively. It can be seen that the Java language has a very broad market and a large developer group.

Amazon's Java ecosystem

Amazon is using Java extensively, whether it is external e-commerce retail systems or internal applications, including many Amazon cloud technology services are also built using Java.

Amazon has thousands of Java applications running in production. Starting in 2016, we realized that we should not rely too much on external binary distributions to build Java applications. the reason is:

One is that Java's quarterly releases typically introduce major updates that can have widespread impact.

The second is that some critical bug fixes need to wait for the Java release schedule, which may take several months to get support overall, and we urgently need to put these fixes into production to solve the problem.

Therefore, we decided to build Java from source code to meet Amazon's requirements for Java applications in terms of performance and security.

In 2018 we released Amazon Correto, a free, multi-platform, production-ready distribution of the Open Java Development Kit (OpenJDK). Amazon Corretto offers long-term support, which includes performance enhancements and security fixes. We will use Amazon Correto to quickly bring new capabilities to Java, fix more bugs, contribute to the Java community, and continue to contribute to OpenJDK.

1 Running Java applications at scale

As a data-driven company, Amazon runs many Java-built systems in the background, and we will generate flame graphs for these systems for operational analysis. By analyzing the visualization of the software, it helps us quickly and accurately identify the most common code paths.

This is a call snapshot of the S3 bucket in Amazon SDK v1, it provides a detailed analysis of each call, and shows the CPU utilization of each method call, here we can find that the java.math.BigInteger.squareToLen function takes up 20% of CPU time. We have this data for all services using Java. This is actually a very large-scale aggregated data.

The data generated based on Amazon's own experience will help us determine what types of contributions and improvements to Java, and feedback to the upstream community. But sometimes it takes 3-18 months for the community to adopt these fixes, so we need a whole set of solutions, not only to help Amazon internally, but also to help developers better improve Java performance and bug improvements.

2 The Java Ecosystem of Amazon Cloud Technology

The Java ecosystem of Amazon Cloud Technology is huge, complete and specific. It covers development kits and integration with Amazon cloud technology services, including services, environments, functions, tools, and more.

Before the launch of Amazon Correto, Amazon's Java ecosystem had already begun to take shape. The introduction of Amazon Correto further enriches the Java ecosystem. Including how to integrate more Java tools with commonly used IDEs, and to help developers better develop in the cloud, we have also launched the second version of the Amazon Java SDK.

At the same time, we have also considered introducing convenient Java construction methods into cloud services, such as Amazon Lambda, Amazon CDK, Amazon Kinesis, etc. Through our unremitting efforts, developers can now build any Java application conveniently, quickly and with high performance through the services and tools of Amazon Cloud Technology.

Java development tools

1 The origin of Amazon Corretto

Amazon Corretto is built from Amazon's internal requirements and is available to all developers as a binary distribution. Amazon's thousands of Java-based production environments are running Amazon Corretto, which means that many problems, errors, etc. encountered in Java development can be caught early. Amazon Corretto is a downstream distribution of OpenJDK, the open source implementation of the Java Platform, Standard Edition, which is the foundational environment required for Java SE since Java 7. OpenJDK is an open source project and has also started providing binary distributions starting with Java 11.

Amazon Corretto currently offers 4 versions: 8, 11, 17, 19. Amazon Corretto is a reliable release of OpenJDK and is guaranteed to provide free long-term support (LTS) (Amazon Corretto 19 is a non-LTS release). Each LTS release includes performance enhancements, security updates, and more that Amazon provides for free. Amazon Corretto updates are scheduled to be released quarterly, and outside of the regular quarterly cycle, emergency fixes (primarily security updates) are applied for users when necessary.

Amazon Corretto is designed to be a drop-in replacement for all Java SE distributions, and when properly installed, you can use Amazon Corretto to invoke and run Java applications in the same way you used OpenJDK before. Of course, features that are not available in OpenJDK, such as Java Flight Recorder (JFR), etc., cannot be supported by Amazon Corretto.

Amazon Corretto releases are available on most operating systems, including support for Docker image deployment. Amazon Corretto is certified using the Java Technology Compatibility Kit (TCK) to ensure its compliance with the Java SE standard.

2 External binary distributions of Amazon Corretto

It stands to reason that it makes sense for us to only release Amazon Corretto internally. Why does Amazon release a binary version externally?

We've been approached by developers who are considering rewriting all their Java software into different languages ​​like Python, C#, etc. due to changing license costs, but we really don't want that to happen, not only because This will bring unnecessary migration costs to developers, and more importantly, it may turn into a disaster for the entire Java community. Therefore, we decided to release a public binary distribution of Amazon Corretto.

Amazon has been releasing OpenJDK on Amazon Linux for a long time, so releasing Amazon Correto was easy for us. Through exchanges with developers, we decided to further promote this and share Amazon Corretto with more developers, rather than restricting it to use only on Amazon Linux images and only on Amazon Cloud. used in technical services. In this way, developers can gain a three- to twelve-month first-mover advantage by leveraging Amazon's experience with thousands of services, and they like that Amazon Corretto provides early access to new Java technologies on its platform, including Performance tuning, backporting and testing.

Many developers told us that they run some workloads on Amazon cloud technology, some on-premises, and some workloads on other clouds. They install the packaged Java software on a third-party platform. These developers were concerned about compatibility issues with multiple different binary distributions, and they asked us to provide a Java distribution that would provide good compatibility.

Amazon Corretto is available today on all major operating systems and provides no-cost, long-term support for production environments. You can run it on any cloud, on-premises, on your desktop, or bundle it with your software.

3 Collaborating in OpenJDK

Amazon works with the community to maintain LTS releases of OpenJDK, including releases 8, 11, and 17. And participate in the JCP member organizations and executive committees of the Java community to formulate the next development direction of Java and promote a better evolution of Java.

Amazon will also contribute new features to OpenJDK, such as support for the ARM architecture, including Amazon Graviton2 and Graviton3 processors.

Additionally, the Amazon Corretto team released a preview of the generational schema to Shenandoah GC. This is the result of a major GC contribution we made in partnership with Red Hat: adding generational mode to the traditional single-generation Shenandoah. One of the main advantages of Java is that the Java Virtual Machine (JVM) handles memory management automatically. Much of the innovation stems from efforts to reduce the impact of the JVM on application throughput and response time.

4 Growing contribution

Comparing the proportion of Amazon's contribution in JDK 11 (above) and JDK 17 (above), it can be seen that Amazon's contribution to Java is growing significantly.

5 OpenJDK versions and contributions

The above figure also better shows this trend. In 2020, Amazon submitted 176 contributions to OpenJDK; 381 contributions were submitted in 2021; and 110 contributions were submitted in just one quarter of 2022. It can be seen that Amazon's contribution to OpenJDK is on the rise, and we are also providing support for Java LTS versions. At present, Amazon has decided to support JDK 8 until 2026. For non-LTS versions, Amazon will upgrade within 30 days of the next version to ensure that developers can get a better, more convenient, and safer experience.

6 New features of JDK 11 to 19 (partial)

The picture above shows some of the new features from OpenJDK 11 to OpenJDK 19. It can be seen that the new features cover a wide range, and Amazon and Amazon Cloud Technology have also made very important contributions.

7 Amazon SDK for Java

This is the Amazon SDK for Java that simplifies the use of Amazon Web Services by providing a consistent set of libraries familiar to Java developers. It supports API lifecycle considerations such as credential management, retries, data marshaling, and serialization. The Amazon SDK for Java also supports higher levels of abstraction to simplify development.

The Amazon SDK for Java 2.0 is a rewrite of 1.0 with some great new features. Like version 1.0, it enables you to easily use Amazon Cloud Services, and also includes features such as non-blocking I/O, automatic pagination, HTTP/2, and pluggable HTTP layers to further customize your application. You can start using Maven or any project management tool that supports MavenCentral to build and manage dependencies for Java projects in minutes.

8 Related tools

Of course, Amazon also understands that many developers like to use IDEs for development. Amazon Cloud Technology also integrates with many mainstream IDEs to help our developers with rapid Java development.

9 Amazon CDK for Java

Amazon CDK is an open source software development framework for modeling and provisioning cloud application resources using familiar programming languages. You can do this using different programming languages ​​like Python, JavaScript, TypeScript, Java or C#.

Compared with previous tools, using CDK can make you get started much faster, because you can use familiar languages ​​and concepts, classes and methods without context switching. You also have all the tooling support for a programming language, such as autocompletion, inline documentation, testing, Linting, and a debugger. Most importantly, you can abstract and build infrastructure and applications faster. We provide a lot of sensible defaults, so there's no need to read extensive documentation, just take advantage of the defaults to get started quickly and safely. Of course, many of the defaults can be tweaked to suit your needs.

10 Java frameworks

Many developers are currently using different Java frameworks for application development and construction. Including web applications, microservices, persistence APIs, and more. I believe that all developers have chosen different frameworks to speed up development. Amazon cloud technology provides a complete set of development ecosystem services to provide good support for this.

11 Developer Tools for Java Software Delivery

We have end-to-end solutions to help developers work together. From CI/CD to whole-system observability, from infrastructure as code to dev/test, to dev and security integration, you can build a mature end-to-end Java development practice with specialized Amazon tools. At the same time, we have natively integrated with top suppliers in certain areas to provide developers with a one-stop experience.

Specifically, you can use Amazon Cloud 9 and the Java SDK during the build phase and version control it with Amazon CodeCommit. Code commits can be made using a Git-like environment that can be integrated with any standard IDE (Eclipse or VS Code). Amazon CodeArtifacts is a versioned repository of binaries, and if you're using Processing Containers/K8s, you can use Amazon ECR to push and pull images. Amazon Codeguru is our machine learning injection service for SAST (Static Code Analysis) that helps you improve code quality and security.

Developers can use Amazon CodeBuild to generate Java code and use Amazon CodeDeploy to deploy it to Amazon cloud technology environments. Amazon Codepipeline provides complete integration for CI/CD pipelines. All of these development services integrate well with observability tools. Developers can use CloudWatch to record and alert requirements, use X-Ray for tracing, use Amazon Config to evaluate, audit and evaluate the configuration of AWS resources, and use DevOps experts to identify anomalies in production code. For containerized workloads, managed services like Prometheus and Grafana are well suited for observability needs. Best of all, you can configure these services using our infrastructure-level code, CDK or SAM for serverless.

Step 1 - Build the codebase using Amazon CodeCommit

Amazon CodeCommit is a secure, highly scalable, managed source control service that makes it easier for teams to collaborate on code. With Amazon CodeCommit, you don't need to run your own source code control system or worry about your infrastructure's ability to scale. You can use Amazon CodeCommit to store any data from code as a binary file, and it works seamlessly with your existing Git tools.

Step 2 - Compile and test with Amazon CodeBuild

After the development phase, you typically generate, compile, and test the Java source code. You can leverage Amazon CodeBuild, a fully managed service, to package dependencies and create builds and run unit tests. Use Amazon CodeBuild to package dependencies, create build packages, and run related unit tests. Use the service to set up, patch, update, and manage, as well as scale up and down automatically to meet your code's build needs.

Step 3 - Deploy with Amazon CodeDeploy

During the deployment process, what we look for is any reason to fail, not continue and/or roll back the deployment. In this process, we use many best practices that Amazon internal teams follow.

Usually we divide it into three steps: First, the deployment is performed in the beta environment, where various aggressive tests are performed; if everything is normal, then it can be moved to the gamma environment, which is a production-like environment, running a full end-to-end testing. Finally, if nothing fails, you can move to production, execute the deployment in batches or waves and execute and monitor for results.

Following this approach can help developers quickly deploy code on success and rollback code on failure. You can use CodeDeploy to automate deployments and maximize application availability.

12 Amazon CodePipeline Continuous Delivery

CodePipeline models build and test, and can deploy code every time a code change occurs, according to the release process model you define. This enables you to deliver features and updates quickly and reliably. You can easily build an end-to-end solution by integrating our pre-built plugins for popular third-party services like GitHub or integrating your own custom plugins into any stage of the release process.

We hope to build a Java community and Java ecosystem with developers, help developers better develop Java applications on the cloud, and improve developers' all-round skills.

Welcome to continue to pay attention to the Build On Cloud WeChat official account to learn more about technology sharing and cloud development trends for developers!

 

Author Wang Yubo

Director of Developer Relations of Amazon Cloud Technology Greater China, dedicated to the evangelism and promotion of the new generation of information technology and innovation among developers, as well as the construction of developer communities and ecosystems. He previously worked as a senior product manager of Amazon Cloud Technology for many years, responsible for the business and market development of related products such as cloud native, big data and machine learning. Before joining Amazon Cloud Technology, he worked in product, technology and management positions in many multinational companies. He has nearly 20 years of experience and practice in the IT industry. He also has many years of scientific research experience in the fields of computer vision and pattern recognition.

Article source: https://dev.amazoncloud.cn/column/article/64007e63a50b6210656fa667?sc_medium=regulartraffic&sc_campaign=crossplatform&sc_channel=CSDN

Guess you like

Origin blog.csdn.net/u012365585/article/details/131354977