420 likes | 521 Views
Projet “Velocity” le cache mémoire distribué. Yves Chtepenko Architecte de solution Cambridge Technology Partners. Premium Partner. Budapest 40 Consultants. India 4000+ Consultants. Zurich 40 Employees. Nyon 170 Employees. Mission
E N D
Projet “Velocity” le cache mémoiredistribué Yves Chtepenko Architecte de solution Cambridge Technology Partners
Budapest 40 Consultants India 4000+ Consultants Zurich 40 Employees Nyon 170 Employees Mission To deliver high Business value through Innovative IT and Management Consulting solutions and services. Customer-Centric Built on a unique combination of client partnerships, leadership, technology expertise, partnership, and people to lead today's companies. Strong local presence Established in Switzerland since 1996 with more than 210 employees in Geneva and Zurich with a Global Delivery Center in Budapest and a strategic partnership in India. Microsoft Gold Partner One of the oldest and most active Microsoft Partners in Switzerland. Visit our Multi-touch Mobile Collaboration Platform !!!
Agenda • Etat des lieux • Présentation du projet « Velocity » • Velocity en action • Démo • Futures évolutions • Questions & Réponses
Le projet «Velocity» Etat des lieux
Le cache dans les applications • Accès rapide aux données de références • Local à chaque instance de l’application • Evolution des architectures • Software as Service, multi-tiers • Sources de données multiples: db, web service • Agrégation des données • Amélioration des performances
Le projet «Velocity» Présentation
Qu’est ce que Velocity? • C’est un cache mémoire distribué pour les applications, pour tout type d’objet: objet de la CLR, XML ou objets binaires. • Velocity permet de «fusionner» la mémoire des machines et d’en proposer une vue unifiée pour les clients du service. Vueunifiée du cache
Scenarios d’utilisation • Données de référence • Accès en lecture seule par un grand nombre • Données d’activité • Lecture et écriture par un seul processus • Ressources • Accès en lecture partagé, écriture exclusive
Caractéristiques principales • Performance • Haute disponibilité • Adaptation à la charge • Répartition de charge automatique • Intégration avec ASP.NET • Installé en tant que service ou embarqué. • Outils d’administration et de surveillance
Quelle est sa place? Clients Application / Web Tier … Application Application Velocity ClientLocal Cache Velocity ClientLocal Cache Application Velocity ClientLocal Cache Cache Tier Velocity Service Velocity Service Velocity Service Server 2 Server 1 Server 3 Server Side Callbacks Data Tier Database Cloud
Déploiement Utilisateurs Assemblies Application / Web Tier … Client Velocity Client Velocity Client Velocity Setup Cache Server Tier Server 3 Server 2 Server 1 Monitoring Velocity Service Velocity Service Velocity Service K1, v1 Routing table Le premier installé devient le nœud maître paramètres de Configuration polices de cache Globales informations de partions (Base de données, fichier xml)
Structure logique Velocity Service Velocity Service Velocity Service Velocity Service Cache nommé: Catalogue de produits Cache nommé:Inventaire Régions Clef Objet Tags Région A 121 xxxx “Toy” “Child” 123 yyyy “Toy” “Chair”.. • Host • Processus qui héberge l’instance de Velocity. • Caches nommés • Peuvent s’étendre au travers des machines • Définis dans le fichier de configuration • Régions • Conteneurs de d’éléments du cache • Peuvent être créées explicitement ou implicitement • Eléments du cache • Clef , Objet, Tags, TTL, Timestamps, Version
La table de routage • Un sous-ensemble des informations globales de partition et de connexions aux différents nœuds • Construite et maintenue de façon incrémentale • Comme les tables DNS • Les serveurs ont une table de routage • Optionnel du côté client, elle permet d’effectuer les opérations (e.g., GET, PUT) directement sur les bons nœuds.
Le Cache Partitionné Application PUT Get(K2) Velocity Client1 Velocity Client2 Cache2 Cache3 Cache1 Routing Table Routing Table Routing Table Primaire pour K1 Primaire pour K2 Primaire pour K3 K2, V1 K2, V1 K1, V1 K3, V3
Table de routage côté client Application PUT Get(K2) Velocity Client1 Velocity Client2 Routing Table Routing Table Cache2 Cache3 Cache1 Routing Table Routing Table Routing Table Primaire pour K1 Primaire pour K2 Primaire pour K3 K2, V1 K2, V1 K1, V1 K3, V3
Le Cache distribué Application PUT Get(K2) Velocity Client1 Velocity Client2 Cache2 Cache3 Cache1 K2, V1 K2, V1 K2, V1 K2, V1
Local Cache • Le cache local accélère l’accès au cache. • Il utilise le mécanisme de notification pour se rafraichir lorsque les éléments du cache changent. Get(K2) Put(K2, V1) Get(K2) Velocity Client Velocity Client Cache Local Cache Local Routing Table Routing Table Routing Table Cache2 Cache3 Cache1 Routing Table Routing Table Routing Table K2, V1 K2, V1 Primaire pour K1 Primaire pour K3 Primaire pour K2 K1, V1 K3, V3
Adaptation à la charge Serveur Maître Velocity Service Velocity Service Velocity Service Velocity Service Velocity Service Velocity Service Velocity Service Velocity Service • Limité à 10 si fichier de configuration XML • Nombre de nœuds quasiment illimité si configuration dans une base de donnée
Haute Disponibilité Application PUT Get(K2) • Mets l’opération dans la file d’exécution • Exécute l’opération localement • Propage l’opération sur les nœuds secondaires • Attends pour obtenir le quorum • rends le contrôle Velocity Client1 Velocity Client Routing Table Routing Table Cache1 Cache2 Cache3 Primaire pour (K1,V1) Primaire pour (K3,V3) Primaire pour(K2,V2) Replication Agent K3, V3 K1, V1 K2, V2 (K2, V2) K2, V2 K2, V2 Secondaire pour(K1,V1), (K2,V2) Secondaire pour(K1,V1), (K3,V3) Secondaire pour(K2,V2), (K3,V3) K2, V2 K1, V1 K3, V3 K1, V1 K3, V3
Failover Cache4 Le PM analyse les infos des partitions de Cache2 pour élire le primaire pour k2 Partition Manager Primaire pour (K4,V4) Choisis Cache1 comme primaire pour K2 Envoie des messages à Cache1 and Cache3 pour la reconfiguration. Met à jour le GPM Global Partition Map K4, V4 Secondary for K1, V1 Détecte le défaut de Cache 2. Notifies PM (sur Cache4) Cache1 interroge Cache2 pour savoir si il a une version plus à jour que la sienne. Cache1 se reconfigure comme cache primaire pour K2 Cache1 Cache2 Cache3 Routing Table Routing Table Routing Table Reconfiguration Agent K1, V1 Primaire pour (K2,V2) Primaire pour(K3,V3) Reconfiguration Agent K2, V2 Replication Agent Replication Agent K2, V2 Local Partition Map Local Partition Map K2, V2 Secondaire pour Secondaire pour Secondaire pour K1, V1
Le projet «Velocity» démo
Client 1 • Client 2 Accès concurrent • Mise à jour optimiste • Mise à jour pessimiste Velocity Cache K1,V1 K1,V1 K1,V2 K1,V2 Velocity Cache K1,V1 K1,V1 K1,V1 K1,V2
Le mécanisme d’éviction • Eviction sur expiration seulement • Libère les éléments expiré. • Périodique par partition • Eviction forcée • Libère les éléments expirés et non expirés en fonction de leur fréquence d’accès • Par requête • Peut être désactivé. • Eviction en fonction de la disponibilité de la mémoire • Un processus est chargé de surveillé la disponibilité de la mémoire (polling per second) et évite l’écriture sur disque • Déclenche l’éviction forcée à 85% d’utilisation de la mémoire système pour en libérer 5%.
Notification d'événement (v1) • Abonnement aux changements de données dans le cache • Appel d’un délégué sur le client quand un changement survient • Notifications au niveau objet, région et cache nommé
Sécurité (V1) • Option de désactivation de la sécurité • Option de sécurité par jeton • On assigne un jeton au niveau du cache nommé • Les applications doivent utiliser GetCache() avec ce jeton. • Option de sécurité par compte de service • Authentification d’un compte de service • Assignation d’un compte de service au niveau du cache nommé. • Sécurité au niveau du transport • Options de sécurité de WCF • E.g., Encryptions
Administration & Monitoring • Logging • Provider model; par défault ETW, dans des fichiers log. • Administration • Commandes Powershell • Démarrage and et arrêt du cluster ou service, configure caches nommées. • Statistiques du cache • Intégration à Perfmon
Déploiement – pré requis • Versions de Windows supportées • XP sp3 • Vista SP1 • Serveur 2003 • Serveur 2008 • Framework 3.5 (utilise WCF) • Windows PowerShell
Le projet «Velocity» démo
Le projet «Velocity» Post V1
Persistance • Callback for read-through, write-behind • Specified at Named Cache Level • Read-Through • Called when item not present in cache • Callback returns the object/serialized bytes • Write-Behind • Writes to cache are queued • Callback called asynchronously in batches • Re-tries upon failure
Cache embarqué • Les composants client et serveur s’execute dans le processus de l’application • Evite la sérialisation et transport • Très bonne performance, latence faible • Répartition de charge difficile • Parfait pour le cache répliqué Application Application Application PUT k2,v2 Velocity Components Velocity Components Velocity Components K2, V2 K2, V2 K2, V2 K3, V3 K3, V3 K3, V3 K1, V1 K1, V1 K1, V1
Exécution de requête LINQ from toy in catalog<Toy>() where toy.ToyPrice > 300 select toy; Velocity Client Object Manager Object Manager Object Manager Cache API Query Processor Query Processor Query Processor Federated Query Processor In-memory Data Manager In-memory Data Manager In-memory Data Manager Dispatch Manager Local Cache from toy in catalog<Toy>() where toy.ToyPrice > 300 select toy; Cache1 Cache2 Cache3 Primary Regions Primary Regions Primary Regions ToyRegion Toy3, 400 Toy2, 350 Toy4, 100 Toy1, 500
On-Premises Applications Application Application ASP.NET Application Velocity Client Velocity Client Velocity Client Velocity Cache Storage/SSDS
Velocity V1 Roadmap • CTP1 • TechEd 2008 • CTP2 • PDC 2008 • CTP3 • Mix 2009 • RTM • Mid 2009
Le projet «Velocity» Ressources
Le projet «Velocity» • Le blog de l’équipe • http://blogs.msdn.com/velocity • Des vidéos: • http://channel9.msdn.com/tags/Velocity/ • MSDN • http://msdn.microsoft.com/en-us/data/cc655792.aspx • http://msdn.microsoft.com/fr-fr/library/cc645013(en-us).aspx
Le projet «Velocity» Des Questions? Yves.Chtepenko@CTP-CONSULTING.COM
Save the date for tech·days nextyear! 14 – 15 avril 2010, CICG
Premium Sponsoring Partners Classic Sponsoring Partners