NCache Architecture

1,736 views
1,426 views

Published on

This presentation describes basics of NCache Architecture and Caching topologies and provides an overview of how to use NCache in web farms and clustered environments

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,736
On SlideShare
0
From Embeds
0
Number of Embeds
9
Actions
Shares
0
Downloads
0
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

NCache Architecture

  1. 1. Alachisoft NCache .NET Performance Solutions .NET & Java Application Scalability in Server Farms Distributed Data Cache Distributed Web Sessions (ASP.NET & JSP) Iqbal Khan iqbal@alachisoft.com Ph: +1 (925) 236-2125 www.alachisoft.com 1
  2. 2. Alachisoft Three Common Benefits of NCache 1. Fast & Scalable In-Memory App Data Caching   2. Reliable & Scalable Web Session Storage (ASP.NET & JSP)   3. Faster performance through in-memory cache Linear scalability by reducing pressure on the database Reliable session storage through intelligent replication Fast & scalable too Runtime Data Sharing for Server Apps   NCache 4.1 Asynchronous data sharing in producer/consumer model Powerful event notifications & continuous queries for app coordination www.alachisoft.com 2
  3. 3. Alachisoft NCache: Enterprise Distributed Cache ASP.NET Apps WCF Web Services Java/JSP/Servlet Apps Grid Computing Apps (.NET & Java) Windows & Unix/Linux Windows & Unix/Linux Distributed Cache Cluster Memory pooled from all cache servers Scale Horizontally Windows 2003/2008 (32-bit & 64-bit) Filesystem NCache 4.1 Database Servers www.alachisoft.com Mainframe 3
  4. 4. Alachisoft High Availability (100% Uptime) Dynamic Cache Cluster  TCP based Cache Cluster   No single point of failure Add/remove servers at runtime    Does not use Windows Clustering Peer to peer architecture   Remote Clients (Web/App Servers) Without stopping cache or your app Data adjusted automatically based on caching topology Add Server At Runtime Hot Apply config changes  Cache Cluster NCache Srv NCache Srv Remove Server At Runtime Change config properties while cache is running NCache Srv NCache 4.1 www.alachisoft.com 4
  5. 5. Alachisoft High Availability (100% Uptime) Dynamic Configuration  Connection failover   Clients auto-connect to other servers Cluster membership info   Remote Clients (Web/App Servers) Propagate to clients at runtime Cache topology info   Cluster Membership Info Cache Topology Info Propagate to clients at runtime Connection strategy at runtime NCache Srv NCache Srv NCache Srv Dynamic Cache Cluster NCache 4.1 www.alachisoft.com 5
  6. 6. Alachisoft Caching Topologies Mirrored Cache (2-node active/passive)  All clients connect to active node Mirrored Cache Remote Clients (Web/App Servers)    Passive node becomes active if active node goes down. Clients also automatically connect to new active node Mirroring to passive node done asynchronously Recommended use:  Up to 10 app servers  2 cache server cluster Server 1 1 3 Server 2 2 Active 5 1 4 3 6 2 Passive (Backup) 5 4 6 Async Backup NCache 4.1 www.alachisoft.com 6
  7. 7. Alachisoft Caching Topologies Replicated Cache  Each server has the entire cache Replicated Cache Remote Clients (Web/App Servers)    Cache updates done to all servers synchronously. So, they’re slower. Each clients connects to only one cache server. All servers active. Good for read-intensive scenarios Server 1 1 3 Server 2 2 Active 5 1 4 6 3 2 Active 5 4 6 Synchronous Updates NCache 4.1 www.alachisoft.com 7
  8. 8. Alachisoft Caching Topologies Partitioned Cache  Extremely scalable Partitioned Cache Remote Clients (Web/App Servers)  Location transparency  Good for large cache clusters   Distribution map sent to all clients at runtime Distribution Map Distribution Map No replication available Partition 1 1 2 Server 1 NCache 4.1 www.alachisoft.com Partition 2 3 4 Server 2 8
  9. 9. Alachisoft Caching Topologies Partitioned-Replica Cache  Each partition has one replica on a different server. All created automatically.  Remote Clients (Web/App Servers) Async & Sync replication options  Partition-Replica Cache Extremely fast & scalable  Reliability due to replicas Distribution Map Distribution Map Partition 1 1 2 Replica 2 3 4 Server 1 NCache 4.1 www.alachisoft.com Partition 2 3 4 Replica 1 1 2 Server 2 9
  10. 10. Alachisoft Caching Topologies Client Cache NCache Client Nodes    Local cache on client nodes (inprocess and out-of-process) Automatically synchronizes with clustered cache. Optimistic & pessimistic synch options. ... Web/App Server (Client Node) Web/App Server (Client Node) Client Cache Client Cache Synchronized No special programming needed. Plug in thru config changes. Synchronized Cache Cluster Dynamic Clustered Cache Server 1  Good for read-intensive scenarios 1 Server 2 2 3 1 5 2 5 4 6 3 6 4 Server 3 1 2 5 6 3 4 Cached Item NCache 4.1 www.alachisoft.com 10
  11. 11. Alachisoft Caching Topologies Performance Data (2-node cluster)  Mirrored Cache    Replicated Cache    30,000 reads/sec 25,000 writes/sec 60,000 reads/sec 2500 writes/sec Partition-Replica Cache   60,000 reads/sec 44,000 writes/sec 60000 50000 40000 Reads/sec (1 kb) 30000 Writes/sec (1 kb) 20000 10000 0 Mirrored NCache 4.1 Replicated www.alachisoft.com Partition-Replica 11
  12. 12. Alachisoft Caching Topologies Bridge Topology (for WAN replication) Primary Site (Active) Disaster Recovery Site NCache Client Nodes Remote Client (.NET) Remote Client (.NET) ... NCache Client Nodes Remote Client (Java) Remote Client (.NET) Remote Client (.NET) Cache Cluster Server 1 Server 2 .NET Client NCache NCache 4.1 Server 1 Replicate (WAN) Server 2 (Passive Mirror) www.alachisoft.com Java Client NCache Server 1 (Active) Server 2 .NET Client Bridge Server 3 NCache Remote Client (Java) Cache Cluster Java Client NCache ... NCache Server 3 NCache 12
  13. 13. Alachisoft Powerful Cache Administration NCache 4.1 www.alachisoft.com 13
  14. 14. Alachisoft Powerful Cache Monitoring NCache 4.1 www.alachisoft.com 14
  15. 15. Alachisoft Important Features  Max cache size   Eviction policies   Authenticate with Active Directory. Authorize as “Admin” or “User” Compression   LRU, LFU, Priority, and “Do Not Evict” Cache security (authenticate + authorize)   To control memory consumption. Evicts item when cache reaches Max Size Specify compression threshold. Uses GZip on client-side. Server Configuration Options   Rejoin a cache cluster upon reboot Multiple NIC support (one for client/server & one for cluster) NCache 4.1 www.alachisoft.com 15
  16. 16. Alachisoft NCache ASP.NET 2.0 Session State Provider Thin Client (Browser based) ... Thin Client (Browser based) Thin Client (Browser based) Load Balancer (LB) Web Server (IIS) Web Server (IIS) Web Server (IIS) ASP.NET Pages ASP.NET Pages ASP.NET Pages Business & Data Objects ASP.NET Session NC Session State Provider (SSP) Distributed Cache Business & Data Objects ASP.NET Session NC Session State Provider (SSP Distributed Cache Business & Data Objects ASP.NET Session NC Session State Provider (SSP) Distributed Cache Dynamic Cluster (TCP based) NCache 4.1 www.alachisoft.com 16
  17. 17. Alachisoft Object Caching API is Simple  Initialize & Dispose the Cache    Read from the Cache       cache.Add(“myKey”, obj); cache.Insert(“myKey”, obj); cache[“myKey”] = obj; Remove from the Cache   object obj = cache.Get(“myKey”); object obj = cache[“myKey”]; bool isPresent = cache.Contains(“myKey”); Add to the Cache   Cache cache = NCache.InitializeCache(“myReplicatedCache”); cache.Dispose(); object obj = cache.Remove(“myKey”); Clear  NCache 4.1 cache.Clear(); www.alachisoft.com 17
  18. 18. Alachisoft Important Object Caching Features  Expirations    Cache dependencies   Key, file, and custom dependencies Synchronize cache with database    Absolute-time + idle-time Auto-reload data on expiration (if read-thru enabled) .NET event notifications (SqlDependency) for SQL Server 2005 & Oracle 10g R2 Polling based for all OLEDB compliant databases Read-through and write-through   You implement read-thru and write-thru handlers called by NCache Write has write-behind option that queues up database updates NCache 4.1 www.alachisoft.com 18
  19. 19. Alachisoft Important Object Caching Features  Event notifications (cluster wide)     Tagging & Searching Cache    Object Query Language for searching on object attributes Tagging for arbitrary grouping and searching of cached objects Pessimistic & Optimistic Locking    Register interest in specific cached items to be notified at insert/remove Register interest to be notified at ALL add/insert/remove (off by default) Send custom notifications to other NCache clients (cluster wide) Lock/Unlock for pessimistic locking (writer-lock) Object versioning for optimistic locking (reader-lock) Bulk operations  Get, Add, Insert, Remove NCache 4.1 www.alachisoft.com 19
  20. 20. Alachisoft Important Object Caching Features  Compact serialization   Caching Application Block (CAB) integration    NCache implements a cache manager for CAB No code change required to integrate (only config file changes) NHibernate integration    Mix with regular .NET serialization. Faster and more compact. Cache provider for NHibernate implemented No code change required to integrate (only config file changes) Java client    No Java-to-.NET interoperability used. Native NCache socket protocol. Event notifications available Object Query Language available NCache 4.1 www.alachisoft.com 20
  21. 21. Alachisoft NCache 4.1: Java Catches up to .NET   Java API 100% equivalent to .NET API Client Cache (InProc)   Read-thru/Write-thru    Bulk load cache upon startup with Java objects Dynamic Compact Serialization of Java objects   Register Jar files with NCache Auto-reload Java objects with read-thru at expiration & db synchronization Cache Loader   No programming needed to use it Serialization code generated & compiled in memory at runtime NCache Manager Reads Java Libraries (Jar files)  For Read-thru/Write-thru, Cache Loader, Dynamic Compact Serialization, & Query Indexing NCache 4.1 www.alachisoft.com 21
  22. 22. Alachisoft NCache 4.1: New Features (.NET & Java)  Runtime Data Sharing between Java & .NET   Continuous Query    Based on binary serialization (much faster than XML serialization) Specify & monitor a data-set based on SQL-like query Event notifications upon add, update, or delete in this data-set Multiple Bridge Topologies     Active/Passive: Clients have read-only access to passive cache now Active/Active: Clients update both caches and changes are synchronized. Conflicts resolved on “last update wins” bases or thru a custom conflict resolution handler. Hub-Spoke: One active (“hub”) and multiple read-only passive caches (“spokes”). All changes from “hub” automatically propagated to “spokes”. Centeralized: Multiple active caches. All changes synchronized and conflicts resolved on “last update wins” bases or thru a custom conflict resolution handler. NCache 4.1 www.alachisoft.com 22
  23. 23. Alachisoft NCache 4.1: New Features (.NET & Java)  Named Tags   Each tag has a name and a value. Faster Enumerators on Collections    Groups/Subgroups Tags & Named Tags Fast & intelligent enumeration on very large collections (millions of items)  Use Groups & Tags on same items  Various performance optimizations  For bulk operations, groups, tags, OQL, and collection handling NCache 4.1 www.alachisoft.com 23
  24. 24. Alachisoft What to Do Next?     Find more about NCache Download 60-day Trial Request a Personalized LIVE Demo Read product Documentation Thank You NCache 4.1 www.alachisoft.com 24

×