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
TableCardinalité estiméeBaseRétention
personnes40 MPostgreSQLIllimitée
vehicules3 MPostgreSQLIllimitée
pv2 M / anPostgreSQL + archive30 ans
dossiers_judiciaires1,5 M / anPostgreSQLIllimitée
decisions1,2 M / anPostgreSQLIllimitée
detenus15 k actifsPostgreSQLHistorique 50 ans
cellules5 000PostgreSQL
prisons45PostgreSQL
utilisateurs25 000PostgreSQL
roles~80PostgreSQL
logs500 M / anElasticsearch10 ans WORM
documents50 MMinIO / S3Selon type
biometrie40 MBase AFIS dédiéeIllimité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.