SlideShare uma empresa Scribd logo
1 de 31
Alachisoft
.NET Performance Solutions

How to Handle Relational Data
in a Distributed Cache

Iqbal Khan
iqbal@alachisoft.com Ph: +1 (925) 236-2125
www.alachisoft.com

1
Alachisoft

Following Applications Need Scalability
1.

ASP.NET Apps


2.

WCF & .NET Web Services


3.

To quickly process very large amounts of data thru distribution

Grid Computing Apps


5.

To handle millions of requests

Big Data Apps


4.

To handle millions of users

To process very large computations thru distribution

Other .NET Server Apps


NCache

To handle millions of requests
www.alachisoft.com

2
Alachisoft

Data Storage is Scalability Bottleneck
ASP.NET/WCF Example

App Database

ASP.NET/WCF Servers

Database Servers
Data Access

Scale Web Farm

Web Clients

Http Calls

...
NCache

Load Balancer

www.alachisoft.com

ASP.NET Session
Storage

3
Alachisoft

The Solution

Scalable In-Memory Distributed Cache

NCache
NCache

www.alachisoft.com

4
Alachisoft

What is an In-Memory Distributed Cache?
1.

Cluster of multiple inexpensive cache servers


2.

Synchronizes cache updates across all cache servers


3.

Cache updates are immediately visible from all cache servers

Linearly scales transaction & memory capacity


4.

Pools their memory and CPU into one logical capacity

Just add more cache servers to grow capacity

Replicates data for reliability


NCache

Intelligent replication without compromising performance & scalability

www.alachisoft.com

5
Alachisoft

NCache: In-Memory Distributed Cache
ASP.NET Web Apps

WCF Web Services

Grid Computing Apps
(.NET)

.NET Server Apps

Distributed Cache Cluster
Memory pooled from all cache servers

Scale Horizontally
Windows 2008/2012 (64-bit)

Filesystem

NCache

Database Servers

www.alachisoft.com

Mainframe

6
Alachisoft

What Data to Cache?
1.

Reference Data


2.

Transactional Data


3.

Does not change very frequently (but is not static)

Changes frequently (as frequently as in a few seconds)

Most Cached Data is Relational


NCache

Comes from relational databases

www.alachisoft.com

7
Alachisoft

Challenge: Cache versus Relational Data


Cache provides a Hashtable-like interface





Each item is separate and has a “key” and a “value”.
“Value” is usually an “object”

Relational data has relationships between entities


NCache

This is a challenge for your application

www.alachisoft.com

8
Alachisoft

Peek into Caching API


Read from the Cache






Add to the Cache






object obj = cache.Get(“myKey”);
object obj = cache[“myKey”];
bool isPresent = cache.Contains(“myKey”);

cache.Add(“myKey”, obj);
cache.Insert(“myKey”, obj);
cache[“myKey”] = obj;

Remove from the Cache


NCache

object obj = cache.Remove(“myKey”);

www.alachisoft.com

9
Alachisoft

First Step: Use CacheDependency


Lets you manage relationships in the cache




One cached item depends on another




A depends on B and B depends on C. Change in C triggers both A & B

Feature introduced by ASP.NET Cache




If target cached item updated/removed, dependent automatically removed

Cascaded dependencies possible




Cache keeps track of a one-way “dependency” between cached items

Key based dependency is our focus here

NCache also provides it

NCache

www.alachisoft.com

10
Alachisoft

Second Step: Use Object Relational Mapping


Benefits of O/R Mapping





Benefits of O/R Mapping Tools






Cut down development time
Improve code quality in persistence & domain objects
Simplifies programming. No need to directly use ADO.NET

Which O/R Mapping Tools to Use?





Simplifies programming by mapping domain objects to data model
Promotes code reuse of persistence and domain objects

Entity Framework (Microsoft)
NHibernate (Open Source)

At Least Map Domain Objects to Database




NCache

Map to database entities
Capture relationships in these objects
Transform DataReader or DataTable into domain objects

www.alachisoft.com

11
Alachisoft

Mapping Domain Objects to Database
Data Model

NCache

