SlideShare a Scribd company logo
1 of 27
www.alachisoft.com 1
Runtime Data Sharing
through
a Distributed Cache
Iqbal Khan
iqbal@alachisoft.com Ph: +1 (925) 236-2125
Alachisoft
.NET Performance Solutions
Alachisoft
NCache 2www.alachisoft.com
What is Runtime Data Sharing?
1. Server Apps Sharing Application Data Changes
 Connected to a relational database
 Data changed in the database and then shared
2. Server Apps Sharing Transient Data
 This data is never stored in the database
 Data is created at runtime, shared, and then destroyed
3. Server Apps Mix of .NET and Java
 Data sharing may be between .NET and Java apps as well
Alachisoft
NCache 3www.alachisoft.com
Traditional Data Sharing Mechanisms
1. Relational Databases
 Polling
 Database notifications (SQL Server Query Notifications or Oracle Database
Change Notifications)
 Performance and scalability issues
2. Message Queues
 Message focused (not data focused)
 Not intended for large data sets
 Performance and scalability issues
3. Web Services or Remote Procedure Calls
 Too complicated to develop and manage
 Weakness: sender and receiver not decoupled
Alachisoft
NCache 4www.alachisoft.com
Use
Fast & Scalable
Distributed Cache
The Solution
NCache
Alachisoft
NCache 5www.alachisoft.com
What is a Distributed Cache?
1. Cluster of cache servers
 Pools their memory and CPU
2. Synchronizes cache across all servers
 Updates immediately visible
3. Linearly scales transaction & memory capacity
 Add servers to grow capacity
4. Replicates data for reliability
 Without compromising performance & scalability
Alachisoft
NCache 6www.alachisoft.com
Distributed Cache Deployment Architecture
Filesystem Database Servers Mainframe
Distributed Cache Cluster
Windows 2008/2012 (64-bit)
Scale Horizontally
Memory pooled from all cache servers
Grid Computing Apps
(.NET/Java)
Web Services (.NET/Java) Server Apps (.NET/Java)Web Apps (.NET/Java)
Alachisoft
NCache 7www.alachisoft.com
Following Apps use Distributed Cache
1. Web Apps (.NET & Java)
 To handle millions of users
2. Web Services (.NET & Java)
 To handle millions of requests
3. Big Data Apps (.NET & Java)
 To quickly process very large amounts of data thru distribution
4. Grid Computing Apps (.NET & Java)
 To process very large computations thru distribution
5. Other Server Apps (.NET & Java)
 To handle millions of requests
Alachisoft
NCache 8www.alachisoft.com
Three Common Uses of Distributed Cache
1. App Data Caching (for Database Bottlenecks)
 In-memory cache faster than database
 Cache linearly scalable which database is not
2. Reliable & Scalable Cache for ASP.NET Specific Data
 ASP.NET Session State storage (most common)
 ASP.NET View State cache
 ASP.NET Output Cache provider
3. Scalable Runtime Data Sharing
 Faster & more scalable than traditional message queues
 Async data sharing in producer/consumer model
 Powerful event notifications & continuous queries for app coordination
Alachisoft
NCache 9www.alachisoft.com
Scalable Event Notifications for Data Sharing
Alachisoft
NCache 10www.alachisoft.com
Event Notification Types for Data Sharing
1. Event Notifications between .NET and Java Apps
 .NET and Java apps can send event notifications to each other
2. Data Focused Event Notifications
 Whenever some data in the cache changes
3. Message Based Event Notifications
 Publish/subscribe model
 Message sent to one or more subscribers
Alachisoft
NCache 11www.alachisoft.com
.NET and Java App Event Notifications
1. Binary Portable Format
 Data and messages in the cache can use Binary Portable Format
 .NET objects can be read back as Java objects and vice versa
 No XML based costly transformations needed
2. Events Notifications between .NET & Java Apps
 .NET and Java apps can send event notifications to each other
Alachisoft
NCache 12www.alachisoft.com
Data Focused Event Notifications
1. Item Level Event Notifications
 When specific cached items change (update/remove)
2. Group Level Event Notifications
 When any data in a group changes (add/update/remove)
 NCache 4.6 will have this feature
3. Cache Level Event Notifications
 When any data in the cache changes (add/update/remove)
4. Continuous Query Event Notifications
 When any data in a dataset in the cache changes (add/update/remove)
 Dataset defined through SQL-like criteria
