250 likes | 578 Views
Google Trends. Agenda. Introduction Code Examples Demo Internals Q/A. Introduction. Inâ€Memory Data Grid (IMDG ) Clustering and highly scalable data distribution solution for Java Distributed Data Structures for Java. ä¸»è¦ æ¦‚å¿µ. 主è¦å®žçŽ°ä¸€ï¼š Queue , Set, List, Map
E N D
Agenda • Introduction • Code Examples • Demo • Internals • Q/A
Introduction • In‐Memory Data Grid (IMDG) • Clustering and highly scalable data distribution solution for Java • Distributed Data Structures for Java
主要概念 • 主要实现一:Queue, Set, List, Map • 主要实现二:主题(Topic),发布订阅者模式 • 主要实现三:java.util.concurrent.ExecutorService • 事务支持(Transaction support and J2EE container integration via JCA) • 分布式事件通知机制和监听器(listener & events) 元素级别:CRUD(item&entry) 节点级别:节点信息或者添加删除通知(集群) • Dynamic HTTP session clustering • Dynamic clustering(同一个JVM或者不同JVM) • 动态分区(节点平分数据)和备份(backup) • 动态的故障切换
Why Hazelcast? • Share data across cluster • Partition your data • Send/receive messages (类MQ) • Balance the load • 使用简单: include a single jar • 高性能: thousands of operations per sec • Super small:less than a MB
Solutions in the Market • Oracle Coherence • IBM WebSphereeXtreme Scale / ObjectGrid • JBossCache/JGroups/Infinispan • ……
Difference • License / Cost • Main focus (distributed map, tuple space, cache , processing vs. data) • Light/Heavy weight
The Result is ? • Open source (Apache License) • Super light, simple, no‐dependency • Distributed/partitioned implementation of map, queue , set, list, lock and executor service • Transactional (JCA support) • Topic for pub/sub messaging • Cluster info and membership events • Dynamic clustering, backup, fail‐over
Code Samples--others • Set • Lock • Topic • Listener and Events • Service Executors • ……
Configuration <hazelcast> <group> <name>dev</name> <password>dev-pass</password> </group> <network> <port auto-increment="true">5701</port> <join> <multicast enabled="true"> <multicast-group>224.2.2.3</multicast-group> <multicast-port>54327</multicast-port> </multicast> <tcp-ip enabled="false"> <interface>192.168.1.2-5</interface> <hostname>istanbul.acme</hostname> </tcp-ip> </join> <interfaces enabled="false"> <interface>10.3.17.*</interface> </interfaces> </network> <queue name="default"> <max-size-per-jvm>10000</max-size-per-jvm> <time-to-live-seconds>60</time-to-live-seconds> </queue> <map name="default"> <backup-count>1</backup-count> <time-to-live-seconds>60</time-to-live-seconds> <max-size>10000</max-size> <eviction-policy>LRU</eviction-policy> <eviction-percentage>25</eviction-percentage> </map> </hazelcast>
Internals : Cluster Membership • Multicast and Unicast Discovery • Every member sends heartbeats to the oldest member • Oldest Member manages the memberships -- Sends member list -- Tells members to sync their data
Internals : Others • Threads • Serialization • ObjectPool • Sockets • Distributed Map • Distributed Queue
Questions? • http://www.hazelcast.com • http://code.google.com/p/hazelcast/ • hazelcast@googlegroups.com • http://www.linkedin.com/in/talipozturk