Top Banner
Hazelcast Web Session Replication
24

Web session replication with Hazelcast

Apr 06, 2017

Download

Software

Emrah Kocaman
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Web session replication with Hazelcast

Hazelcast Web Session Replication

Page 2: Web session replication with Hazelcast

About me

E M R A H K O C A M A N @emrahkocaman

[email protected]

Page 3: Web session replication with Hazelcast

What Is Hazelcast?

Hazelcast is a distributed, highly available and scalable

Open Source In-Memory Data Grid

Page 4: Web session replication with Hazelcast

In Memory Data Grid

010011010101010

In Memory Data Computing

In Memory Data Messaging + + In Memory

Data Storage

Page 5: Web session replication with Hazelcast

IM Data Store (Caching) Use CaseDatabase Caching Use-Case

Business Systems

A B C

RDBMS Mainframe MongoDBNoSQL REST

ScaleHazelcast

HD Cache

Dist. Compute

Dist. Message

Page 6: Web session replication with Hazelcast

Hazelcast Servers

Hazelcast ServerJVM [Memory]

IM Distributed Computing Use Case

A B C

Business Logic

Data Data Data

CE = Compute Engine

Result

Business / Processing Logic

Result

TCP / IP

Client Client

HD Cache

Dist. Compute

Dist. Message

Page 7: Web session replication with Hazelcast

IM Distributed Messaging Use Case

Hazelcast Distributed Topic Bus

HazelcastTopic

HazelcastNode 1

HazelcastNode 2

HazelcastNode 3

MSG

Subscribes

Delivers

Subscribes

Delivers

HD Cache

Dist. Compute

Dist. Message

Page 8: Web session replication with Hazelcast

Why Hazelcast?

Scale-out Computing enables cluster capacity to be increased or decreased on-demand

Resilience with automatic recovery from member failures without losing data while minimizing performance impact on running applications

Programming Model provides a way for developers to easily program a cluster application as if it is a single process

Fast Application Performance enables very large data sets to be held in main memory for real-time performance

Page 9: Web session replication with Hazelcast

World-Class Customers

TELECOMMUNICATIONS

BANKING & FINANCIAL SERVICES

HIGH-TECH

LOGISTICS

INSURANCE

GAMING & ENTERTAINMENT

CONSUMER & ECOMMERCE

Page 10: Web session replication with Hazelcast

Ecosystem TractionDozens of Commercial and Open Source Projects Embed Hazelcast

Page 11: Web session replication with Hazelcast

Feature Overview

Page 12: Web session replication with Hazelcast

Map Set Queue Lock/ Sem. Atomics Topic User

DefinedMultiMap RingBuffer

Hazelcast In-memory Computing Platform

Java

C++ .NET

Portable Serialization / Pluggable Serialization

Memcached REST Internal Client Network Protocol

java.util.concurrent.*javax.cache.*Hibernate 2nd Level Cache

Executor ServiceSQL Query Map / Reduce Aggregation

Low-level Services API

Node Engine (Threads, Instances, Eventing, Wait/Notify, Invocation)

Partition Management(Master Partition, Data Affinity, Replicas, Migrations, Partition Groups)

Cluster Management(Multicast, IP List, AWS/OpenStack)

Networking(IPv4, IPv6)

On-heap Storage

Managem

ent Center

(AP

I, JMX

)

Security(C

onnection, Encryption, A

uthentication, Authorization)

WA

N(Topology Aw

are Partition M

anagement, W

AN

Replication)

Hazelcast Open Source Hazelcast Enterprise

Hazelcast Architecture

Predicate Entry Processor

High-Density (HD) Memory Store

Continuous Query

HD Near Cache

Open Client Network Protocol

Hot Restart Store*

* Coming in 3.6

Web Sessions

Page 13: Web session replication with Hazelcast

Web Session Replication

Page 14: Web session replication with Hazelcast

Web Session Replication

• Web Session Replication is replicating web session to other members of the cluster each time there is a change in the session data.

Page 15: Web session replication with Hazelcast

Use Case

Page 16: Web session replication with Hazelcast

Use Case

Page 17: Web session replication with Hazelcast

Use Case

Page 18: Web session replication with Hazelcast

Deployment Options

Great for early stages of rapid application development and iteration

Necessary for scale up or scale out deployments – decouples upgrading of clients and cluster for long term TCO

Embedded Hazelcast

Hazelcast Node 1

Applications

Java API

Client-Server Mode

Hazelcast Node 3

Java API

Applications

Java API

Applications

Java API

Applications

Hazelcast Node 2

Hazelcast Node 1

Hazelcast Node 2

Applications

Java API

Hazelcast Node 3

Applications

Java API

Page 19: Web session replication with Hazelcast

Generic Web Session Replication

• Filter Based • Servlet Container Agnostic • Runs on any container that supports Servlet 3.0 • Configured in “web.xml” • Spring Security Support • Client/P2P Mode • Deferred write • Sticky/Non-Sticky session support

Page 20: Web session replication with Hazelcast

Configuration

<filter> <filter-name>hazelcast-filter</filter-name> <filter-class>com.hazelcast.web.WebFilter</filter-class> <init-param> <param-name>map-name</param-name> <param-value>my-sessions</param-value> </init-param> <init-param> <param-name>sticky-session</param-name> <param-value>true</param-value> </init-param> </filter> <filter-mapping> <filter-name>hazelcast-filter</filter-name> <url-pattern>/*</url-pattern> <dispatcher>FORWARD</dispatcher> <dispatcher>INCLUDE</dispatcher> <dispatcher>REQUEST</dispatcher> </filter-mapping> <listener> <listener-class>com.hazelcast.web.SessionListener</listener-class> </listener>

Page 21: Web session replication with Hazelcast

Tomcat Session Replication

• Tomcat 6, 7 & 8 • Easy to set up • No need to modify applications • Put a <Listener> element into the file $CATALINA_HOME$/conf/

server.xml

• Put a <Manager> element into the file $CATALINA_HOME$/conf/context.xml

Page 22: Web session replication with Hazelcast

Jetty Session Replication

• Jetty 7,8 & 9

Page 23: Web session replication with Hazelcast

Demo

Page 24: Web session replication with Hazelcast

Thank you