Alachisoft
NCache 13www.alachisoft.com
Item Level Event Notifications
// Define and item level event handler function
static void OnCacheDataModification (string key, CacheEventArg args)
{
switch(args.EventType)
{
case EventType.ItemRemoved:
break;
case EventType.ItemUpdated:
break;
}
}
// Register item level event handler function with a “key”
CacheDataNotificationCallback dataNotificationCallback
= new CacheDataNotificationCallback( OnCacheDataModification );
CacheEventDescriptor EventDescriptor
= cache.RegisterCacheNotification (key, dataNotificationCallback,
EventType.ItemRemoved | EventType.ItemUpdated,
EventDataFilter.DataWithMetadata);
Alachisoft
NCache 14www.alachisoft.com
Cache Level Event Notifications
// Define the event handler function
static void OnCacheDataModification (string key, CacheEventArg args)
{
switch(args.EventType)
{
case EventType.ItemAdded:
break;
case EventType.ItemRemoved:
break;
case EventType.ItemUpdated:
break;
}
}
// Register event handler function
CacheDataNotificationCallback dataNotificationCallback
= new CacheDataNotificationCallback ( OnCacheDataModification );
CacheEventDescriptor EventDescriptor = cache.RegisterCacheNotification (
dataNotificationCallback,
EventType.ItemAdded |
EventType.ItemRemoved |
EventType.ItemUpdated,
EventDataFilter.DataWithMetadata );
Alachisoft
NCache 15www.alachisoft.com
Continuous Query Event Notifications
string queryStr = "Select ClassLibrary.Product WHERE this.supplier = ?";
Hashtable values = new Hashtable();
values.Add("supplier", "Carlos Diaz");
ContinuousQuery cq = new ContinuousQuery(queryStr, values);
cq.RegisterNotification (
new QueryDataNotificationCallback (ItemAddedCallBack),
EventType.ItemAdded, EventDataFilter.None );
cq.RegisterNotification (
new QueryDataNotificationCallback(QueryItemCallBack),
EventType.ItemUpdated | EventType.ItemRemoved , EventDataFilter.None);
cq.RegisterClearNotification (
new ContinuousQueryClearCallback(CacheClear));
cache.RegisterCQ ( cq );
Alachisoft
NCache 16www.alachisoft.com
Message Based Event Notifications
1. App Generated Custom Event Notifications
 Publish/subscribe model
 App fires a notification into cache cluster, other apps receive it
2. Topic Based Event Notifications
 Publish/subscribe model
 Publisher sends a message against a topic to multiple subscribers
 NCache 4.6 will have this feature
3. Queue Based Event Notifications
 Publish/subscribe model
 Publisher sends a message to any one subscriber through cache cluster
 NCache 4.6 will have this feature
Alachisoft
NCache 17www.alachisoft.com
App Generated Event Notifications
// Define a callback function
void CacheCustomEvent(object eventId, object data) { }
Product product = new Product();
// Registering custom event callback function
cache.CustomEvent += new CustomEventCallback(CacheCustomEvent);
//Raise custom event when needed
cache.RaiseCustomEvent("custom event id", product);
Alachisoft
NCache 18www.alachisoft.com
Hands on Demo
Alachisoft
NCache 19www.alachisoft.com
NCache Architecture
1. High Availability (100% Uptime)
 Peer to peer cluster
 Dynamic configuration
2. Scalability: Caching Topologies
 Mirrored, Replicated, Partitioned, and Partition-Replica Cache
Alachisoft
NCache 20www.alachisoft.com
High Availability (100% Uptime)
Dynamic Cache Cluster
Cache Cluster
NCache Srv
Add
Server
At
Runtime
Remove
Server
At
Runtime
NCache Srv NCache Srv
Remote Clients (Web/App Servers) TCP based Cache Cluster
 Does not use Windows Clustering
 Peer to peer architecture
 No single point of failure
 Add/remove servers at runtime
 Without stopping cache or your app
 Data adjusted automatically based
on caching topology
 Hot Apply config changes
 Change config properties while
cache is running
Alachisoft
NCache 21www.alachisoft.com
High Availability (100% Uptime)
Dynamic Configuration
 Cluster membership info
 Propagate to clients at runtime
 Cache topology info
 Propagate to clients at runtime
 Connection strategy at runtime
 Connection failover
 Clients auto-connect to other servers
