AWS Partner Network (APN) Blog

Every Microsecond Counts: YugabyteDB Boosts Performance with Amazon Time Sync

By: Karthik Ranganathan – Co-founder and Co-CEO, Yugabyte
By Shreyas Agnihotri – VP, Growth at Yugabyte, focusing on distributed databases
By Josh Levinson – Principal Product Manager Technical, AWS
By Julien Ridoux – Principal Software Engineer, AWS

Yugabyte logo
 Yugabyte-APN-Blog-CTA-Button-2025

Tracking the order of events in distributed computing isn’t just a fundamental problem—it’s the heartbeat of computer science! For years, builders of distributed systems were confined to using wall-clock time only for human-facing features like log timestamps and user interfaces. Until now, builders of distributed systems were confined to using wall-clock time only for human-facing features like log timestamps and user interfaces. The lack of precision clocks limited their ability to build high-performance distributed applications. To track the actual sequence of events, engineers had to conjure up sophisticated mechanisms as a workaround. Today, advances in clock precision and accuracy enable new possibilities in distributed system design.

With clocks now boasting precision and accuracy that scales effortlessly for distributed systems, we’re entering a new era of system design. Clock accuracy transforms from a pesky limitation into a powerful feature, simplifying those complex algorithms and unlocking unprecedented levels of system performance. This solution delivers immediate, measurable benefits for your distributed applications.

In this post, we’ll delve into how YugabyteDB enhances its Hybrid Logical Clock (HLC) mechanism by integrating with the enhanced Amazon Time Sync Service on Amazon EC2 instances, which provides microsecond-accurate reference clocks.

About YugabyteDB and Amazon Time Sync Service

YugabyteDB powers mission-critical workloads for Fortune 100 companies and start-ups worldwide, spanning industries such as fintech, financial services, retail (including the top US supermarket chain), streaming media (notably the platform behind 2024’s most-watched NFL game), and automotive manufacturing. Using precision time to reduce latency and increase throughput means YugabyteDB’s customers can more quickly access and use their data while maintaining the consistency and resiliency they are used to.

The Amazon Time Sync Service delivers microsecond-level clock precision for YugabyteDB. Integrating with Amazon Time Sync’s improved clocks reduce system latency by up to 3x and achieves up to 2x higher throughput compared to deployments without the Amazon Time Sync Service. We’ll explore the technical nuances of this integration and how it benefits distributed applications. With Amazon Time Sync Service, you can now access microsecond-level clock accuracy through PTP Hardware Clocks on supported Amazon EC2 instances, helping you build more efficient distributed systems. These clocks can be used to more easily order application events, measure 1-way network latency, increase distributed application transaction speed, and incorporate in-region and cross-region scalability features while also simultaneously simplifying technical designs. This capability is an improvement over many on-premises time solutions, and it is the first time this level of time service is offered by any cloud provider.

The challenge of time in distributed systems

Distributed databases like YugabyteDB are designed to run across multiple nodes, often spread across different servers or geographic regions. Each node maintains its own system clock, leading to inevitable clock skew—the time difference between system clocks on different nodes. Clock skew increases latency by forcing additional transaction retries, which consume both time and resources, directly impacting your application’s performance.

This is important for applications requiring strong consistency and low latency, such as financial services, e-commerce platforms, and real-time gaming.

YugabyteDB’s solution using AWS

To tackle the challenges of clock skew, YugabyteDB employs Hybrid Logical Clocks (HLCs), which combine physical and logical clocks to assign timestamps to transactions. Figure 1 shows how HLCs combine physical, wall clock time with a logical component, combining decades of computer science research with the innovation of accurate and reliable clocks.

Diagram showing 64-bit Hybrid Logical Clock structure: physical timestamp (left) and logical counter (right) components

Figure 1: Hybrid Logical Clocks (HLCs) combining Physical Time from Amazon Time Sync with a vector clock component

This hybrid approach ensures causal consistency and accurate ordering with resiliency or a logical component.

YugabyteDB’s causal consistency ensures that your transactions maintain their correct sequence and relationships, even when running across multiple nodes. This approach provides stronger reliability than traditional wall-clock time systems, helping you maintain data accuracy while maximizing performance.

When we began the YugabyteDB project in 2016, our premise was that clock synchronization in public clouds would keep getting better over time. This premise has already proven to be true with the Amazon Time Sync Service providing microsecond-level accuracy for cloud workloads.

Enter Amazon Time Sync Service with PTP Hardware Clocks

To achieve microsecond-level synchronization, YugabyteDB integrates with the enhanced Amazon Time Sync Service with PTP Hardware Clock (PHC) support. This local, hardware-based reference time system on supported Amazon EC2 instances is part of the AWS Nitro System, so it is directly accessible on supported bare metal and virtualized Amazon EC2 instances without using any additional user resources.

How precision time Enhances YugabyteDB’s HLC Mechanism

By using the Amazon Time Sync Service’s new PTP Hardware Clocks on Amazon EC2 instances and the AWS ClockBound library, YugabyteDB was able to improve their HLC mechanism to stay ahead of the competition with the following improvements:

  • Reduced Uncertainty Window: Microsecond-level synchronization allows YugabyteDB to minimize the uncertainty window due to time difference between the nodes. This results in fewer transaction restarts.
  • Improved Latency and Throughput: Fewer transaction restarts lead to faster transaction processing, directly impacting application performance, more than doubling the throughput (2X throughput improvement) and significantly reducing transaction latency (3X latency improvement) depending on the workload. Figure 2 show how these improvements translate to a better user experience, more reliable applications, and reduced infrastructure costs.

Graph comparing YugabyteDB metrics: 500ms vs 50μs clock skew, showing 3x lower latency, 2x higher throughput, and fewer retries.

Figure 2: YugabyteDB performance improvements after incorporating ClockBound and the Amazon Time Sync service 

YugabyteDB 2.23.1 release includes support for integrating with the Amazon Time Sync Service’s new PHC and ClockBound library using this flag: –enhance_time_sync_via_clockbound . This YugabyteDB feature is currently in Tech Preview.

 

Conclusion

Accurate time synchronization is a cornerstone for high-performance distributed systems. By integrating with the Amazon Time Sync Service with PHC support, YugabyteDB enhances its HLC mechanism, you can immediately see up to 3x reduction in transaction latency and up to 2x improvement in throughput. These performance gains translate directly into better application responsiveness and more efficient use of your infrastructure resources. We encourage developers and organizations to leverage this integration for building robust, scalable, and efficient distributed systems.

Getting started is straightforward – simply upgrade to YugabyteDB 2.23.1 or later and enable the feature using the enhance_time_sync_via_clockbound flag on your supported Amazon EC2 instances. We invite you to explore how this powerful combination of YugabyteDB and AWS can transform your distributed database workloads. Visit the YugabyteDB blog, learn more about Amazon Time Sync service, or find YugabyteDB on AWS Marketplace to begin optimizing your distributed systems today.

Connect with YugiibyteDB


YugabyteDB – AWS Partner Spotlight

YugabyteDB is the cloud native relational database for business-critical workloads. It is a full-featured RDBMS that protects enterprises with continuous availability, boosts business responsiveness with rapid horizontal scaling, and accelerates developer productivity with the industry-leading PostgreSQL compatibility.

Contact YugabyteDB | Partner Overview | AWS Marketplace