Atomix
Distributed Fighters
Me
!2
Senior Software Engineer
Program Committee Member
andriyrav@gmail.com
Andriy Rymar
@AndriyRymar Morning@Lohika
Lviv Java Club Co-founder
https://github.com/lvivJavaClub
Content
!3
Cluster
Intro
Demo
Testing
Primitives
#jeeconf_atomix
!4
#jeeconf_atomix
!5
#jeeconf_atomix
Intro
!6
#jeeconf_atomix
Atomix
A reactive Java framework
for building fault-tolerant
distributed systems
What?
!7
#jeeconf_atomix
Analogy
Spring MVC
Spring Web Services
GWT
MVC
SOAP
UI
!8
#jeeconf_atomix
Atomix
systems
Build
distributed
!9
#jeeconf_atomix
Distributed System
What?
!10
#jeeconf_atomix
Examples
Yes
Yes
No
MS vs DS
!11
#jeeconf_atomix
S1
S2
S3
Micro-Services Distributed System
Node Node
Node Node
Node
S1
S2
S3
Apache Spark
APIGateway
Distributed System
!12
#jeeconf_atomix
Why?
Scalability
Speed
Reliability
Distributed System
!13
#jeeconf_atomix
Examples?
Big Data processing
Multi-task execution
Distributed System
!14
#jeeconf_atomix
How?
What is the first letter
in English alphabet?
A: C
C: A
B: D
D: B
Distributed System
!15
#jeeconf_atomix
Distributed System
!16
https://giphy.com/gifs/filmeditor-interested-airplane-movie-l4FARHkIFJReGSy2c
#jeeconf_atomix
Distributed System
!17
https://giphy.com/gifs/jNcGVJueKi51u
#jeeconf_atomix
Issues
!18
#jeeconf_atomix
Scalability
Fault tolerance
Coordination
etc.
!19
#jeeconf_atomix
Atomix
!20
#jeeconf_atomix
Cluster
Ephemeral
Member
!21
#jeeconf_atomix
Id Type Address
Persistent
Local
Remote
Member
!22
#jeeconf_atomix
Member.builder("member1")
.build();
.withAddress("localhost",5000)
.withType(Member.Type.EPHEMERAL)
Atomix Instance
!23
#jeeconf_atomix
Member 1 Member 2 Member 3
Configuration
Atomix Instance
!24
#jeeconf_atomix
.withMembers(member1, member2)
Atomix.builder()
.withLocalMember(localMember)
.withManagementGroup(systemGroup)
.withPartitionGroups(dataGroup)
.build();
Management Group
!25
#jeeconf_atomix
Partition Groups
!26
#jeeconf_atomix
Groups
!27
#jeeconf_atomix
Raft
RAFT

The Raft protocol is a consensus protocol
developed in 2013. Consensus protocols are
partition tolerant and provide strong
consistency guarantees (linearizability,
sequential consistency) that can be useful for
coordination. However, strong consistency
comes with a cost in terms of configuration
and performance.

Critically, Raft partition groups require explicitly
defined membership. Each Raft group must
identify the cluster members on which the
group’s partitions will be replicated at startup.
Without explicitly defined membership, Raft
partitions may experience split brain when a
network partition occurs while bootstrapping
the cluster.

The Raft partition group’s members must
be PERSISTENT. This constraint exists
because the semantics of persistent members
accurately reflect the semantics of Raft cluster
members: even after a Raft node crashes, the
quorum size remains the same and the node
still counts towards vote tallies.

PB

