database connections

Tech Optimizer
December 8, 2024
The text discusses the integration of Python and PostgreSQL for developing scalable applications, transitioning from SQLite to PostgreSQL. It highlights the use of the psycopg2 library for connecting Python to PostgreSQL and Postgres.app for setup. The project will cover establishing secure database connections, performing bulk inserts, and safely updating records using parameterized queries to prevent SQL injection. By the end of the project, participants will be able to create tables, insert data, execute queries, update records, and delete information while following best practices for database management. The project also includes implementing logging and managing environment variables for database credentials. A limited-time lifetime discount on annual subscriptions is mentioned, offering immediate access to content.
Tech Optimizer
October 2, 2024
A financial institution collaborated with AWS to create a solution that enables sub-minute failover between Availability Zones and single-digit minute recovery times across AWS Regions for their wealth management customer portal. The solution utilizes automation for failure detection and failover, along with AWS-managed data replication, specifically employing the Amazon Aurora PostgreSQL-Compatible Edition and Amazon Aurora Global Database for cross-Region replication. Key components include canary outage detection via AWS Lambda, DNS redirection through Amazon Route 53, and control plane resilience using the Amazon Route 53 Application Recovery Controller. The architecture is based on a three-tier model, with in-Region failovers expected to occur in seconds and cross-Region recoveries within minutes. The architecture team aimed to reduce the Recovery Time Objective (RTO) from tens of minutes to seconds and established a Recovery Point Objective (RPO) of under one minute. The failover process prioritizes speed, opting for immediate failover rather than controlled switchover. Testing confirmed that in-Region failover resulted in minimal disruption, while cross-Region failover could be completed in single-digit minutes. Recent enhancements to Amazon RDS Proxy and Aurora PostgreSQL have improved the architecture's efficiency and user experience.
Tech Optimizer
July 5, 2024
- PostgreSQL's performance can degrade with an excessive number of concurrent connections. - Connection pooling solutions like PgBouncer are essential for high-traffic environments. - PgBouncer reduces the overhead of establishing and closing connections by reusing a pool of established connections. - It is recommended to set the maximum connections lower than 10 per CPU core, with a maximum of 20 per CPU core as the limit.
Search