# 4. Best Practices

In this chapter, we present some of the best ways to use Apache CouchDB. These usage patterns reflect many years of real-world use. We hope that these will jump-start your next project, or improve the performance of your current system.

- 4.1. Document Design Considerations
  - 4.1.1. Don’t rely on CouchDB’s auto-UUID generation
  - 4.1.2. Alternatives to auto-incrementing sequences
  - 4.1.3. Pre-aggregating your data
  - 4.1.4. Designing an application to work with replication
  - 4.1.5. Adding client-side security with a translucent database
- 4.2. Document submission using HTML Forms
  - 4.2.1. The HTML form
  - 4.2.2. The update function
  - 4.2.3. Example output
- 4.3. Using an ISO Formatted Date for Document IDs
- 4.4. JavaScript development tips
- 4.5. View recommendations
  - 4.5.1. Deploying a view change in a live environment
- 4.6. Reverse Proxies
  - 4.6.1. Reverse proxying with HAProxy
  - 4.6.2. Reverse proxying with nginx
  - 4.6.3. Reverse Proxying with Caddy
  - 4.6.4. Reverse Proxying with Apache HTTP Server