www.alachisoft.com

12
Alachisoft

What is a Primary Object?


It is a domain object




Starting point for the application





Mapped to a table in the database

Application fetches this objects first
All other objects fetched in relation to this object

All other objects fetched in relation to this object


NCache

One-to-many and many-to-one relationships

www.alachisoft.com

13
Alachisoft

Mapping Domain Objects to Database

NCache

www.alachisoft.com

14
Alachisoft

1-1/n-1 Relationships in Distributed Cache


Strategy 1: cache related object with primary object



Strategy 2: cache related object separately

NCache

www.alachisoft.com

15
Alachisoft

1-1/n-1 Relationships in Distributed Cache
Cache related object with primary object

NCache

www.alachisoft.com

16
Alachisoft

1-1/n-1 Relationships in Distributed Cache
Cache related object separately

NCache

www.alachisoft.com

17
Alachisoft

1-n Relationships in Distributed Cache


Strategy 1: cache related objects collection with primary object




Strategy 2: cache related objects separately separately




Cache entire collection as part of the primary object

Cache entire collection as one item but separately

Strategy 3: cache related objects from collections separately


NCache

Cache each item of the collection separately

www.alachisoft.com

18
Alachisoft

1-n Relationships in Distributed Cache
Cache related object collection separately

NCache

www.alachisoft.com

19
Alachisoft

1-n Relationships in Distributed Cache
Cache each object in related collection separately

NCache

www.alachisoft.com

20
Alachisoft

m-n Relationships in Distributed Cache


Many-to-many relationships don’t exist in domain objects



Instead, represented by two one-to-many relationships




E.g. Customer->Orders and Product->Orders

Intermediary object contains many-to-one references


NCache

E.g. Order has a reference to Customer and Product

www.alachisoft.com

21
Alachisoft

Handling Collections in Distributed Cache


Scenario 1: cache entire collection as one item



Scenario 2: cache each collection item separately

NCache

www.alachisoft.com

22
Alachisoft

Handling Collections in Distributed Cache
Cache entire collection as one item

NCache

www.alachisoft.com

23
Alachisoft

Handling Collections in Distributed Cache
Cache each collection item separately

NCache

www.alachisoft.com

24
Alachisoft

Hands on Demo

NCache

www.alachisoft.com

25
Alachisoft

Some Object Caching Features


Expirations






Locking (Pessimistic & Optimistic)





Lock/Unlock for pessimistic locking (writer-lock)
Object versioning for optimistic locking (reader-lock)

Bulk Operations




Absolute-time + idle-time
Auto-reload data on expiration (if read-thru enabled)

Bulk Get, Add, Insert, and Remove

Async Operations


NCache

Async Add, Insert, and Remove

www.alachisoft.com

26
Alachisoft

Synchronize Cache with Data Sources


Synchronize with Relational Databases (SQL, Oracle, etc.)







SqlDependency
OracleDependency
DbDependency

Synchronize with non-Relational Data Sources



NCache

File based Cache Dependency
Custom Cache Dependency

www.alachisoft.com

27
Alachisoft

Data Grouping in the Cache


Group/Subgroup



Tags



Named Tags

NCache

www.alachisoft.com

28
Alachisoft

Searching the Cache


Parallel Queries with Object Query Language (OQL)




Parallel LINQ Queries




SQL-like query language to search cache based on object attributes

Standard LINQ queries can search the cache

Indexing Object Attributes for Querying


NCache

Create indexes on object attributes to speed up queries

www.alachisoft.com

29
Alachisoft

Some Other Features


NHibernate L2 Cache Provider




Entity Framework L2 Cache




Plug into NHibernate application without any code change

Plug into Entity Framework application without any code change

Dynamic Compact Serialization



NCache

Faster and more compact then regular .NET serialization
No code writing required

www.alachisoft.com

30
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

31

Mais conteúdo relacionado

Mais procurados

HTTP Session Replication with Oracle Coherence, GlassFish, WebLogic
HTTP Session Replication with Oracle Coherence, GlassFish, WebLogicHTTP Session Replication with Oracle Coherence, GlassFish, WebLogic
HTTP Session Replication with Oracle Coherence, GlassFish, WebLogicOracle
 
