guss - criteo meetup scale sql for the web
TRANSCRIPT
![Page 1: GUSS - CRITEO Meetup Scale SQL for the Web](https://reader035.vdocuments.net/reader035/viewer/2022062523/589a95bb1a28abae648b60a1/html5/thumbnails/1.jpg)
Copyright © 2014 Criteo
Scale SQL for the Web
Equipe base de donnéesCriteo
![Page 2: GUSS - CRITEO Meetup Scale SQL for the Web](https://reader035.vdocuments.net/reader035/viewer/2022062523/589a95bb1a28abae648b60a1/html5/thumbnails/2.jpg)
La communauté Data & BI MicrosoftWebcasts, Conférences, Afterworks
http://GUSS.pro
Meet-A-DBA
@GUSS_FRANCE
/GUSS
/GUSS.F
R
#MeetADBA
![Page 3: GUSS - CRITEO Meetup Scale SQL for the Web](https://reader035.vdocuments.net/reader035/viewer/2022062523/589a95bb1a28abae648b60a1/html5/thumbnails/3.jpg)
Copyright © 2016 Criteo
Agenda
1. L’organisation de l’équipe DBA2. La gestion de l’infrastructure3. Notre implémentation de la réplication SQL4. Le déploiement du code SQL en production (Intégration continue)
![Page 4: GUSS - CRITEO Meetup Scale SQL for the Web](https://reader035.vdocuments.net/reader035/viewer/2022062523/589a95bb1a28abae648b60a1/html5/thumbnails/4.jpg)
Copyright © 2016 Criteo
Organisation
Sébastien ROBLINSenior DBA
Klébert HODINSenior DBA/scrum
master
Gregory BOGEDBA
Paulo ANTUNESDBA
Nadir DJADIDBA
L’équipe – PRM – Réplication – Déploiement
![Page 5: GUSS - CRITEO Meetup Scale SQL for the Web](https://reader035.vdocuments.net/reader035/viewer/2022062523/589a95bb1a28abae648b60a1/html5/thumbnails/5.jpg)
Copyright © 2016 Criteo
Organisation
Missions• MCO• Intégration continue• Etudes et architecture• Industrialisation• Plateformes de développement et de pré-production
Environnement • SQL Server 2014• Always-On, Réplication transactionnelle
L’équipe – PRM – Réplication – Déploiement
![Page 6: GUSS - CRITEO Meetup Scale SQL for the Web](https://reader035.vdocuments.net/reader035/viewer/2022062523/589a95bb1a28abae648b60a1/html5/thumbnails/6.jpg)
Copyright © 2016 Criteo
Organisation
KanbanMCO
Demandes ponctuelles
ScrumOKR
Projets
L’équipe – PRM – Réplication – Déploiement
![Page 7: GUSS - CRITEO Meetup Scale SQL for the Web](https://reader035.vdocuments.net/reader035/viewer/2022062523/589a95bb1a28abae648b60a1/html5/thumbnails/7.jpg)
Copyright © 2016 Criteo
En chiffres
800 bases de données 100 serveurs
6000 clients applicatifs135K transactions utilisateurs moyennes
160-260K connexions permanentes26 milliards batch requests / jour
1 mois de traffic du site StackOverFlowhttps://twitter.com/Nick_Craver/status/585035281776177152
L’équipe – PRM – Réplication – Déploiement
![Page 8: GUSS - CRITEO Meetup Scale SQL for the Web](https://reader035.vdocuments.net/reader035/viewer/2022062523/589a95bb1a28abae648b60a1/html5/thumbnails/8.jpg)
Copyright © 2016 Criteo
Réplication
Publisher
Subscribers
Subscribers
Subscribers
Subscribers
Subscribers
• 750 abonnements• 7 secondes de latence max.
L’équipe – PRM – Réplication – Déploiement
![Page 9: GUSS - CRITEO Meetup Scale SQL for the Web](https://reader035.vdocuments.net/reader035/viewer/2022062523/589a95bb1a28abae648b60a1/html5/thumbnails/9.jpg)
Copyright © 2016 Criteo
Platform Resource Manager
Etablit la liaison entre les ressources applicatives et les matériels
Principes Stockage des caractéristiques serveurs/applications Gère les métadonnées des applications Facilite l’administration par lots Ouvre la gestion de l’architecture au code
L’équipe – PRM – Réplication – Déploiement
![Page 10: GUSS - CRITEO Meetup Scale SQL for the Web](https://reader035.vdocuments.net/reader035/viewer/2022062523/589a95bb1a28abae648b60a1/html5/thumbnails/10.jpg)
Copyright © 2016 Criteo
Platform Resource Manager
L’équipe – PRM – Réplication – Déploiement
Serveurs
Ressources(Applications…)
Metadata(clefs/valeurs)
Plateforme
Site B
Serveurs
Ressources(Applications…)
Metadata(clefs/valeurs)
Site A
Intra site
Liens inter sites
Liens inter plateforme
Intra site
![Page 11: GUSS - CRITEO Meetup Scale SQL for the Web](https://reader035.vdocuments.net/reader035/viewer/2022062523/589a95bb1a28abae648b60a1/html5/thumbnails/11.jpg)
Copyright © 2016 Criteo
Platform Resource Manager
• Implémentation pour SQL server:
Liens serveurs/ressource (Database [XXX]):• Définit un dictionnaire de connexions (15 min) pour les lectures/écritures • Géo-localise une ressource de base de données (règles: plateformes, sites, serveurs)
Utilisation des métadonnées:• Définit un mode de répartition de la charge • Indique l’ensemble des paramètres de backup des dbs (fréquence, serveur de fichier, transfert
distant, durée de rétention...) par plateforme/site• Stocke tous les paramètres environnementaux (smtp, ..)
L’équipe – PRM – Réplication – Déploiement
![Page 12: GUSS - CRITEO Meetup Scale SQL for the Web](https://reader035.vdocuments.net/reader035/viewer/2022062523/589a95bb1a28abae648b60a1/html5/thumbnails/12.jpg)
Copyright © 2016 Criteo
Platform Resource Manager
L’équipe – PRM – Réplication – Déploiement
![Page 13: GUSS - CRITEO Meetup Scale SQL for the Web](https://reader035.vdocuments.net/reader035/viewer/2022062523/589a95bb1a28abae648b60a1/html5/thumbnails/13.jpg)
Copyright © 2016 Criteo
Platform Resource Manager
L’équipe – PRM – Réplication – Déploiement
Exemple: Définition de la rétention des backups
![Page 14: GUSS - CRITEO Meetup Scale SQL for the Web](https://reader035.vdocuments.net/reader035/viewer/2022062523/589a95bb1a28abae648b60a1/html5/thumbnails/14.jpg)
Copyright © 2016 Criteo
Platform Resource Manager
L’équipe – PRM – Réplication – Déploiement
Implémentation: Code Sql• Affectation d’un nouveau pool de serveurs (Chef) à un service de base de données pour supporter
une charge temporaire, ou continue.• Maintenance d’une base de données ou d’un serveur (entrée/sortie commandée par script)
![Page 15: GUSS - CRITEO Meetup Scale SQL for the Web](https://reader035.vdocuments.net/reader035/viewer/2022062523/589a95bb1a28abae648b60a1/html5/thumbnails/15.jpg)
Copyright © 2016 Criteo
Platform Resource Manager
L’équipe – PRM – Réplication – Déploiement
Implémentation: API Http• API: prod_getdatabaselastbackup : obtenir l’emplacement d’un backup pour un autre service (Finance)
distant
![Page 16: GUSS - CRITEO Meetup Scale SQL for the Web](https://reader035.vdocuments.net/reader035/viewer/2022062523/589a95bb1a28abae648b60a1/html5/thumbnails/16.jpg)
Copyright © 2016 Criteo
Platform Resource Manager
L’équipe – PRM – Réplication – Déploiement
Implémentation: PowerShell• Module powershell pour tester le cycle de vie d’un serveur
![Page 17: GUSS - CRITEO Meetup Scale SQL for the Web](https://reader035.vdocuments.net/reader035/viewer/2022062523/589a95bb1a28abae648b60a1/html5/thumbnails/17.jpg)
Copyright © 2016 Criteo
Platform Resource Manager
L’équipe – PRM – Réplication – Déploiement
Implémentation: divers• Environnement de pré-production et développement
![Page 18: GUSS - CRITEO Meetup Scale SQL for the Web](https://reader035.vdocuments.net/reader035/viewer/2022062523/589a95bb1a28abae648b60a1/html5/thumbnails/18.jpg)
Copyright © 2016 Criteo
• Disposer de bases de données en local sur chaque datacenter• Scale-out des lectures • Solution haute disponibilité au sein des datacenters
Pourquoi la réplication ?
L’équipe – PRM – Réplication – Déploiement
SubscribersPublisher
Datacenter
![Page 19: GUSS - CRITEO Meetup Scale SQL for the Web](https://reader035.vdocuments.net/reader035/viewer/2022062523/589a95bb1a28abae648b60a1/html5/thumbnails/19.jpg)
Copyright © 2016 Criteo
Notre implémentation de la réplication SQL
• Réplication transactionnelle unidirectionnelle
• Même schéma de base de données entre éditeur et abonnés
• Distributeurs dédiés
• Utilisation du mode « Pull »
• Utilisation conjointe à AlwaysOn (publisher, distributeur *, abonné)
L’équipe – PRM – Réplication – Déploiement
![Page 20: GUSS - CRITEO Meetup Scale SQL for the Web](https://reader035.vdocuments.net/reader035/viewer/2022062523/589a95bb1a28abae648b60a1/html5/thumbnails/20.jpg)
Copyright © 2016 Criteo
• 25 publications
• 2600 articles publiés (tables, vues, procédures stockées, fonctions)
• 1 To de données publiées
• 9 bases de distribution
• 750 souscriptions
En quelques chiffres …
L’équipe – PRM – Réplication – Déploiement
![Page 21: GUSS - CRITEO Meetup Scale SQL for the Web](https://reader035.vdocuments.net/reader035/viewer/2022062523/589a95bb1a28abae648b60a1/html5/thumbnails/21.jpg)
Copyright © 2016 Criteo
Opérations d’exploitation :
• Initialisation de la réplication par backup
• Développement d’un framework pour la gestion de la réplication.
• Utilisation du versionning pour sauvegarder la réplication
• Gestions des opérations via le PRM
Contraintes :
• Latence réseau
• Contention sur les bases de distributions
Plus dans le détail
L’équipe – PRM – Réplication – Déploiement
![Page 22: GUSS - CRITEO Meetup Scale SQL for the Web](https://reader035.vdocuments.net/reader035/viewer/2022062523/589a95bb1a28abae648b60a1/html5/thumbnails/22.jpg)
Copyright © 2016 Criteo
• Alertes par mail en cas d’erreur sur les agents de réplication
• Utilisation de Graphite pour la métrologie
• Utilisation de Centreon pour le monitoring• Retard de la distribution• Taille des base de données de distribution
• Documentation et outils de diagnostic
Monitoring de la réplication
L’équipe – PRM – Réplication – Déploiement
![Page 23: GUSS - CRITEO Meetup Scale SQL for the Web](https://reader035.vdocuments.net/reader035/viewer/2022062523/589a95bb1a28abae648b60a1/html5/thumbnails/23.jpg)
Copyright © 2016 Criteo
Intégration continue
Notre environnement• 350 développeurs • 5 DBA• Tout le code SQL est validé par les DBA• 16 073 modifications en 2015• 2 releases SQL par semaine
L’équipe – PRM – Réplication – Déploiement
![Page 24: GUSS - CRITEO Meetup Scale SQL for the Web](https://reader035.vdocuments.net/reader035/viewer/2022062523/589a95bb1a28abae648b60a1/html5/thumbnails/24.jpg)
Copyright © 2016 Criteo
Intégration continue
L'intégration continue est un ensemble de pratiques utilisées en génie logiciel consistant à vérifier à chaque modification de code source que le résultat des modifications ne produit pas de régression dans l'application développée.
L’équipe – PRM – Réplication – Déploiement
![Page 25: GUSS - CRITEO Meetup Scale SQL for the Web](https://reader035.vdocuments.net/reader035/viewer/2022062523/589a95bb1a28abae648b60a1/html5/thumbnails/25.jpg)
Copyright © 2016 Criteo
Intégration continue – Comment ?
L’équipe – PRM – Réplication – Déploiement
GitVisual Studio Gerrit Jenkins Powershell
![Page 26: GUSS - CRITEO Meetup Scale SQL for the Web](https://reader035.vdocuments.net/reader035/viewer/2022062523/589a95bb1a28abae648b60a1/html5/thumbnails/26.jpg)
Copyright © 2016 Criteo
Intégration continue – Comment ?
L’équipe – PRM – Réplication – Déploiement
![Page 27: GUSS - CRITEO Meetup Scale SQL for the Web](https://reader035.vdocuments.net/reader035/viewer/2022062523/589a95bb1a28abae648b60a1/html5/thumbnails/27.jpg)
Copyright © 2016 Criteo
QA bot• Build• Déploiement
Steven SQL bot
Intégration continue – Comment ?
L’équipe – PRM – Réplication – Déploiement
![Page 28: GUSS - CRITEO Meetup Scale SQL for the Web](https://reader035.vdocuments.net/reader035/viewer/2022062523/589a95bb1a28abae648b60a1/html5/thumbnails/28.jpg)
Copyright © 2016 Criteo
Intégration continue – Comment ?
L’équipe – PRM – Réplication – Déploiement
![Page 29: GUSS - CRITEO Meetup Scale SQL for the Web](https://reader035.vdocuments.net/reader035/viewer/2022062523/589a95bb1a28abae648b60a1/html5/thumbnails/29.jpg)
Copyright © 2016 Criteo
Intégration continue – Comment ?
L’équipe – PRM – Réplication – Déploiement
Validation
MOAB
![Page 30: GUSS - CRITEO Meetup Scale SQL for the Web](https://reader035.vdocuments.net/reader035/viewer/2022062523/589a95bb1a28abae648b60a1/html5/thumbnails/30.jpg)
Copyright © 2016 Criteo
Intégration continue – Comment ?
L’équipe – PRM – Réplication – Déploiement
Sandbox• Déploiements• Tests
Pré-production• Déploiement
Release
![Page 31: GUSS - CRITEO Meetup Scale SQL for the Web](https://reader035.vdocuments.net/reader035/viewer/2022062523/589a95bb1a28abae648b60a1/html5/thumbnails/31.jpg)
Copyright © 2016 Criteo
Intégration continue – Challenges
Connaissance des données• NULL à NOT NULL
Gestion de la réplication• Objets répliqués• Les indexes
Gestion du changement• Clean_db
L’équipe – PRM – Réplication – Déploiement
![Page 32: GUSS - CRITEO Meetup Scale SQL for the Web](https://reader035.vdocuments.net/reader035/viewer/2022062523/589a95bb1a28abae648b60a1/html5/thumbnails/32.jpg)
Copyright © 2016 Criteo
Intégration continue – Challenges
Attention au code existant• Gérer les références de projets• Déploiement sélectif
Build• Warning ?
L’équipe – PRM – Réplication – Déploiement
![Page 33: GUSS - CRITEO Meetup Scale SQL for the Web](https://reader035.vdocuments.net/reader035/viewer/2022062523/589a95bb1a28abae648b60a1/html5/thumbnails/33.jpg)
Copyright © 2016 Criteo
Questions ?
![Page 34: GUSS - CRITEO Meetup Scale SQL for the Web](https://reader035.vdocuments.net/reader035/viewer/2022062523/589a95bb1a28abae648b60a1/html5/thumbnails/34.jpg)
Copyright © 2016 Criteo
Merci !