Dynamic Cache Cluster
NCache Srv
Remote Clients (Web/App Servers)
NCache SrvNCache Srv
Cluster
Membership Info
Cache
Topology Info
Alachisoft
NCache 22www.alachisoft.com
Caching Topologies
Mirrored Cache (2-node active/passive)
Server 1 Server 2
Mirrored Cache
1 2
3 4
5 6
Active
1 2
3 4
5 6
Passive
(Backup)
Async Backup
Remote Clients (Web/App Servers)
 All clients connect to active node
 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
Alachisoft
NCache 23www.alachisoft.com
Caching Topologies
Replicated Cache
 Each server has the entire cache
 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 Server 2
Replicated Cache
1 2
3 4
5 6
Active
Synchronous Updates
Remote Clients (Web/App Servers)
1 2
3 4
5 6
Active
Alachisoft
NCache 24www.alachisoft.com
Caching Topologies
Partitioned Cache
 Extremely scalable
 Location transparency
 Good for large cache clusters
 Distribution map sent to all clients
at runtime
 No replication available
Server 1 Server 2
Partitioned Cache
Remote Clients (Web/App Servers)
21
Partition 1
43
Partition 2
Distribution
Map
Distribution
Map
Alachisoft
NCache 25www.alachisoft.com
Caching Topologies
Partition-Replica Cache
 Each partition has one replica on a
different server. All created
automatically.
 Async & Sync replication options
 Extremely fast & scalable
 Reliability due to replicas
Server 1 Server 2
Partition-Replica Cache
Remote Clients (Web/App Servers)
21
Partition 1
43
Replica 2
43
Partition 2
21
Replica 1
Distribution
Map
Distribution
Map
Alachisoft
NCache 26www.alachisoft.com
Conclusion
1. Distributed Cache is Better for Runtime Data Sharing
 Faster and more scalable
 Likely to be already available for your app
2. NCache is the leading distributed cache for .NET
 More feature rich product in the market
Alachisoft
NCache 27www.alachisoft.com
Next Steps
 Download NCache 60-Day Trial (Fully Working)
 http://www.alachisoft.com/download.html
 Contact us for Personalized Architectural Demo
 Email: sales@alachisoft.com. Phone: +1 (925) 236-3830

More Related Content

Recently uploaded

Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburgmasabamasaba
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxAnnaArtyushina1
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...masabamasaba
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Hararemasabamasaba
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Bert Jan Schrijver
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationJuha-Pekka Tolvanen
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benonimasabamasaba
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in sowetomasabamasaba
 

Recently uploaded (20)

Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Featured (20)

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 