Speed Up Your Existing Relational Databases with Hazelcast and Speedment
Speed Up Your Existing Relational Databases with Hazelcast and SpeedmentSpeed Up Your Existing Relational Databases with Hazelcast and Speedment
Speed Up Your Existing Relational Databases with Hazelcast and SpeedmentHazelcast
 
MySQL Cluster - Latest Developments (up to and including MySQL Cluster 7.4)
MySQL Cluster - Latest Developments (up to and including MySQL Cluster 7.4)MySQL Cluster - Latest Developments (up to and including MySQL Cluster 7.4)
MySQL Cluster - Latest Developments (up to and including MySQL Cluster 7.4)Andrew Morgan
 
Exadata MAA Best Practices
Exadata MAA Best PracticesExadata MAA Best Practices
Exadata MAA Best PracticesRui Sousa
 
Webinar slides: How to Measure Database Availability?
Webinar slides: How to Measure Database Availability?Webinar slides: How to Measure Database Availability?
Webinar slides: How to Measure Database Availability?Severalnines
 
New life inside monolithic application
New life inside monolithic applicationNew life inside monolithic application
New life inside monolithic applicationTaras Matyashovsky
 
What to expect from MariaDB Platform X5, part 1
What to expect from MariaDB Platform X5, part 1What to expect from MariaDB Platform X5, part 1
What to expect from MariaDB Platform X5, part 1MariaDB plc
 
Microsoft SQL Server Query Tuning
Microsoft SQL Server Query TuningMicrosoft SQL Server Query Tuning
Microsoft SQL Server Query TuningMark Ginnebaugh
 
Hazelcast 3.6 Roadmap Preview
Hazelcast 3.6 Roadmap PreviewHazelcast 3.6 Roadmap Preview
Hazelcast 3.6 Roadmap PreviewHazelcast
 
Visualizing Kafka Security
Visualizing Kafka SecurityVisualizing Kafka Security
Visualizing Kafka SecurityDataWorks Summit
 
eBay Cloud CMS - QCon 2012 - http://yidb.org/
eBay Cloud CMS - QCon 2012 - http://yidb.org/eBay Cloud CMS - QCon 2012 - http://yidb.org/
eBay Cloud CMS - QCon 2012 - http://yidb.org/Xu Jiang
 
Unified Batch & Stream Processing with Apache Samza
Unified Batch & Stream Processing with Apache SamzaUnified Batch & Stream Processing with Apache Samza
Unified Batch & Stream Processing with Apache SamzaDataWorks Summit
 
From cache to in-memory data grid. Introduction to Hazelcast.
From cache to in-memory data grid. Introduction to Hazelcast.From cache to in-memory data grid. Introduction to Hazelcast.
From cache to in-memory data grid. Introduction to Hazelcast.Taras Matyashovsky
 
Productizing a Cassandra-Based Solution (Brij Bhushan Ravat, Ericsson) | C* S...
Productizing a Cassandra-Based Solution (Brij Bhushan Ravat, Ericsson) | C* S...Productizing a Cassandra-Based Solution (Brij Bhushan Ravat, Ericsson) | C* S...
Productizing a Cassandra-Based Solution (Brij Bhushan Ravat, Ericsson) | C* S...DataStax
 
How to upgrade like a boss to my sql 8.0?
How to upgrade like a boss to my sql 8.0?How to upgrade like a boss to my sql 8.0?
How to upgrade like a boss to my sql 8.0?Alkin Tezuysal
 
Extreme Availability using Oracle 12c Features: Your very last system shutdown?
Extreme Availability using Oracle 12c Features: Your very last system shutdown?Extreme Availability using Oracle 12c Features: Your very last system shutdown?
Extreme Availability using Oracle 12c Features: Your very last system shutdown?Toronto-Oracle-Users-Group
 

Mais procurados (20)

HTTP Session Replication with Oracle Coherence, GlassFish, WebLogic
HTTP Session Replication with Oracle Coherence, GlassFish, WebLogicHTTP Session Replication with Oracle Coherence, GlassFish, WebLogic
HTTP Session Replication with Oracle Coherence, GlassFish, WebLogic
 
