Couchbase Server uses an append-only storage design that prevents data corruption by writing updates only to the end of data and index files, necessitating a compaction process to manage disk space. Compaction in Couchbase cleans up disk space by removing stale data and index values, ensuring files do not consume excessive disk capacity, especially in write-heavy environments. Data is organized into vBuckets with each partition having its own data file, and index files structured as b-trees where mutations are appended at the end. Compaction can be configured to trigger based on fragmentation thresholds, and can be scheduled during off-peak hours to minimize system impact. It operates on a per-partition basis, allowing for incremental compaction without data loss, and can be done manually or automatically. Proper cluster sizing and storage selection, such as using SSDs for write-heavy applications, are crucial for optimal compaction performance. Parallel compaction can also be enabled, provided index and data files are stored on separate physical disks to prevent excessive growth.