# GDPR Compliance and Data Archiving Strategy **Status**: accepted The application manages sensitive tenant files (identity cards, tax notices, payslips) and property condition photos. To comply with GDPR requirements and maintain a sustainable disk storage footprint over time, we have established a strict retention and image optimization policy. ## Decisions ### 1. Automated Server-Side Image Optimization All uploaded photos (for property condition reports) are compressed and resized on the backend before write: - Target resolution: maximum 1920x1080 pixels. - Format: converted to WebP. - Compression quality factor: 75-80%. This reduces average photo size from ~6.0 MB (raw smartphone camera) to ~250 KB (95.8% reduction). ### 2. GDPR Retention and Purging Cycle - **Rejected Applicants**: Complete deletion of all submitted documents (payslips, identity documents) exactly 30 days after rejection. - **Archived Leases**: - Upon lease termination, the lease transitions to an `Archived` state. - Personal identity documents and income proofs of the former tenants are permanently purged 3 years after lease termination (matching the 3-year French statute of limitations for residential tenancy disputes). - General inspection photos are purged 5 years after lease termination. - Basic accounting records (rent ledger, invoice amounts) are retained for 10 years to comply with commercial and tax record retention laws (Article L123-22 of the French Commercial Code). --- ## Storage Projections (3-Apartment Portfolio over 10 Years) Assuming an average lease turnover rate of 2 years (i.e., 1.5 lease cycles per year across a 3-apartment portfolio). ### Unit Data Footprints | Data Type | Unoptimized Size | Optimized Size | Purge Trigger | | :----------------------------- | :---------------------- | :---------------------- | :----------------------------- | | **MongoDB Text Records** | ~10 KB / year | ~10 KB / year | Never (10-year archive) | | **Tenant Personal Dossier** | ~5.0 MB (PDF/Images) | ~5.0 MB | Purged 3 years after lease end | | **Inspection Photos (In/Out)** | ~360 MB (60 raw photos) | ~15 MB (WebP 1080p) | Purged 5 years after lease end | | **Invoices & Receipts / year** | ~20 MB (Raw scans) | ~5 MB (Compressed PDFs) | Never (10-year archive) | ### 10-Year Cumulative Footprint Comparison #### Scenario A: Unoptimized & No Purge (Default Strategy) - **Year 1**: 3 * (22 MB tenant docs + 360 MB photos) + 67 MB operational files = **1,213 MB (~1.2 GB)**. - **Yearly Growth**: 67 MB (ops) + 1.5 * (22 MB tenant docs + 720 MB in/out photos) = **1,180 MB / year**. - **Year 10 Cumulative Footprint**: **~11.8 GB** (Continuous, compounding growth). #### Scenario B: Optimized & Purged (Our Design) - **Year 1**: 3 * (5 MB tenant docs + 15 MB photos) + 15 MB operational files = **75 MB**. - **Yearly Growth (Before Purges)**: 15 MB (ops) + 1.5 * (5 MB tenant docs + 30 MB in/out photos) = **67.5 MB / year**. - **Purging Offsets**: - _From Year 4 onwards_: Purge of tenant dossiers of expired leases saves **7.5 MB / year** (1.5 leases * 5 MB). - _From Year 6 onwards_: Purge of inspection photos of expired leases saves **45.0 MB / year** (1.5 leases * 30 MB). - **Year 10 Cumulative Footprint**: **~345 MB** (Stabilizes and plates out around 350 MB due to continuous purges). This architecture saves over **97% of server disk space** over a 10-year lifecycle compared to a naive storage strategy, while strictly respecting French GDPR constraints.