Building Python applications with SQLAlchemy and Amazon Aurora DSQL means your object-relational mapper (ORM) handles query construction and your database handles scaling. Aurora DSQL provides a serverless, PostgreSQL-compatible database that automatically scales based on traffic and requires no capacity planning. It authenticates through AWS Identity and Access Management (AWS IAM) instead of stored passwords. SQLAlchemy is the most widely used Python ORM, with type-safe model definitions and a query builder that maps directly to SQL.
SQLAlchemy works with Aurora DSQL after three adjustments. You use universally unique identifiers (UUIDs) for primary keys (Aurora DSQL’s recommended approach for distributed workloads), define relationships using explicit primaryjoin with foreign() annotations instead of ForeignKey() constraints, and run the engine in AUTOCOMMIT mode to avoid unsupported SAVEPOINT operations.
In this post, you’ll build a working veterinary…
https://aws.amazon.com/blogs/database/building-python-applications-with-sqlalchemy-and-aurora-dsql/