Windows Server AppFabric <br />Speaker: Ron Jacobs<br />Senior Technical Evangelist, Microsoft<br />Silicon Valley SQL Ser...
Windows Server AppFabric<br />AppFabric is a set of integrated technologies that make it easier to build, scale, and manag...
Ron Jacobs of Microsoft<br />Ron Jacobs<br />Senior Technical Evangelist<br />Microsoft Platform Evangelism Group in Redmo...
Designing and Delivering Scalable and Resilient Web Services<br />Ron Jacobs<br />Sr. Technical Evangelist, Microsoft<br /...
Agenda<br />
Simple<br />Do the simplest thing that will possibly work<br />
Scalability<br />Able to support the required quality of service as the system load increases<br />-Wiktionary<br />
Typical Web Architecture<br />
Web Explosion<br />Web Site’s too slow!!<br />Where did my shopping cart go?<br />IIS/ASP.NET<br />IIS/ASP.NET<br />IIS/AS...
Agenda<br />
Data Near Processing<br />Cache<br />Cache<br />Browser<br />Smart Client<br />Cache<br />Web Service<br />ASP.NET<br />Ca...
Good but…<br />Cache is scoped to machine  / process<br />Machines die<br />Processes recycle<br />Cache memory is limited...
What if?<br />You could have as much cache as you wanted?<br />You could share a giant cache across servers, services and ...
Windows Server AppFabric<br />AppFabric<br />CACHING<br />WORKFLOW HOSTING<br />SERVICE HOSTING<br />MONITORING<br />SCALE...
Unified Cache View<br />What is AppFabric Caching?<br />An explicit, distributed, in-memory application cache for all kind...
AppFabric Cache<br />
Data Distribution - Partitioned Cache<br />…<br />Web Tier<br />ASP.Net App<br />ASP.Net App<br />ASP.Net App<br />Caching...
Scale Test Output<br />Load<br />1 Cache Server<br />As load increases, <br />throughput fails <br />to scale <br />latenc...
Add Second Cache Server<br />Load<br />Load Max<br />Throughput increases<br />Latency decreases<br />Caching Tier<br />Th...
Add Third Cache Server<br />Load<br />Caching Tier<br />Throughput<br />Latency<br />
Associated Press<br />Caches metadata and news<br />Serves 16 million hits per day<br />Increased the amount of cached dat...
System.Web.Cache<br />
AppFabricDataCache<br />
Deployment<br />Update Web.config<br />Copy Client DLLs<br />…<br /><hosts><br />      <host name="BL1CDB8083714“<br />cac...
Usage Pattern – Cache Aside  (Explicit Caching)<br />//  Read from Cache<br />Toy toyObj = (Toy)<br />catalog.Get("toy-101...
Administration<br />PowerShell cmdlets are used to administer the cache cluster	<br />Rich set of cmdlets for <br />Cache ...
Hello AppFabric Cache<br />Demo<br />
Using PowerShell<br />Remember – PowerShell can also be called from .NET Code!<br />
AppFabric Cache Codeplex Tool<br />http://mdcadmintool.codeplex.com/<br />Demo<br />
Security<br />Domain Based Security Option<br />Domain Account / Local Account based Authentication<br />Only authorized s...
AppFabric Caching Logical Hierarchy<br />AppFabric Caching Service<br />AppFabric Caching Service<br />AppFabric Caching S...
AppFabric Caching API<br />// Create instance of cachefactory (reads appconfig)<br />DataCacheFactory fac = new DataCacheF...
Access APIs – Tagging Items<br />Tag hotItem  = new Tag("hotItem");<br />catalog.Put("toy-101", new Toy("Puzzle"),<br />ne...
Types of Data<br />Grocery Shop<br /> Web Tier<br />Shopping Cart<br />Grocery Inventory<br />Distributed Cache<br />     ...
Reference Data – Performance<br />Catalog data doesn’t change often<br />Unnecessary network cost to access from different...
Reference Data – Bulk Get<br />Bulk Fetch from region<br />200-300k ops per second<br />Fewer network calls<br />Catalog.B...
Activity Data – Session Integration<br />Load Balance Requests<br />No more sticky routing<br /><sessionState  mode="Custo...
Application<br />Application<br />Activity Data - Availability<br />PUT<br />Get(K2)<br />AppFabric Caching Client<br />Ap...
Resource Data - Optimistic Locking<br />GetCacheItem returns a version object<br />Every update to an object internally in...
Resource Data - Pessimistic Locking<br />Client1: <br />GetAndLock ("k1")<br />Client3:<br /> Get ("k1")<br />Client2:<br ...
Data Race<br />GET<br />GET<br />GET<br />
Lock Non-Existent Key<br />GET/LOCK<br />GET/LOCK<br />GET/LOCK<br />Cache  Service<br />Cache  Service<br />Caching  Serv...
Composite Race<br />CALL<br />WAIT<br />WAIT<br />Cache  Service<br />Cache  Service<br />Caching  Service<br />
Composite Race<br />PUT<br />UNLOCK<br />GET<br />GET<br />Cache  Service<br />Cache  Service<br />Caching  Service<br />
Resource/Activity Data – Tracking Changes<br />Cache Event notifications<br />Register on any client to notify changes<br ...
Register Notification for Key “K3"<br />Call Delegate<br />Store Last LSN <br />Application<br />Map Keys to Partition<br ...
Agenda<br />
Data Center<br />Pre-Fetch<br />Hospital<br />
Pre-Fetch<br />Hospital<br />Remote Clinic<br />Slow!!<br />Data Center<br />WAN<br />
Pre-Fetch<br />Hospital<br />Remote Clinic<br />Cache  Service<br />Data Center<br />WAN<br />
Agenda<br />
Web Platform Installer<br />
Select Enterprise<br />
Install AppFabric<br />
Install AppFabric<br />
endpoint.tv<br />
AppFabric on MSDN<br />http://msdn.microsoft.com/AppFabric<br />
To learn more or inquire about speaking opportunities, please contact:<br />Mark Ginnebaugh, User Group Leader<br />mark@d...
Upcoming SlideShare
Loading in …5
×

Microsoft Windows Server AppFabric

16,184 views

Published on

Intro to Windows Server AppFabric

by Ron Jacobs, Senior Technical Evangelist at Microsoft

Windows Server AppFabric is a set of integrated technologies that make it easier to build, scale and manage Web and composite applications that run on IIS.

This presentation will help SQL Server developers and DBAs get up to speed on AppFabric. You'll also learn how Windows AppFabric caching can help you scale your Data Tier.

You will learn:

•The core capabilities of Windows Server AppFabric

•How the distributed nature of AppFabric’s cache allows large amounts of data to be stored in-memory for extremely fast access and help you scale your SQL Data Tier

•How to get started with Windows Server AppFabric

Published in: Education
0 Comments
21 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
16,184
On SlideShare
0
From Embeds
0
Number of Embeds
427
Actions
Shares
0
Downloads
0
Comments
0
Likes
21
Embeds 0
No embeds

No notes for slide
  • In the future we will be bringing these capabilities to the cloud and bringing some of the cloud capabilities such as service bus and access control to the on-premise server solution as well.
  • Microsoft Windows Server AppFabric

    1. 1. Windows Server AppFabric <br />Speaker: Ron Jacobs<br />Senior Technical Evangelist, Microsoft<br />Silicon Valley SQL Server User Group<br />April 2010<br /> Mark Ginnebaugh, User Group Leader, mark@designmind.com<br />
    2. 2. Windows Server AppFabric<br />AppFabric is a set of integrated technologies that make it easier to build, scale, and manage Web and composite applications that run on IIS. <br />
    3. 3. Ron Jacobs of Microsoft<br />Ron Jacobs<br />Senior Technical Evangelist<br />Microsoft Platform Evangelism Group in Redmond<br />Current focus<br />Windows Communication Foundation (WCF)<br />Windows Workflow Foundation (WWF) <br />For more information about this meeting: http://www.meetup.com/The-SiliconValley-SQL-Server-User-Group/calendar/12626266 <br />
    4. 4. Designing and Delivering Scalable and Resilient Web Services<br />Ron Jacobs<br />Sr. Technical Evangelist, Microsoft<br />http://blogs.msdn.com/rjacobs<br />Video of this session: <br />http://live.visitmix.com/MIX10/Sessions/FT11<br />
    5. 5. Agenda<br />
    6. 6. Simple<br />Do the simplest thing that will possibly work<br />
    7. 7. Scalability<br />Able to support the required quality of service as the system load increases<br />-Wiktionary<br />
    8. 8. Typical Web Architecture<br />
    9. 9. Web Explosion<br />Web Site’s too slow!!<br />Where did my shopping cart go?<br />IIS/ASP.NET<br />IIS/ASP.NET<br />IIS/ASP.NET<br /> Application<br /> Application<br /> Application<br />Servers are crashing<br />Database<br />Database is hot!!<br />Services are slow<br />
    10. 10. Agenda<br />
    11. 11. Data Near Processing<br />Cache<br />Cache<br />Browser<br />Smart Client<br />Cache<br />Web Service<br />ASP.NET<br />Cache<br />Cache<br />Database<br />
    12. 12. Good but…<br />Cache is scoped to machine / process<br />Machines die<br />Processes recycle<br />Cache memory is limited<br />
    13. 13. What if?<br />You could have as much cache as you wanted?<br />You could share a giant cache across servers, services and even clients?<br />What if this was something you could simply add to the platform for 1free?<br />1Some features may require certain editions of Windows Server <br />
    14. 14. Windows Server AppFabric<br />AppFabric<br />CACHING<br />WORKFLOW HOSTING<br />SERVICE HOSTING<br />MONITORING<br />SCALE OUT<br />HIGH AVAILABILITY <br />MANAGEMENT<br />AppFabric Cache – Formerly known as Code Name “Velocity”<br />
    15. 15. Unified Cache View<br />What is AppFabric Caching?<br />An explicit, distributed, in-memory application cache for all kinds of data <br />Caching clients can be across machines or processes<br />Clients Access the Cache as if it was a large single cache<br />Cache Layer distributes data across the various cache nodes<br />
    16. 16. AppFabric Cache<br />
    17. 17. Data Distribution - Partitioned Cache<br />…<br />Web Tier<br />ASP.Net App<br />ASP.Net App<br />ASP.Net App<br />Caching Client<br />Caching Client<br />Caching Client<br />G<br />H<br />I<br />D<br />E<br />F<br />A<br />B<br />C<br />Cache Service<br />Cache Service<br />Cache Tier<br />Cache Service<br />E<br />G<br />B<br />D<br />H<br />A<br />I<br />C<br />F<br />Scale on Data Size -More machines => More memory to cache<br />Scale on Cache Throughput -More machines => keys distributed across more machines => better throughput<br />
    18. 18. Scale Test Output<br />Load<br />1 Cache Server<br />As load increases, <br />throughput fails <br />to scale <br />latency increases<br />Caching Tier<br />Throughput<br />Latency<br />
    19. 19. Add Second Cache Server<br />Load<br />Load Max<br />Throughput increases<br />Latency decreases<br />Caching Tier<br />Throughput<br />Latency<br />
    20. 20. Add Third Cache Server<br />Load<br />Caching Tier<br />Throughput<br />Latency<br />
    21. 21. Associated Press<br />Caches metadata and news<br />Serves 16 million hits per day<br />Increased the amount of cached data 6 times.<br />
    22. 22. System.Web.Cache<br />
    23. 23. AppFabricDataCache<br />
    24. 24. Deployment<br />Update Web.config<br />Copy Client DLLs<br />…<br /><hosts><br /> <host name="BL1CDB8083714“<br />cachePort="22233" <br />cacheHostName="DistributedCacheService"/><br /> …..<br /> </hosts><br /> <localCacheisEnabled=“true" ../><br /><security … /><br />.NET 3.5 SP1 OR .NET 4<br /> Application<br /> Application<br /> Application<br />Caching Access Layer<br />Caching Access Layer<br />Caching Access Layer<br />Install AppFabric<br />Configure AppFabric<br />.NET 4<br />Caching Service<br />Caching Service<br />Caching Service<br />Configuration Store <br />
    25. 25. Usage Pattern – Cache Aside (Explicit Caching)<br />// Read from Cache<br />Toy toyObj = (Toy)<br />catalog.Get("toy-101");<br /> Application<br />Caching Access Layer<br />// If Not present in the cache<br />if (toyObj == null)<br />{<br /> // Read from backend..<br /> toyObj = ReadFromDatabase();<br /> // Populate Cache<br />catalog.Put("toy-101", toyObj);<br /> return toyObj;<br />}<br />Caching Service<br />Database<br />
    26. 26. Administration<br />PowerShell cmdlets are used to administer the cache cluster <br />Rich set of cmdlets for <br />Cache cluster management<br />Cache creation and monitoring<br />
    27. 27. Hello AppFabric Cache<br />Demo<br />
    28. 28. Using PowerShell<br />Remember – PowerShell can also be called from .NET Code!<br />
    29. 29. AppFabric Cache Codeplex Tool<br />http://mdcadmintool.codeplex.com/<br />Demo<br />
    30. 30. Security<br />Domain Based Security Option<br />Domain Account / Local Account based Authentication<br />Only authorized servers can join the cluster<br />Only authorized clients can connect to the cluster<br />Transport Level Security<br />Turn on/off Signing or Encryption<br />Can turn off Cache Security<br />Use Firewalls, IPSec, VLANs to protect cache<br />grant-cacheallowedclientaccount  RedDomainMachine1$<br /> grant-cacheallowedclientaccount  RedDomainJohn<br />
    31. 31. AppFabric Caching Logical Hierarchy<br />AppFabric Caching Service<br />AppFabric Caching Service<br />AppFabric Caching Service<br />AppFabric Caching Service<br />Named Cache : Product Catalog<br />Named Cache : Electronics Inventory<br />Regions <br />Key Payload Tags <br />Region A<br />121 xxxx “Toy” “Child”<br />123 yyyy “Toy” “Chair”.. <br />Machine -> Cache Host -> Named Caches -> Regions -> Cache Items -> Objects<br />Host<br />Physical processes hosting AppFabric Caching instance.<br />Named Caches<br />Can span across machines<br />Defined in the configuration file<br />Cache Item<br />Key, Payload (Object ), Tags, TTL, Timestamps, Version<br />Regions<br />Physically co-located Container of Cache Items<br />May be implicit or explicitly created<br />
    32. 32. AppFabric Caching API<br />// Create instance of cachefactory (reads appconfig)<br />DataCacheFactory fac = new DataCacheFactory();<br />// Get a named cache from the factory<br />DataCache catalog = fac.GetCache("catalogcache");<br />// Simple Get/Put<br />catalog.Put("toy-101", new Toy("Puzzle", .,.));<br />// From the same or a different client<br />Toy toyObj = (Toy)catalog.Get("toy-101");<br />// Region based Get/Put<br />catalog.CreateRegion("toyRegion");<br />// Both toy and toyparts are put in the same region <br />catalog.Put("toy-101", new Toy( .,.), “toyRegion”);<br />Catalog.Put("toypart-100", new ToyParts(…), “toyRegion”);<br />Toy toyObj = (Toy)catalog.Get("toy-101“,"toyRegion");<br />
    33. 33. Access APIs – Tagging Items<br />Tag hotItem = new Tag("hotItem");<br />catalog.Put("toy-101", new Toy("Puzzle"),<br />new Tag[]{hotItem}, “toyRegion”);<br />catalog.Put("toy-102", new Toy("Bridge"), “toyRegion”);<br />// From the same or a different client<br />List<KeyValuePair<string, object>> toys = <br />catalog.GetAnyMatchingTag("toyRegion", hotItem);<br />
    34. 34. Types of Data<br />Grocery Shop<br /> Web Tier<br />Shopping Cart<br />Grocery Inventory<br />Distributed Cache<br /> Grocery Catalog<br />
    35. 35. Reference Data – Performance<br />Catalog data doesn’t change often<br />Unnecessary network cost to access from different machines<br />Solution – Local Cache<br />Application<br />Application<br />Get(K2)<br />Get(K2)<br />Put(K2, v3)<br />AppFabric Caching Client<br />AppFabric Caching Client<br />Local Cache<br />RoutingTable<br />Routing Table<br />Cache2<br />Cache3<br />Cache1<br />K2, V2<br />K2, V2<br />Primary for K1,V1<br />Primary for K3,V3<br />Primary for K2,V2<br />K1, V1<br />K2, V3<br />K3, V3<br />
    36. 36. Reference Data – Bulk Get<br />Bulk Fetch from region<br />200-300k ops per second<br />Fewer network calls<br />Catalog.BulkGet( <br /> new List<string>(){“toy-101”, “toy-102”} ,<br /> “toyRegion”);<br />
    37. 37. Activity Data – Session Integration<br />Load Balance Requests<br />No more sticky routing<br /><sessionState mode="Custom“ customProvider="SessionStoreProvider"><br /><providers><br /> <add name="SessionStoreProvider" <br /> type=“Microsoft.Data.Caching.DataCacheSessionStoreProvider, <br />ClientLibrary“ <br />cacheName="<YourNamedCache>"/><br /></providers><br /></sessionState><br />Drop in AppFabric Caching SessionStoreProvider<br />…<br />Caching Access Layer<br />Caching Access Layer<br />Session State stored in AppFabric Caching<br />Allows session state to be shared amongst multiple applications<br />Scale your Session Store<br />Dynamically<br />Cache Service<br />Caching Service<br />Caching Service<br />Highly Available<br /> Application<br /> Application<br /> Application<br />Caching Access Layer<br />
    38. 38. Application<br />Application<br />Activity Data - Availability<br />PUT<br />Get(K2)<br />AppFabric Caching Client<br />AppFabric Caching Client<br />Routing Table<br />Routing Table<br />Cache1<br />Cache2<br />Cache3<br />Primary for<br />Primary for<br />Primary for <br />Replication Agent<br />K3, V3<br />K1, V1<br />K2, V2<br />(K2, V2)<br />K2, V2<br />Secondary for<br />Secondary for <br />Secondary for<br />K2, V2<br />K2, V2<br />K3, V3<br />K1, V1<br />
    39. 39. Resource Data - Optimistic Locking<br />GetCacheItem returns a version object<br />Every update to an object internally increments it's version<br />Supply the version obtained along with the Put/Remove<br />Put/Remove will succeed only if the passed in version matches the version in the cache <br />Two clients access the same item <br />Both update the item<br />Second Client gets in first; put succeeds because item version matches; atomically increments the version<br />First client tries put;<br />Fails because the versions don’t match<br />
    40. 40. Resource Data - Pessimistic Locking<br />Client1: <br />GetAndLock ("k1")<br />Client3:<br /> Get ("k1")<br />Client2:<br /> GetAndLock ("k1")<br />GetAndLock gets lock handle<br />Regular Get succeeds<br /> Other GetAndLock on same item fails<br />Take locks on non-existent keys<br />Allows you to co-ordinate calls for data<br />K1<br />
    41. 41. Data Race<br />GET<br />GET<br />GET<br />
    42. 42. Lock Non-Existent Key<br />GET/LOCK<br />GET/LOCK<br />GET/LOCK<br />Cache Service<br />Cache Service<br />Caching Service<br />
    43. 43. Composite Race<br />CALL<br />WAIT<br />WAIT<br />Cache Service<br />Cache Service<br />Caching Service<br />
    44. 44. Composite Race<br />PUT<br />UNLOCK<br />GET<br />GET<br />Cache Service<br />Cache Service<br />Caching Service<br />
    45. 45. Resource/Activity Data – Tracking Changes<br />Cache Event notifications<br />Register on any client to notify changes<br />Batched Notifications<br />DataCache.RegisterCacheLevelCallback(<br />int filter, DataCacheChangeCallback delegate); <br />DataCache.RegisterRegionLevelCallback(<br /> String region, int filter, DataCacheChangeCallback delegate); <br />DataCache.RegisterKeyLevelCallback(<br /> String region, String key, int filter, DataCacheChangeCallback delegate); <br />
    46. 46. Register Notification for Key “K3"<br />Call Delegate<br />Store Last LSN <br />Application<br />Map Keys to Partition<br />AppFabric Caching Client<br />Partition: P2<br />Last LSN: 19<br />Routing Table<br />Poll Required Nodes<br />Nodes Return List of Changes LSN Order<br />Cache2<br />Cache3<br />Cache1<br />K2, V2<br />Primary for<br />Primary for<br />Primary for<br />Change Log (Partition P2)<br />Del K32<br />Del K43<br />Change Log<br />Partition P1<br />Add K2<br />Del K32<br />Change Log<br />33 Add K1<br />34 Del K22<br />K1, V1<br />K3, V3<br />Scalable Notifications<br />
    47. 47. Agenda<br />
    48. 48. Data Center<br />Pre-Fetch<br />Hospital<br />
    49. 49. Pre-Fetch<br />Hospital<br />Remote Clinic<br />Slow!!<br />Data Center<br />WAN<br />
    50. 50. Pre-Fetch<br />Hospital<br />Remote Clinic<br />Cache Service<br />Data Center<br />WAN<br />
    51. 51. Agenda<br />
    52. 52. Web Platform Installer<br />
    53. 53. Select Enterprise<br />
    54. 54. Install AppFabric<br />
    55. 55. Install AppFabric<br />
    56. 56. endpoint.tv<br />
    57. 57. AppFabric on MSDN<br />http://msdn.microsoft.com/AppFabric<br />
    58. 58. To learn more or inquire about speaking opportunities, please contact:<br />Mark Ginnebaugh, User Group Leader<br />mark@designmind.com<br />

    ×