Runtime Data Sharing through a Distributed Cache

  • 1. www.alachisoft.com 1 Runtime Data Sharing through a Distributed Cache Iqbal Khan iqbal@alachisoft.com Ph: +1 (925) 236-2125 Alachisoft .NET Performance Solutions
  • 2. Alachisoft NCache 2www.alachisoft.com What is Runtime Data Sharing? 1. Server Apps Sharing Application Data Changes  Connected to a relational database  Data changed in the database and then shared 2. Server Apps Sharing Transient Data  This data is never stored in the database  Data is created at runtime, shared, and then destroyed 3. Server Apps Mix of .NET and Java  Data sharing may be between .NET and Java apps as well
  • 3. Alachisoft NCache 3www.alachisoft.com Traditional Data Sharing Mechanisms 1. Relational Databases  Polling  Database notifications (SQL Server Query Notifications or Oracle Database Change Notifications)  Performance and scalability issues 2. Message Queues  Message focused (not data focused)  Not intended for large data sets  Performance and scalability issues 3. Web Services or Remote Procedure Calls  Too complicated to develop and manage  Weakness: sender and receiver not decoupled
  • 4. Alachisoft NCache 4www.alachisoft.com Use Fast & Scalable Distributed Cache The Solution NCache
  • 5. Alachisoft NCache 5www.alachisoft.com What is a Distributed Cache? 1. Cluster of cache servers  Pools their memory and CPU 2. Synchronizes cache across all servers  Updates immediately visible 3. Linearly scales transaction & memory capacity  Add servers to grow capacity 4. Replicates data for reliability  Without compromising performance & scalability
  • 6. Alachisoft NCache 6www.alachisoft.com Distributed Cache Deployment Architecture Filesystem Database Servers Mainframe Distributed Cache Cluster Windows 2008/2012 (64-bit) Scale Horizontally Memory pooled from all cache servers Grid Computing Apps (.NET/Java) Web Services (.NET/Java) Server Apps (.NET/Java)Web Apps (.NET/Java)
  • 7. Alachisoft NCache 7www.alachisoft.com Following Apps use Distributed Cache 1. Web Apps (.NET & Java)  To handle millions of users 2. Web Services (.NET & Java)  To handle millions of requests 3. Big Data Apps (.NET & Java)  To quickly process very large amounts of data thru distribution 4. Grid Computing Apps (.NET & Java)  To process very large computations thru distribution 5. Other Server Apps (.NET & Java)  To handle millions of requests
  • 8. Alachisoft NCache 8www.alachisoft.com Three Common Uses of Distributed Cache 1. App Data Caching (for Database Bottlenecks)  In-memory cache faster than database  Cache linearly scalable which database is not 2. Reliable & Scalable Cache for ASP.NET Specific Data  ASP.NET Session State storage (most common)  ASP.NET View State cache  ASP.NET Output Cache provider 3. Scalable Runtime Data Sharing  Faster & more scalable than traditional message queues  Async data sharing in producer/consumer model  Powerful event notifications & continuous queries for app coordination
  • 10. Alachisoft NCache 10www.alachisoft.com Event Notification Types for Data Sharing 1. Event Notifications between .NET and Java Apps  .NET and Java apps can send event notifications to each other 2. Data Focused Event Notifications  Whenever some data in the cache changes 3. Message Based Event Notifications  Publish/subscribe model  Message sent to one or more subscribers
  • 11. Alachisoft NCache 11www.alachisoft.com .NET and Java App Event Notifications 1. Binary Portable Format  Data and messages in the cache can use Binary Portable Format  .NET objects can be read back as Java objects and vice versa  No XML based costly transformations needed 2. Events Notifications between .NET & Java Apps  .NET and Java apps can send event notifications to each other
  • 12. Alachisoft NCache 12www.alachisoft.com Data Focused Event Notifications 1. Item Level Event Notifications  When specific cached items change (update/remove) 2. Group Level Event Notifications  When any data in a group changes (add/update/remove)  NCache 4.6 will have this feature 3. Cache Level Event Notifications  When any data in the cache changes (add/update/remove) 4. Continuous Query Event Notifications  When any data in a dataset in the cache changes (add/update/remove)  Dataset defined through SQL-like criteria
  • 13. Alachisoft NCache 13www.alachisoft.com Item Level Event Notifications // Define and item level event handler function static void OnCacheDataModification (string key, CacheEventArg args) { switch(args.EventType) { case EventType.ItemRemoved: break; case EventType.ItemUpdated: break; } } // Register item level event handler function with a “key” CacheDataNotificationCallback dataNotificationCallback = new CacheDataNotificationCallback( OnCacheDataModification ); CacheEventDescriptor EventDescriptor = cache.RegisterCacheNotification (key, dataNotificationCallback, EventType.ItemRemoved | EventType.ItemUpdated, EventDataFilter.DataWithMetadata);
  • 14. Alachisoft NCache 14www.alachisoft.com Cache Level Event Notifications // Define the event handler function static void OnCacheDataModification (string key, CacheEventArg args) { switch(args.EventType) { case EventType.ItemAdded: break; case EventType.ItemRemoved: break; case EventType.ItemUpdated: break; } } // Register event handler function CacheDataNotificationCallback dataNotificationCallback = new CacheDataNotificationCallback ( OnCacheDataModification ); CacheEventDescriptor EventDescriptor = cache.RegisterCacheNotification ( dataNotificationCallback, EventType.ItemAdded | EventType.ItemRemoved | EventType.ItemUpdated, EventDataFilter.DataWithMetadata );
  • 15. Alachisoft NCache 15www.alachisoft.com Continuous Query Event Notifications string queryStr = "Select ClassLibrary.Product WHERE this.supplier = ?"; Hashtable values = new Hashtable(); values.Add("supplier", "Carlos Diaz"); ContinuousQuery cq = new ContinuousQuery(queryStr, values); cq.RegisterNotification ( new QueryDataNotificationCallback (ItemAddedCallBack), EventType.ItemAdded, EventDataFilter.None ); cq.RegisterNotification ( new QueryDataNotificationCallback(QueryItemCallBack), EventType.ItemUpdated | EventType.ItemRemoved , EventDataFilter.None); cq.RegisterClearNotification ( new ContinuousQueryClearCallback(CacheClear)); cache.RegisterCQ ( cq );
  • 16. Alachisoft NCache 16www.alachisoft.com Message Based Event Notifications 1. App Generated Custom Event Notifications  Publish/subscribe model  App fires a notification into cache cluster, other apps receive it 2. Topic Based Event Notifications  Publish/subscribe model  Publisher sends a message against a topic to multiple subscribers  NCache 4.6 will have this feature 3. Queue Based Event Notifications  Publish/subscribe model  Publisher sends a message to any one subscriber through cache cluster  NCache 4.6 will have this feature
  • 17. Alachisoft NCache 17www.alachisoft.com App Generated Event Notifications // Define a callback function void CacheCustomEvent(object eventId, object data) { } Product product = new Product(); // Registering custom event callback function cache.CustomEvent += new CustomEventCallback(CacheCustomEvent); //Raise custom event when needed cache.RaiseCustomEvent("custom event id", product);
  • 19. Alachisoft NCache 19www.alachisoft.com NCache Architecture 1. High Availability (100% Uptime)  Peer to peer cluster  Dynamic configuration 2. Scalability: Caching Topologies  Mirrored, Replicated, Partitioned, and Partition-Replica Cache
  • 20. Alachisoft NCache 20www.alachisoft.com High Availability (100% Uptime) Dynamic Cache Cluster Cache Cluster NCache Srv Add Server At Runtime Remove Server At Runtime NCache Srv NCache Srv Remote Clients (Web/App Servers) TCP based Cache Cluster  Does not use Windows Clustering  Peer to peer architecture  No single point of failure  Add/remove servers at runtime  Without stopping cache or your app  Data adjusted automatically based on caching topology  Hot Apply config changes  Change config properties while cache is running
  • 21. Alachisoft NCache 21www.alachisoft.com High Availability (100% Uptime) Dynamic Configuration  Cluster membership info  Propagate to clients at runtime  Cache topology info  Propagate to clients at runtime  Connection strategy at runtime  Connection failover  Clients auto-connect to other servers Dynamic Cache Cluster NCache Srv Remote Clients (Web/App Servers) NCache SrvNCache Srv Cluster Membership Info Cache Topology Info
  • 22. Alachisoft NCache 22www.alachisoft.com Caching Topologies Mirrored Cache (2-node active/passive) Server 1 Server 2 Mirrored Cache 1 2 3 4 5 6 Active 1 2 3 4 5 6 Passive (Backup) Async Backup Remote Clients (Web/App Servers)  All clients connect to active node  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
  • 23. Alachisoft NCache 23www.alachisoft.com Caching Topologies Replicated Cache  Each server has the entire cache  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 Server 2 Replicated Cache 1 2 3 4 5 6 Active Synchronous Updates Remote Clients (Web/App Servers) 1 2 3 4 5 6 Active
  • 24. Alachisoft NCache 24www.alachisoft.com Caching Topologies Partitioned Cache  Extremely scalable  Location transparency  Good for large cache clusters  Distribution map sent to all clients at runtime  No replication available Server 1 Server 2 Partitioned Cache Remote Clients (Web/App Servers) 21 Partition 1 43 Partition 2 Distribution Map Distribution Map
  • 25. Alachisoft NCache 25www.alachisoft.com Caching Topologies Partition-Replica Cache  Each partition has one replica on a different server. All created automatically.  Async & Sync replication options  Extremely fast & scalable  Reliability due to replicas Server 1 Server 2 Partition-Replica Cache Remote Clients (Web/App Servers) 21 Partition 1 43 Replica 2 43 Partition 2 21 Replica 1 Distribution Map Distribution Map
  • 26. Alachisoft NCache 26www.alachisoft.com Conclusion 1. Distributed Cache is Better for Runtime Data Sharing  Faster and more scalable  Likely to be already available for your app 2. NCache is the leading distributed cache for .NET  More feature rich product in the market
  • 27. Alachisoft NCache 27www.alachisoft.com Next Steps  Download NCache 60-Day Trial (Fully Working)  http://www.alachisoft.com/download.html  Contact us for Personalized Architectural Demo  Email: sales@alachisoft.com. Phone: +1 (925) 236-3830