SQL Developer for DBAs
SQL Developer for DBAsSQL Developer for DBAs
SQL Developer for DBAs
 
Speed Up Your Existing Relational Databases with Hazelcast and Speedment
Speed Up Your Existing Relational Databases with Hazelcast and SpeedmentSpeed Up Your Existing Relational Databases with Hazelcast and Speedment
Speed Up Your Existing Relational Databases with Hazelcast and Speedment
 
MySQL Cluster - Latest Developments (up to and including MySQL Cluster 7.4)
MySQL Cluster - Latest Developments (up to and including MySQL Cluster 7.4)MySQL Cluster - Latest Developments (up to and including MySQL Cluster 7.4)
MySQL Cluster - Latest Developments (up to and including MySQL Cluster 7.4)
 
Exadata MAA Best Practices
Exadata MAA Best PracticesExadata MAA Best Practices
Exadata MAA Best Practices
 
Webinar slides: How to Measure Database Availability?
Webinar slides: How to Measure Database Availability?Webinar slides: How to Measure Database Availability?
Webinar slides: How to Measure Database Availability?
 
New life inside monolithic application
New life inside monolithic applicationNew life inside monolithic application
New life inside monolithic application
 
What to expect from MariaDB Platform X5, part 1
What to expect from MariaDB Platform X5, part 1What to expect from MariaDB Platform X5, part 1
What to expect from MariaDB Platform X5, part 1
 
Microsoft SQL Server Query Tuning
Microsoft SQL Server Query TuningMicrosoft SQL Server Query Tuning
Microsoft SQL Server Query Tuning
 
GemFire In-Memory Data Grid
GemFire In-Memory Data GridGemFire In-Memory Data Grid
GemFire In-Memory Data Grid
 
Hazelcast 3.6 Roadmap Preview
Hazelcast 3.6 Roadmap PreviewHazelcast 3.6 Roadmap Preview
Hazelcast 3.6 Roadmap Preview
 
Visualizing Kafka Security
Visualizing Kafka SecurityVisualizing Kafka Security
Visualizing Kafka Security
 
eBay Cloud CMS - QCon 2012 - http://yidb.org/
eBay Cloud CMS - QCon 2012 - http://yidb.org/eBay Cloud CMS - QCon 2012 - http://yidb.org/
eBay Cloud CMS - QCon 2012 - http://yidb.org/
 
Unified Batch & Stream Processing with Apache Samza
Unified Batch & Stream Processing with Apache SamzaUnified Batch & Stream Processing with Apache Samza
Unified Batch & Stream Processing with Apache Samza
 
Novinky v Oracle Database 18c
Novinky v Oracle Database 18cNovinky v Oracle Database 18c
Novinky v Oracle Database 18c
 
From cache to in-memory data grid. Introduction to Hazelcast.
From cache to in-memory data grid. Introduction to Hazelcast.From cache to in-memory data grid. Introduction to Hazelcast.
From cache to in-memory data grid. Introduction to Hazelcast.
 
Cassandra in e-commerce
Cassandra in e-commerceCassandra in e-commerce
Cassandra in e-commerce
 
Productizing a Cassandra-Based Solution (Brij Bhushan Ravat, Ericsson) | C* S...
Productizing a Cassandra-Based Solution (Brij Bhushan Ravat, Ericsson) | C* S...Productizing a Cassandra-Based Solution (Brij Bhushan Ravat, Ericsson) | C* S...
Productizing a Cassandra-Based Solution (Brij Bhushan Ravat, Ericsson) | C* S...
 
How to upgrade like a boss to my sql 8.0?
How to upgrade like a boss to my sql 8.0?How to upgrade like a boss to my sql 8.0?
How to upgrade like a boss to my sql 8.0?
 
Extreme Availability using Oracle 12c Features: Your very last system shutdown?
Extreme Availability using Oracle 12c Features: Your very last system shutdown?Extreme Availability using Oracle 12c Features: Your very last system shutdown?
Extreme Availability using Oracle 12c Features: Your very last system shutdown?
 

