Presto Takes a Leap: Upgrading to Java 17 for Enhanced Performance and Security

    We’re excited to announce that the core Presto engine is migrating to Java 17. This upgrade reinforces our commitment to providing a robust, high-performance, and secure SQL query engine. This change allows Presto to leverage Java 17’s improvements, bringing enhancements in performance, stability, and security, and laying a strong foundation for future upgrades.

    Why Java 17? Unlocking New Benefits for Presto

    Java 17 introduces platform-level optimizations that enhance Presto’s efficiency and power. This aligns Presto with the modern Java ecosystem, benefiting from Oracle’s new 2-year LTS cadence and ensuring rapid adoption of future advancements

    Performance Boosts

    Users should see slightly better stability due to JVM improvements, including enhanced garbage collection mechanisms and optimized code generation. A key highlight is the progress in Java 17’s Garbage Collectors. ZGC now achieves sub-millisecond pause times, and G1 GC should have improved throughput on the same workloads and hardware. For a resource-intensive engine like Presto, minimizing GC pauses mean worker nodes spend less time on memory management and more on query execution, leading to faster query completion, higher concurrent query capacity, and more efficient hardware use, improving cost-effectiveness and responsiveness.

    Enhanced Security Posture

    Java 17 includes critical security improvements for Presto deployments, such as strengthened TLS support, robust authentication, and stronger encryption algorithms. In addition, it includes support for a new transport layer using the most recent Jetty 12 server. For any data platform handling sensitive information, these upgrades are vital for data integrity and confidentiality.

    Modern Language Features & Tooling

    The upgrade also provides the Presto development team access to new language features like pattern matching for instanceof, switch expressions, and records. It also offers improved tooling for debugging, profiling, and efficient build processes. These benefits enable engineers to write more concise, maintainable, and efficient code, accelerating future development and ensuring the project remains agile.

    Compatibility at a Glance: What This Means for Your Setup

    Client-Side Flexibility

    Existing native Presto clients and the Presto JDBC driver remain compatible with Java 8. This ensures applications connecting to Presto can continue running on Java 8 without immediate modifications, reducing the burden on users and allowing them to upgrade at their own pace.

    External Connector Support

    External connectors can largely continue to operate with Java 8 compatibility, providing flexibility for integrating diverse data sources without a synchronized ecosystem upgrade.

    Core Runtime Requirement

    To fully utilize Java 17’s enhancements, Presto coordinator and worker nodes must run on Java 17 at runtime. Users will need to upgrade the Java Runtime Environment on these machines. 

    Presto ComponentRequired Java VersionNotes
    Presto CoordinatorJava 17Must run on Java 17 to leverage core engine benefits.
    Presto WorkerJava 17Must run on Java 17 to leverage core engine benefits.
    Native Presto ClientJava 8 (or newer)Compatible with Java 8 for backward compatibility.
    Presto JDBC DriverJava 8 (or newer)Compatible with Java 8 for backward compatibility.
    External ConnectorsJava 8 (or newer)Can remain Java 8 compatible, offering flexibility.

    JVM Configuration Additions: 

    When configuring your JVM for Presto with Java 17, you may need to add specific --add-opens flags to your JVM configuration files. These flags are necessary to allow Presto to access internal Java modules that have become encapsulated in Java 17. The following flags are commonly required:

    --add-opens=java.base/java.io=ALL-UNNAMED
    --add-opens=java.base/java.lang=ALL-UNNAMED
    --add-opens=java.base/java.lang.ref=ALL-UNNAMED
    --add-opens=java.base/java.lang.reflect=ALL-UNNAMED
    --add-opens=java.base/java.net=ALL-UNNAMED
    --add-opens=java.base/java.nio=ALL-UNNAMED
    --add-opens=java.base/java.security=ALL-UNNAMED
    --add-opens=java.base/javax.security.auth=ALL-UNNAMED
    --add-opens=java.base/javax.security.auth.login=ALL-UNNAMED
    --add-opens=java.base/java.text=ALL-UNNAMED
    --add-opens=java.base/java.util=ALL-UNNAMED
    --add-opens=java.base/java.util.concurrent=ALL-UNNAMED
    --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED
    --add-opens=java.base/java.util.regex=ALL-UNNAMED
    --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED
    --add-opens=java.base/sun.security.action=ALL-UNNAMED
    --add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED

    Please note that depending on your specific connector usage and other configurations, additional --add-opens flags may be required. Refer to the latest Presto documentation and your connector documentation for comprehensive configuration details.

    Next Steps & Further Details

    For technical details, refer to the official GitHub Pull Request: https://github.com/prestodb/presto/pull/24866. All Presto users are encouraged to plan their upgrade paths for coordinator and worker nodes. Consult deployment documentation and Java migration guides. The Presto community is available for support during this transition.

    Conclusion

    The move to Java 17 is a significant milestone for Presto, reinforcing its position as a leading distributed SQL query engine. This upgrade provides a stronger, more modern foundation for enhanced performance, security, and stability, ensuring Presto continues to meet demanding data workloads. We are excited about the new possibilities Java 17 brings, empowering a more powerful and efficient Presto experience.

    Release Notes:

    Core Engine Requirement: Presto coordinator and worker nodes must run Java 17 to benefit from performance and security enhancements.
    Client Compatibility: Native Presto clients and the JDBC driver remain compatible with Java 8, allowing for flexible client-side upgrades.
    External Connectors: Your existing external connectors can continue to operate with Java 8 compatibility.