Download presentation
Presentation is loading. Please wait.
Published byGeraldine Nichols Modified over 8 years ago
2
Nicholas Goossens R&D Lead Open Box Software Session Code: WUX301
3
Setting the Scene Database Application Database Application
4
It’s a bird, it’s a plane…no its Velocity! What is Velocity? A Hashtable An explicit, distributed, in- memory application cache for all kinds of data. Fuse "memory" across machines into a unified cache Scalable Windows Service Database Application Database Application Velocity
5
Outline The Why and What? First Principles Integration Existing Application Scale Futures
6
Why Velocity? Share Data Across Applications No more sticky routing Performance Scale out by adding more boxes High Availability Protect from Server Failure Low Cost Velocity OperationThroughputLatency Read 2k30,000 / sec.6 – 1.5 ms Write 2k18,000 / sec3 ms OperationServersThroughput Read 2k130,000 / sec Read 2k258, 600 / sec Read 2k385, 500 / sec
7
What can go into Velocity? Reference Read Only Mostly static High traffic App-wide Catalog Reference Read Only Mostly static High traffic App-wide Catalog Activity Read/Write Changes heavily User-specific High-Scale Shopping Cart Activity Read/Write Changes heavily User-specific High-Scale Shopping Cart Resource Read/Write Changes heavily Application-Wide High-Scale Inventory Resource Read/Write Changes heavily Application-Wide High-Scale Inventory
8
Deployment
9
<section name="dataCacheClient" type="Microsoft.Data.Caching.DataCache ClientSection, CacheBaseLibrary"” allowLocation="true"” allowDefinition="Everywhere"/> <host name="AwesomeHost" cachePort="22233“ cacheHostName="DistributedCacheService"/> Velocity Setup Regions Region A Key Payload Tags 121 xxxx “Toy” “Child” 123 yyyy “Toy” “Chair”.. Velocity service Named cache : product catalog Named cache : electronics inventory Velocity service Application Velocity Client Application Velocity Client Application Velocity Client
10
Velocity API // Create instance of cachefactory (reads appconfig) DataCacheFactory fac = new DataCacheFactory(); // Get a named cache from the factory DataCache catalog = fac.GetCache("catalogcache"); // Simple Get/Put catalog.Put("toy-101", new Toy("Puzzle")); // From the same or a different client Toy toyObj = (Toy)catalog.Get("toy-101"); // Simple Get/Put catalog.Put("toy-101", new Toy("Puzzle")); // From the same or a different client Toy toyObj = (Toy)catalog.Get("toy-101"); // Region based Get/Put catalog.CreateRegion("toyRegion"); // Both toy and toyparts are put in the same region catalog.Put("toy-101", new Toy("Puzzle"), "toyRegion"); Catalog.Put("toypart-100", new ToyParts("Wheel"), "toyRegion"); Toy toyObj = (Toy)catalog.Get("toy-101","toyRegion"); // Region based Get/Put catalog.CreateRegion("toyRegion"); // Both toy and toyparts are put in the same region catalog.Put("toy-101", new Toy("Puzzle"), "toyRegion"); Catalog.Put("toypart-100", new ToyParts("Wheel"), "toyRegion"); Toy toyObj = (Toy)catalog.Get("toy-101","toyRegion");
11
First Principles
12
Northwind
13
Plugging in Velocity ASP.Net Pages Catalog.aspx product.aspx default.aspx ASP.Net Pages Catalog.aspx product.aspx default.aspx Business Layer CatalogService CatalogService Data Access Layer ICatalogProvider ICatalogProvider SQLProviderSQLProvider CacheLayerICatalogCacheCacheLayerICatalogCache VelocityCacheProviderVelocityCacheProvider
14
Usage Pattern: Cache Aside Application Velocity Service // If Not present in the cache if (toyObj == null) { // Read from backend.. toyObj = ReadFromDatabase(); // Populate Cache catalog.Put("toy-101", toyObj); return toyObj; } // If Not present in the cache if (toyObj == null) { // Read from backend.. toyObj = ReadFromDatabase(); // Populate Cache catalog.Put("toy-101", toyObj); return toyObj; }
15
Grocery Web Site: Integration
16
Velocity Client Local Cache Local Cache can help speed up access on clients Uses notification mechanism to refresh the cache on cache item changes Put(K2, v2) Routing Table Cache2 Cache1 Primary for K2,V2 K2, V2 Primary for K1,V1 K1, V1 Cache3 Primary for K3,V3 K3, V3 Velocity Client Local Cache Routing Table K2, V2 Get(K2)
17
Local Cache
18
Understand Data Requirements Performance Throughput Latency Consistency Can it be stale – for how long? Eviction Is the data evictable? Security Is there any secure data? Availability Should data survive node or cluster failures?
19
Data Partitioning EEDDGGIIHHFF Cache Tier App Tier EEDD GGIIHHFF AAAA BBBBCCCC
20
How Do We Partition Keys? Velocity Service Region Name Hashed into Region Id Keys Bucketized into Regions ID Ranges mapped to Nodes
21
Scale
22
High Availability Cache Tier App Tier EEDDGGIIHHFF EE DD GG IIHH FF AA AA BB BB CC CC CC II AA FF BB HH DD GG EE AA II CC DD EE GG
23
Session Cart Integration With ASP.Net … Session state stored in velocity Velocity service Load balance requests No more sticky routing Load balance requests No more sticky routing Application Velocity sessionstoreprovider Application Velocity sessionstoreprovider Application Velocity sessionstoreprovider Velocity service Scale your session store dynamically dynamically Highly available Drop in velocity sessionstoreprovider <add name="SessionStoreProvider" type=" System.Data.Caching.SessionStoreProvider, ClientLibrary" cacheName=" "/> <add name="SessionStoreProvider" type=" System.Data.Caching.SessionStoreProvider, ClientLibrary" cacheName=" "/>
24
Availability
25
Other Features Locking Notifications Security
26
Recap – Before using Velocity Understand type of data to cache Reference -> Local Caching Activity -> HA option Resource -> HA + Locking Required Characteristics Performance & Availability Eviction Security Size number of servers Data Size Throughput Required
27
Current Users SectorDescription MediaCache all Media Files & Metadata; Big Media Provider in US ContentBig Content Provider in Europe ContentMSDN Forums is Live on CTP2 HealthcareOne of the large health Care ISV in the world; US FinanceBig Brokerage Firm/Banking; High Performance Computation GamingNotifications for Presence; EnterpriseLargest Mainframe Migration to Windows ManufacturingManufacturing Process Monitoring InsuranceSession data for insurance purchase
28
Futures Azure ASP.Net 4.0 System.Caching Granular Session Updates Cache Through LINQ CTP1 TechedTeched CTP2 PDC 2008 CTP3 End of Mar ‘09 CTP4 Sept ‘09 RTW ?
29
Resources Getting Started http://msdn.microsoft.com/en-gb/data/cc655792.aspx Samples http://code.msdn.microsoft.com/velocity Velocity Blog http://code.msdn.microsoft.com/velocity
31
www.microsoft.com/teched International Content & Community http://microsoft.com/technet Resources for IT Professionals http://microsoft.com/msdn Resources for Developers www.microsoft.com/learning Microsoft Certification & Training Resources Resources Required Slide Speakers, TechEd 2009 is not producing a DVD. Please announce that attendees can access session recordings from Tech-Ed website. These will only be available after the event. Required Slide Speakers, TechEd 2009 is not producing a DVD. Please announce that attendees can access session recordings from Tech-Ed website. These will only be available after the event. Tech ·Ed Africa 2009 sessions will be made available for download the week after the event from: www.tech-ed.co.zawww.tech-ed.co.za
32
Related Content WUX203 - A Lap around Microsoft ASP.NET 4.0 and Microsoft Visual Studio 2010 WUX302 - Understanding Microsoft ASP.NET Under the Covers WUX304 - Black Belt Tips with MVC WUX306 - Taking AJAX to the Next Level WTB216 - Web Development Discussion WSV08-HOL - Introduction to Windows PowerShell Fundamentals AZP04-HOL - Building Windows Azure Services DTL20H - Application Development with the ADO.NET Entity Framework in the Microsoft.NET Framework 4 Required Slide Speakers, please list the Breakout Sessions, TLC Interactive Theaters and Labs that are related to your session. Any queries, please check with your Track Owner. Required Slide Speakers, please list the Breakout Sessions, TLC Interactive Theaters and Labs that are related to your session. Any queries, please check with your Track Owner.
33
Required Slide Complete a session evaluation and enter to win! 10 pairs of MP3 sunglasses to be won
34
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. Required Slide
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.