Semelhante a Handling Relational Data in a Distributed Cache

Four Ways to Improve ASP .NET Performance and Scalability
 Four Ways to Improve ASP .NET Performance and Scalability Four Ways to Improve ASP .NET Performance and Scalability
Four Ways to Improve ASP .NET Performance and ScalabilityAlachisoft
 
nHibernate Caching
nHibernate CachingnHibernate Caching
nHibernate CachingGuo Albert
 
Building High Performance and Scalable Applications Using AppFabric Cache- Im...
Building High Performance and Scalable Applications Using AppFabric Cache- Im...Building High Performance and Scalable Applications Using AppFabric Cache- Im...
Building High Performance and Scalable Applications Using AppFabric Cache- Im...Impetus Technologies
 
HBaseCon 2013: Using Coprocessors to Index Columns in an Elasticsearch Cluster
HBaseCon 2013: Using Coprocessors to Index Columns in an Elasticsearch Cluster HBaseCon 2013: Using Coprocessors to Index Columns in an Elasticsearch Cluster
HBaseCon 2013: Using Coprocessors to Index Columns in an Elasticsearch Cluster Cloudera, Inc.
 
HBaseCon 2013: Using Coprocessors to Index Columns in an Elasticsearch Cluster
HBaseCon 2013: Using Coprocessors to Index Columns in an Elasticsearch Cluster HBaseCon 2013: Using Coprocessors to Index Columns in an Elasticsearch Cluster
HBaseCon 2013: Using Coprocessors to Index Columns in an Elasticsearch Cluster Cloudera, Inc.
 
Microsoft Windows Server AppFabric
Microsoft Windows Server AppFabricMicrosoft Windows Server AppFabric
Microsoft Windows Server AppFabricMark Ginnebaugh
 
Architecting applications in the AWS cloud
Architecting applications in the AWS cloudArchitecting applications in the AWS cloud
Architecting applications in the AWS cloudCloud Genius
 
Introducing windows server_app_fabric
Introducing windows server_app_fabricIntroducing windows server_app_fabric
Introducing windows server_app_fabricMarco Titta
 
Academy PRO: HTML5 Data storage
Academy PRO: HTML5 Data storageAcademy PRO: HTML5 Data storage
Academy PRO: HTML5 Data storageBinary Studio
 
Html5 cache mechanism & local storage
Html5 cache mechanism & local storageHtml5 cache mechanism & local storage
Html5 cache mechanism & local storageSendhil Kumar Kannan
 
Scaling to millions of users with Amazon CloudFront - April 2017 AWS Online T...
Scaling to millions of users with Amazon CloudFront - April 2017 AWS Online T...Scaling to millions of users with Amazon CloudFront - April 2017 AWS Online T...
Scaling to millions of users with Amazon CloudFront - April 2017 AWS Online T...Amazon Web Services
 
Red Hat Storage Day New York - Persistent Storage for Containers
Red Hat Storage Day New York - Persistent Storage for ContainersRed Hat Storage Day New York - Persistent Storage for Containers
Red Hat Storage Day New York - Persistent Storage for ContainersRed_Hat_Storage
 
Data Streaming with Apache Kafka & MongoDB
Data Streaming with Apache Kafka & MongoDBData Streaming with Apache Kafka & MongoDB
Data Streaming with Apache Kafka & MongoDBconfluent
 
MayaData Datastax webinar - Operating Cassandra on Kubernetes with the help ...
MayaData  Datastax webinar - Operating Cassandra on Kubernetes with the help ...MayaData  Datastax webinar - Operating Cassandra on Kubernetes with the help ...
MayaData Datastax webinar - Operating Cassandra on Kubernetes with the help ...MayaData Inc
 
Extending Analytic Reach - From The Warehouse to The Data Lake by Mike Limcaco
Extending Analytic Reach - From The Warehouse to The Data Lake by Mike LimcacoExtending Analytic Reach - From The Warehouse to The Data Lake by Mike Limcaco
Extending Analytic Reach - From The Warehouse to The Data Lake by Mike LimcacoData Con LA
 

