Skip to content

Latest commit

 

History

History
30 lines (20 loc) · 2.21 KB

rds.md

File metadata and controls

30 lines (20 loc) · 2.21 KB

Setting up a Shared Database

Many production websites will use a dedicated server for the database. This allows us to:

  1. Scale the web tier independently
  2. Use hardware and OS optimizations to support the different responsibilities of each server type. For instance we might want to use faster and more expensive hard drives on the database to speed up database I/O.
  3. Restrict direct access to the database. A web developer will likely need superuser permissions to troubleshoot a web server, but may not need that same level of access at the database. Since the database often has sensitive information we may want to limit liability.

While you can run and administer a dedicated database server on EC2, the AWS RDS service provides a simple way to add a shared database without getting deep into the specifics of configuration and data maintenance.

With the Saleor instance only serving web requests we should see a performance improvement if our bottleneck was database CPU or memory sharing.

Note: Launching RDS will raise your costs for the workshop. Remember to tear everything down!

Basic Outline

  1. Launch RDS with postgres docs
  2. Create and configure security groups so the saleor web node can reach RDS docs.5432 is the port normally used to talk to postgres. The RDS security group will need to be configured to allow web nodes to connect.
  3. Copy the current data from from the Saleor EC2 instance of postgres to RDS. pg_dump allows us to make a backup that the psql client can restore.
  4. Point Saleor at the new RDS location. Modify the setting.py file. docs
  5. Restart uwsgi
  6. Verify saleor is running correctly with the new database
  7. Does the site come up?
  8. Are the products displayed correctly?
  9. Repeat your loadtest passing the ALB DNS name(using the --host) switch.
  10. Estabilish a new baseline.