1 of 74

Explorer, documenter et faire évoluer ses bases de données avec Azimutt

Loïc Knuchel

15 jan. 2025

@loicknuchel

2 of 74

Loïc Knuchel

@loicknuchel

@azimuttapp

Créateur de

3 of 74

Pourquoi Azimutt?

Mieux comprendre et travailler

avec les base de données

à l’échelle

Loïc Knuchel - @loicknuchel @azimuttapp - https://azimutt.app

4 of 74

Comprendre une requête complexe

(SELECT p.id, 'Internal' AS kind, p.title, p.duration, p.description, p.tags, p.slides, p.video, null AS url

, json_agg(json_build_object('id', u.id, 'slug', u.slug)) AS speakers

, t.id AS talk_id, t.status AS talk_status

, c.id AS cfp_id, c.name AS cfp_name

, e.id AS event_id, e.kind AS event_kind, e.name AS event_name, e.start AS event_start

, g.id AS group_id, g.name AS group_name

, array_agg(r.grade) FILTER (WHERE r.grade IS NOT NULL) AS ratings

, count(co.id) AS nb_comments

FROM proposals p

CROSS JOIN LATERAL unnest(string_to_array(p.speakers, ',')) speaker_id

JOIN users u ON speaker_id = u.id

JOIN talks t ON p.talk_id = t.id

JOIN cfps c ON p.cfp_id = c.id

LEFT JOIN events e ON p.event_id = e.id

LEFT JOIN groups g ON c.group_id = g.id

LEFT JOIN proposal_ratings r ON p.id = r.proposal_id

LEFT JOIN comments co ON p.id = co.proposal_id

WHERE p.status = 'Accepted' AND '8a4ed953-1b25-4c18-8d48-7dd33d48bea1' = ANY (string_to_array(p.speakers, ','))

GROUP BY p.id, t.id, c.id, e.id, g.id)

UNION ALL

(SELECT p.id, 'External' AS kind, p.title, p.duration, p.description, p.tags, p.slides, p.video, p.url

, json_agg(json_build_object('id', u.id, 'slug', u.slug)) AS speakers

, t.id AS talk_id, t.status AS talk_status

, null AS cfp_id, null AS cfp_name

, e.id AS event_id, e.kind AS event_kind, e.name AS event_name, e.start AS event_start

, null AS group_id, null AS group_name

, null AS ratings

, 0 AS nb_comments

FROM external_proposals p

CROSS JOIN LATERAL unnest(string_to_array(p.speakers, ',')) speaker_id

JOIN users u ON speaker_id = u.id

JOIN talks t ON p.talk_id = t.id

JOIN external_events e ON p.event_id = e.id

WHERE p.status = 'Accepted' AND '8a4ed953-1b25-4c18-8d48-7dd33d48bea1' = ANY (string_to_array(p.speakers, ','))

GROUP BY p.id, t.id, e.id)

ORDER BY event_start DESC;

Loïc Knuchel - @loicknuchel @azimuttapp - https://azimutt.app

5 of 74

Loïc Knuchel - @loicknuchel @azimuttapp - https://azimutt.app

6 of 74

Loïc Knuchel - @loicknuchel @azimuttapp - https://azimutt.app

7 of 74

Loïc Knuchel - @loicknuchel @azimuttapp - https://azimutt.app

8 of 74

9 of 74

10 of 74

11 of 74

12 of 74

13 of 74

14 of 74

SELECT ...

FROM proposals

JOIN users ON ...

JOIN talks ON ...

JOIN cfps ON ...

JOIN events ON ...

JOIN groups ON ...

JOIN proposal_ratings ON ...

JOIN comments ON ...

UNION ALL

SELECT ...

FROM external_proposals

JOIN users ON ...

JOIN talks ON ...

JOIN external_events ON ...

15 of 74

Accès instantané

aux indexes

et contraintes

16 of 74