Semelhante a Handling Relational Data in a Distributed Cache (20)

Four Ways to Improve ASP .NET Performance and Scalability
 Four Ways to Improve ASP .NET Performance and Scalability Four Ways to Improve ASP .NET Performance and Scalability
Four Ways to Improve ASP .NET Performance and Scalability
 
nHibernate Caching
nHibernate CachingnHibernate Caching
nHibernate Caching
 
Building High Performance and Scalable Applications Using AppFabric Cache- Im...
Building High Performance and Scalable Applications Using AppFabric Cache- Im...Building High Performance and Scalable Applications Using AppFabric Cache- Im...
Building High Performance and Scalable Applications Using AppFabric Cache- Im...
 
HBaseCon 2013: Using Coprocessors to Index Columns in an Elasticsearch Cluster
HBaseCon 2013: Using Coprocessors to Index Columns in an Elasticsearch Cluster HBaseCon 2013: Using Coprocessors to Index Columns in an Elasticsearch Cluster
HBaseCon 2013: Using Coprocessors to Index Columns in an Elasticsearch Cluster
 
HBaseCon 2013: Using Coprocessors to Index Columns in an Elasticsearch Cluster
HBaseCon 2013: Using Coprocessors to Index Columns in an Elasticsearch Cluster HBaseCon 2013: Using Coprocessors to Index Columns in an Elasticsearch Cluster
HBaseCon 2013: Using Coprocessors to Index Columns in an Elasticsearch Cluster
 
Microsoft Windows Server AppFabric
Microsoft Windows Server AppFabricMicrosoft Windows Server AppFabric
Microsoft Windows Server AppFabric
 
Architecting applications in the AWS cloud
Architecting applications in the AWS cloudArchitecting applications in the AWS cloud
Architecting applications in the AWS cloud
 
Branch office access with branch cache
Branch office access with branch cacheBranch office access with branch cache
Branch office access with branch cache
 
Introducing windows server_app_fabric
Introducing windows server_app_fabricIntroducing windows server_app_fabric
Introducing windows server_app_fabric
 
Caching By Nyros Developer
Caching By Nyros DeveloperCaching By Nyros Developer
Caching By Nyros Developer
 
Academy PRO: HTML5 Data storage
Academy PRO: HTML5 Data storageAcademy PRO: HTML5 Data storage
Academy PRO: HTML5 Data storage
 
Html5 cache mechanism & local storage
Html5 cache mechanism & local storageHtml5 cache mechanism & local storage
Html5 cache mechanism & local storage
 
1Z0_997_21__5_.pdf.pdf
1Z0_997_21__5_.pdf.pdf1Z0_997_21__5_.pdf.pdf
1Z0_997_21__5_.pdf.pdf
 
Ror caching
Ror cachingRor caching
Ror caching
 
Scaling to millions of users with Amazon CloudFront - April 2017 AWS Online T...
Scaling to millions of users with Amazon CloudFront - April 2017 AWS Online T...Scaling to millions of users with Amazon CloudFront - April 2017 AWS Online T...
Scaling to millions of users with Amazon CloudFront - April 2017 AWS Online T...
 
Red Hat Storage Day New York - Persistent Storage for Containers
Red Hat Storage Day New York - Persistent Storage for ContainersRed Hat Storage Day New York - Persistent Storage for Containers
Red Hat Storage Day New York - Persistent Storage for Containers
 
Data Streaming with Apache Kafka & MongoDB
Data Streaming with Apache Kafka & MongoDBData Streaming with Apache Kafka & MongoDB
Data Streaming with Apache Kafka & MongoDB
 
MayaData Datastax webinar - Operating Cassandra on Kubernetes with the help ...
MayaData  Datastax webinar - Operating Cassandra on Kubernetes with the help ...MayaData  Datastax webinar - Operating Cassandra on Kubernetes with the help ...
MayaData Datastax webinar - Operating Cassandra on Kubernetes with the help ...
 