Even with sharding, Raft partition groups can
be limited in their scalability. Writes to Raft
partitions must be synchronously replicated to
a majority of the cluster and must be flushed to
disk prior to completion of a write operation.
Primary-backup partition groups are a more
efficient alternative to Raft partitions. Primary-
backup replication works by electing a leader
through which writes are replicated. The leader
replicates to n backups based on the primitive
configuration. Primary-backup partitions are
Primary-Backup
!28
#jeeconf_atomix
Primitives
Primitives
!29
#jeeconf_atomix
Consistent Map
Consistent Multimap
Distributed Set
Atomic Value
etc.
Distributed Lock
Work Queue
etc.
Data Coordination
Sync API
!30
#jeeconf_atomix
ConsistentMap<String, String> map =
atomix.consistentMapBuilder("my-map")
.withNullValues()
.withCacheEnabled()
.withCacheSize(100)
.build();
Async API
!31
#jeeconf_atomix
AsyncConsistentMap<String, String> map =
atomix.consistentMapBuilder("my-map")
.withNullValues()
.withCacheEnabled()
.withCacheSize(100)
.build().async();
Custom Primitives
!32
#jeeconf_atomix
!33
#jeeconf_atomix
Demo
!34
#jeeconf_atomix
Fight
http://www.pngmart.com/image/10875 http://ru.mortalkombat.wikia.com/wiki/Файл:MKX_Sub-Zero.png
Member 1 Member 2
Description
!35 http://www.mortalkombatwarehouse.com/mk/scorpion/http://www.mortalkombatwarehouse.com/mk/subzero/
https://www.toyshow.com.br/colecionaveis/action-figures/boneco-shao-kahn-mortal-kombat-classic-special-edition-112-storm-collectibles
3
1
2
Module : Judge
Module : Fighter 1 Module : Fighter 2
#jeeconf_atomix
Description
!36 http://www.mortalkombatwarehouse.com/mk/scorpion/http://www.mortalkombatwarehouse.com/mk/subzero/
https://www.toyshow.com.br/colecionaveis/action-figures/boneco-shao-kahn-mortal-kombat-classic-special-edition-112-storm-collectibles https://orig00.deviantart.net/18ef/f/2015/108/b/3/fire_and_ice__mortal_kombat_and_dota_2__by_mfp189-d8q8l2p.png
3
1
2
Module : Judge
Module : Fighter 1 Module : Fighter 2
UI
#jeeconf_atomix
4
Architecture
!37 http://www.mortalkombatwarehouse.com/mk/scorpion/http://www.mortalkombatwarehouse.com/mk/subzero/
https://www.toyshow.com.br/colecionaveis/action-figures/boneco-shao-kahn-mortal-kombat-classic-special-edition-112-storm-collectibles https://orig00.deviantart.net/18ef/f/2015/108/b/3/fire_and_ice__mortal_kombat_and_dota_2__by_mfp189-d8q8l2p.png
Judge
UI
Fighter
Atomix Instance
Atomix Instance
2 x
Registration Set Health Map Attack Map
#jeeconf_atomix
AtomixInstance
Lets GO!
!38 http://www.mortalkombatwarehouse.com/mk/scorpion/http://www.mortalkombatwarehouse.com/mk/subzero/
#jeeconf_atomix
!39
#jeeconf_atomix
Hope it was interesting
https://www.catersnews.com/wp-content/uploads/2014/12/CATERS_Puss_In_Boots_03-457x773.jpeg
!40
#jeeconf_atomix
https://www.catersnews.com/wp-content/uploads/2014/12/CATERS_Puss_In_Boots_03-457x773.jpeg
!41
#jeeconf_atomix
https://www.catersnews.com/wp-content/uploads/2014/12/CATERS_Puss_In_Boots_03-457x773.jpeg
!42
#jeeconf_atomix
КОжен раз коли робите Коміт /
Пуш
https://www.catersnews.com/wp-content/uploads/2014/12/CATERS_Puss_In_Boots_03-457x773.jpeg
!43
#jeeconf_atomix
Testing
Testing
!44
#jeeconf_atomix
Write synchronous code
Use workarounds
Wait for Atomix-Tests
!45
#jeeconf_atomix
Out of scope
Out of scope
!46
#jeeconf_atomix
Standalone agent
REST API
Messaging
Profiles
!47
#jeeconf_atomix
Summary
Summary
!48
#jeeconf_atomix
Easy
Flexible
Young
Meet
!49
#jeeconf_atomix
Jordan Halterman
2) How Atomix resolve conflicts? 
1) Which parts of CAP theorem Atomix supports
4) Who use Atomix in production
5) Atomix best-practices
3) What are the closest competitors to Atomix?
Atomix Founder
Interview
!50
#jeeconf_atomix
Jordan Halterman
Atomix Founder https://youtu.be/qJ4DOuLLryc
!51
Thank You!
https://thumbs.gfycat.com/DefiantGrandEmeraldtreeskink-size_restricted.gif
Questions
!52
#jeeconf_atomix
andriyrav@gmail.com
Andriy Rymar
@AndriyRymar
Become a speakerContacts
Morning@Lohika

Atomix & Distributed Fighters