Contraintes et statistiques

de la colonnes

17 of 74

Explorer sa base de données

Loïc Knuchel - @loicknuchel @azimuttapp - https://azimutt.app

18 of 74

19 of 74

20 of 74

21 of 74

Il manque quelques tables…

22 of 74

23 of 74

24 of 74

25 of 74

26 of 74

27 of 74

28 of 74

Documentation

Loïc Knuchel - @loicknuchel @azimuttapp - https://azimutt.app

29 of 74

30 of 74

31 of 74

32 of 74

33 of 74

34 of 74

35 of 74

Explorer ses données

Loïc Knuchel - @loicknuchel @azimuttapp - https://azimutt.app

36 of 74

37 of 74

38 of 74

39 of 74

40 of 74

41 of 74

42 of 74

Requêtes IA

Loïc Knuchel - @loicknuchel @azimuttapp - https://azimutt.app

43 of 74

44 of 74

45 of 74

46 of 74

47 of 74

48 of 74

49 of 74

50 of 74

Base de données multiples

Loïc Knuchel - @loicknuchel @azimuttapp - https://azimutt.app

51 of 74

Inventory

Source

Catalog

Source

Shopping

Source

Initial

layout

Buyer

layout

Provider

layout

Azimutt

model

52 of 74

53 of 74

54 of 74

55 of 74

56 of 74

57 of 74

Database design

Loïc Knuchel - @loicknuchel @azimuttapp - https://azimutt.app

58 of 74

Loïc Knuchel - @loicknuchel @azimuttapp - https://azimutt.app

59 of 74

60 of 74

61 of 74

62 of 74

63 of 74

64 of 74

Analyse de base de données

Loïc Knuchel - @loicknuchel @azimuttapp - https://azimutt.app

65 of 74

66 of 74

67 of 74

  • Schéma
    • Table sans clé primaire
    • Index dupliqué
    • Relation manquante
    • Relation avec des types différents
    • Colonne avec un mauvais type de donnée
    • Conventions de nommage
  • Snapshot
    • Index trop lourd
    • Table/Index non utilisé, colonne vide
    • Analyze/Vacuum vieux, trop de dead rows
    • Requête trop lente, coûteuse ou avec un écart type élevé
  • Trend
    • Table/Index qui grossit vite
    • Requête qui se dégrade

27 règles métier, 30 de plus prévues, + l’ajout d’extension

68 of 74

Comment je me suis lancé sur Azimutt?

Loïc Knuchel - @loicknuchel @azimuttapp - https://azimutt.app

69 of 74

❤️

2020

70 of 74

71 of 74

Après 4 ans d’utilisation

Utilisé par des:

  • développeurs
  • data analysts
  • product managers
  • équipes support…

80 personnes par mois utilisent Azimutt

(20% de la tech)

Usages:

  • Doctolib academy
  • documentation de projets
  • identification de ownership (bugs)
  • design de datamart

Loïc Knuchel - @loicknuchel @azimuttapp - https://azimutt.app

72 of 74

Bien démarrer avec Azimutt

  • Meilleurs cas d’usage
    • Comprendre une base de données complexe
    • Consolider les connaissances de l’entreprise sur ses données

  • Recommandations
    • Chaque équipe fait un layout (à minima) sur son scope
    • Définir un template de notes pour les tables et colonnes

Loïc Knuchel - @loicknuchel @azimuttapp - https://azimutt.app

73 of 74

Bientôt: Azimutt plateforme 🚀

Objectif: anticiper les incidents de production

  • Diagnostic continu de PostgreSQL (pour commencer)
    • Léger, configurable et sécurisé
    • Agrégation de clusters
    • Métriques, procédures et actions métier
    • Agents IA pour l’identification et recommandation de résolutions

Recherche

design partners

Loïc Knuchel - @loicknuchel @azimuttapp - https://azimutt.app

74 of 74

Merci ❤️