Implement UUIDv7 in Amazon RDS for PostgreSQL using Trusted Language Extensions
Database Blog
This article explains how to implement UUIDv7 in Amazon RDS for PostgreSQL using Trusted Language Extensions (TLEs). UUIDv7 is a UUID that encodes a Unix timestamp in the first 48 bits, making it time-based and sequential, which can improve performance over the more random UUIDv4 by clustering commonly accessed data together.
Specifically, the article covers:
- An overview of the solution using TLEs and PL/Rust to create functions for generating UUIDv7s, generating UUIDv7s from a given timestamp, and extracting the timestamp from a UUIDv7
- Prerequisites for enabling TLEs and PL/Rust on an RDS PostgreSQL instance
- Installing the UUIDv7 TLE extension
- Using the UUIDv7 functions
- A deeper look at the implementation details of the UUIDv7 functions in PL/Rust
- Performance comparison between PL/pgSQL, PL/Rust, and a C implementation showing PL/Rust performs comparably to C
- Cleaning up by uninstalling the extension
The AWS News Feed is currently looking for gold sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.
Related articles
Mar 31
2025
2025
Amazon RDS for PostgreSQL now supports configurable cipher suites
Oct 29
2024
2024
Amazon RDS for PostgreSQL, MySQL, and MariaDB now supports M7i and R7i database instances
Nov 14
2024
2024
Amazon RDS for PostgreSQL now supports major version 17
Apr 2
2025
2025
Amazon RDS Proxy announces TLS 1.3 support for PostgreSQL on Aurora and RDS
The AWS News Feed is currently looking for silver sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.