Extending Analytic Reach - From The Warehouse to The Data Lake by Mike Limcaco
Extending Analytic Reach - From The Warehouse to The Data Lake by Mike LimcacoExtending Analytic Reach - From The Warehouse to The Data Lake by Mike Limcaco
Extending Analytic Reach - From The Warehouse to The Data Lake by Mike Limcaco
 
Extending Analytic Reach
Extending Analytic ReachExtending Analytic Reach
Extending Analytic Reach
 

Último

Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 

Último (20)

Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 

Handling Relational Data in a Distributed Cache

  • 1. Alachisoft .NET Performance Solutions How to Handle Relational Data in a Distributed Cache Iqbal Khan iqbal@alachisoft.com Ph: +1 (925) 236-2125 www.alachisoft.com 1
  • 2. Alachisoft Following Applications Need Scalability 1. ASP.NET Apps  2. WCF & .NET Web Services  3. To quickly process very large amounts of data thru distribution Grid Computing Apps  5. To handle millions of requests Big Data Apps  4. To handle millions of users To process very large computations thru distribution Other .NET Server Apps  NCache To handle millions of requests www.alachisoft.com 2
  • 3. Alachisoft Data Storage is Scalability Bottleneck ASP.NET/WCF Example App Database ASP.NET/WCF Servers Database Servers Data Access Scale Web Farm Web Clients Http Calls ... NCache Load Balancer www.alachisoft.com ASP.NET Session Storage 3
  • 4. Alachisoft The Solution Scalable In-Memory Distributed Cache NCache NCache www.alachisoft.com 4
  • 5. Alachisoft What is an In-Memory Distributed Cache? 1. Cluster of multiple inexpensive cache servers  2. Synchronizes cache updates across all cache servers  3. Cache updates are immediately visible from all cache servers Linearly scales transaction & memory capacity  4. Pools their memory and CPU into one logical capacity Just add more cache servers to grow capacity Replicates data for reliability  NCache Intelligent replication without compromising performance & scalability www.alachisoft.com 5
  • 6. Alachisoft NCache: In-Memory Distributed Cache ASP.NET Web Apps WCF Web Services Grid Computing Apps (.NET) .NET Server Apps Distributed Cache Cluster Memory pooled from all cache servers Scale Horizontally Windows 2008/2012 (64-bit) Filesystem NCache Database Servers www.alachisoft.com Mainframe 6
  • 7. Alachisoft What Data to Cache? 1. Reference Data  2. Transactional Data  3. Does not change very frequently (but is not static) Changes frequently (as frequently as in a few seconds) Most Cached Data is Relational  NCache Comes from relational databases www.alachisoft.com 7
  • 8. Alachisoft Challenge: Cache versus Relational Data  Cache provides a Hashtable-like interface    Each item is separate and has a “key” and a “value”. “Value” is usually an “object” Relational data has relationships between entities  NCache This is a challenge for your application www.alachisoft.com 8
  • 9. Alachisoft Peek into Caching API  Read from the Cache     Add to the Cache     object obj = cache.Get(“myKey”); object obj = cache[“myKey”]; bool isPresent = cache.Contains(“myKey”); cache.Add(“myKey”, obj); cache.Insert(“myKey”, obj); cache[“myKey”] = obj; Remove from the Cache  NCache object obj = cache.Remove(“myKey”); www.alachisoft.com 9
  • 10. Alachisoft First Step: Use CacheDependency  Lets you manage relationships in the cache   One cached item depends on another   A depends on B and B depends on C. Change in C triggers both A & B Feature introduced by ASP.NET Cache   If target cached item updated/removed, dependent automatically removed Cascaded dependencies possible   Cache keeps track of a one-way “dependency” between cached items Key based dependency is our focus here NCache also provides it NCache www.alachisoft.com 10
  • 11. Alachisoft Second Step: Use Object Relational Mapping  Benefits of O/R Mapping    Benefits of O/R Mapping Tools     Cut down development time Improve code quality in persistence & domain objects Simplifies programming. No need to directly use ADO.NET Which O/R Mapping Tools to Use?    Simplifies programming by mapping domain objects to data model Promotes code reuse of persistence and domain objects Entity Framework (Microsoft) NHibernate (Open Source) At Least Map Domain Objects to Database    NCache Map to database entities Capture relationships in these objects Transform DataReader or DataTable into domain objects www.alachisoft.com 11
  • 12. Alachisoft Mapping Domain Objects to Database Data Model NCache www.alachisoft.com 12
  • 13. Alachisoft What is a Primary Object?  It is a domain object   Starting point for the application    Mapped to a table in the database Application fetches this objects first All other objects fetched in relation to this object All other objects fetched in relation to this object  NCache One-to-many and many-to-one relationships www.alachisoft.com 13
  • 14. Alachisoft Mapping Domain Objects to Database NCache www.alachisoft.com 14
  • 15. Alachisoft 1-1/n-1 Relationships in Distributed Cache  Strategy 1: cache related object with primary object  Strategy 2: cache related object separately NCache www.alachisoft.com 15
  • 16. Alachisoft 1-1/n-1 Relationships in Distributed Cache Cache related object with primary object NCache www.alachisoft.com 16
  • 17. Alachisoft 1-1/n-1 Relationships in Distributed Cache Cache related object separately NCache www.alachisoft.com 17
  • 18. Alachisoft 1-n Relationships in Distributed Cache  Strategy 1: cache related objects collection with primary object   Strategy 2: cache related objects separately separately   Cache entire collection as part of the primary object Cache entire collection as one item but separately Strategy 3: cache related objects from collections separately  NCache Cache each item of the collection separately www.alachisoft.com 18
  • 19. Alachisoft 1-n Relationships in Distributed Cache Cache related object collection separately NCache www.alachisoft.com 19
  • 20. Alachisoft 1-n Relationships in Distributed Cache Cache each object in related collection separately NCache www.alachisoft.com 20
  • 21. Alachisoft m-n Relationships in Distributed Cache  Many-to-many relationships don’t exist in domain objects  Instead, represented by two one-to-many relationships   E.g. Customer->Orders and Product->Orders Intermediary object contains many-to-one references  NCache E.g. Order has a reference to Customer and Product www.alachisoft.com 21
  • 22. Alachisoft Handling Collections in Distributed Cache  Scenario 1: cache entire collection as one item  Scenario 2: cache each collection item separately NCache www.alachisoft.com 22
  • 23. Alachisoft Handling Collections in Distributed Cache Cache entire collection as one item NCache www.alachisoft.com 23
  • 24. Alachisoft Handling Collections in Distributed Cache Cache each collection item separately NCache www.alachisoft.com 24
  • 26. Alachisoft Some Object Caching Features  Expirations    Locking (Pessimistic & Optimistic)    Lock/Unlock for pessimistic locking (writer-lock) Object versioning for optimistic locking (reader-lock) Bulk Operations   Absolute-time + idle-time Auto-reload data on expiration (if read-thru enabled) Bulk Get, Add, Insert, and Remove Async Operations  NCache Async Add, Insert, and Remove www.alachisoft.com 26
  • 27. Alachisoft Synchronize Cache with Data Sources  Synchronize with Relational Databases (SQL, Oracle, etc.)     SqlDependency OracleDependency DbDependency Synchronize with non-Relational Data Sources   NCache File based Cache Dependency Custom Cache Dependency www.alachisoft.com 27
  • 28. Alachisoft Data Grouping in the Cache  Group/Subgroup  Tags  Named Tags NCache www.alachisoft.com 28
  • 29. Alachisoft Searching the Cache  Parallel Queries with Object Query Language (OQL)   Parallel LINQ Queries   SQL-like query language to search cache based on object attributes Standard LINQ queries can search the cache Indexing Object Attributes for Querying  NCache Create indexes on object attributes to speed up queries www.alachisoft.com 29
  • 30. Alachisoft Some Other Features  NHibernate L2 Cache Provider   Entity Framework L2 Cache   Plug into NHibernate application without any code change Plug into Entity Framework application without any code change Dynamic Compact Serialization   NCache Faster and more compact then regular .NET serialization No code writing required www.alachisoft.com 30
  • 31. 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 31