Modèle de données
Base de données & ERD
Un modèle de données normalisé, réparti sur des bases PostgreSQL par domaine (database-per-service), avec réplication et sauvegarde continue.
Diagramme entité-relation (extrait)
erDiagram
PERSONNE ||--o{ PV : "mise en cause"
PERSONNE ||--o{ DETENU : "devient"
PERSONNE ||--|| BIOMETRIE : "possède"
VEHICULE ||--o{ PV : "concerné"
PV ||--|| DOSSIER_JUDICIAIRE : "génère"
DOSSIER_JUDICIAIRE ||--o{ DECISION : "reçoit"
DECISION ||--o| MANDAT : "produit"
MANDAT ||--|| DETENU : "écroue"
DETENU ||--|| CELLULE : "occupe"
CELLULE }o--|| PRISON : "appartient à"
UTILISATEUR ||--o{ ROLE : "assume"
UTILISATEUR ||--o{ LOG : "génère"
DOCUMENT }o--|| DOSSIER_JUDICIAIRE : "attaché à"
PERSONNE { uuid id PK string cni string nom string prenom date naissance }
PV { uuid id PK uuid agent_id uuid personne_id string infraction timestamp date }
DOSSIER_JUDICIAIRE { uuid id PK uuid pv_id string statut uuid parquet_id }
DECISION { uuid id PK uuid dossier_id string type text motivation date rendue_le }
DETENU { uuid id PK uuid personne_id string numero_ecrou date entree }
CELLULE { uuid id PK string code int capacite uuid prison_id }
PRISON { uuid id PK string nom string ville int capacite_totale }
UTILISATEUR { uuid id PK string email string hash_pwd boolean mfa }
ROLE { uuid id PK string nom jsonb permissions }
LOG { uuid id PK uuid user_id string action timestamp ts jsonb payload }
BIOMETRIE { uuid id PK bytea empreintes bytea faciale }
DOCUMENT { uuid id PK string url string hash string type }
Tables principales
| Table | Cardinalité estimée | Base | Rétention |
|---|---|---|---|
| personnes | 40 M | PostgreSQL | Illimitée |
| vehicules | 3 M | PostgreSQL | Illimitée |
| pv | 2 M / an | PostgreSQL + archive | 30 ans |
| dossiers_judiciaires | 1,5 M / an | PostgreSQL | Illimitée |
| decisions | 1,2 M / an | PostgreSQL | Illimitée |
| detenus | 15 k actifs | PostgreSQL | Historique 50 ans |
| cellules | 5 000 | PostgreSQL | — |
| prisons | 45 | PostgreSQL | — |
| utilisateurs | 25 000 | PostgreSQL | — |
| roles | ~80 | PostgreSQL | — |
| logs | 500 M / an | Elasticsearch | 10 ans WORM |
| documents | 50 M | MinIO / S3 | Selon type |
| biometrie | 40 M | Base AFIS dédiée | Illimitée |
Politique de sauvegarde
Continu
WAL streaming PostgreSQL toutes les 30 secondes.
Quotidien
Snapshot complet chiffré, conservé 30 jours.
Archivage
Bandes LTO hors-site, conservation 30 ans.