building)consistentand)highly)available)distributed ... ·...

16
Apache®, Apache Ignite, Ignite®, and the Apache Ignite logo are either registered trademarks or trademarks of the Apache So8ware Founda<on in the United States and/or other countries. Valen<n Kulichenko GridGain Lead Architect Apache Ignite PMC Building Consistent and Highly Available Distributed Systems with Apache Ignite TM and GridGain

Upload: others

Post on 10-Aug-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Building)Consistentand)Highly)Available)Distributed ... · Apache®,)Apache)Ignite,)Ignite®,)and)the)Apache)Ignite)logo)are)either)registered)trademarks)or)trademarks)of)the)Apache)So8ware)Foundaon)in)the)United)States)and

Apache®,  Apache  Ignite,  Ignite®,  and  the  Apache  Ignite  logo  are  either  registered  trademarks  or  trademarks  of  the  Apache  So8ware  Founda<on  in  the  United  States  and/or  other  countries.  

Valen<n  Kulichenko  GridGain  Lead  Architect  Apache  Ignite  PMC  

Building  Consistent  and  Highly  Available  Distributed  Systems  with  Apache  IgniteTM  and  GridGain  

Page 2: Building)Consistentand)Highly)Available)Distributed ... · Apache®,)Apache)Ignite,)Ignite®,)and)the)Apache)Ignite)logo)are)either)registered)trademarks)or)trademarks)of)the)Apache)So8ware)Foundaon)in)the)United)States)and

Apache®,  Apache  Ignite,  Ignite®,  and  the  Apache  Ignite  logo  are  either  registered  trademarks  or  trademarks  of  the  Apache  So8ware  Founda<on  in  the  United  States  and/or  other  countries.  

Agenda  •  What  is  Ignite  and  GridGain  •  Ignite  and  CAP  Theorem  •  High  Availability  in  Ignite  

–  Cache  Backups  –  Persistence  –  Data  Center  Replica<on  –  Data  Snapshots  (+  Demo)  

•  Q&A  

Page 3: Building)Consistentand)Highly)Available)Distributed ... · Apache®,)Apache)Ignite,)Ignite®,)and)the)Apache)Ignite)logo)are)either)registered)trademarks)or)trademarks)of)the)Apache)So8ware)Foundaon)in)the)United)States)and

Apache®,  Apache  Ignite,  Ignite®,  and  the  Apache  Ignite  logo  are  either  registered  trademarks  or  trademarks  of  the  Apache  So8ware  Founda<on  in  the  United  States  and/or  other  countries.  

What  is  Ignite?  

•  A  memory-­‐centric  data  plaUorm  

•  that  is  strongly  consistent  •  and  highly  available  •  with  powerful  SQL,  •  key-­‐value  and  processing  APIs  

Page 4: Building)Consistentand)Highly)Available)Distributed ... · Apache®,)Apache)Ignite,)Ignite®,)and)the)Apache)Ignite)logo)are)either)registered)trademarks)or)trademarks)of)the)Apache)So8ware)Foundaon)in)the)United)States)and

Apache®,  Apache  Ignite,  Ignite®,  and  the  Apache  Ignite  logo  are  either  registered  trademarks  or  trademarks  of  the  Apache  So8ware  Founda<on  in  the  United  States  and/or  other  countries.  

•  In-­‐Memory  Key-­‐Value  Store  •  ACID  Compliant  •  Collocated  Processing  •  Persistence  

–  Na<ve  Ignite  persistence  –  Pluggable  3rd  party  persistence  

• Usage  –     Database  Caching  –     Web  Session  Clustering  

 

Key-­‐Value  Data  Grid  

Page 5: Building)Consistentand)Highly)Available)Distributed ... · Apache®,)Apache)Ignite,)Ignite®,)and)the)Apache)Ignite)logo)are)either)registered)trademarks)or)trademarks)of)the)Apache)So8ware)Foundaon)in)the)United)States)and

Apache®,  Apache  Ignite,  Ignite®,  and  the  Apache  Ignite  logo  are  either  registered  trademarks  or  trademarks  of  the  Apache  So8ware  Founda<on  in  the  United  States  and/or  other  countries.  

•  Both  In-­‐Memory  and  On-­‐Disk  •  Full  SQL  Support  

–  SELECT,  UPDATE,  DELETE,  INSERT  •  Data  Defini<on  Language  

–  Configure  schema  and  caches  

Distributed  SQL  Database  

Page 6: Building)Consistentand)Highly)Available)Distributed ... · Apache®,)Apache)Ignite,)Ignite®,)and)the)Apache)Ignite)logo)are)either)registered)trademarks)or)trademarks)of)the)Apache)So8ware)Foundaon)in)the)United)States)and

Apache®,  Apache  Ignite,  Ignite®,  and  the  Apache  Ignite  logo  are  either  registered  trademarks  or  trademarks  of  the  Apache  So8ware  Founda<on  in  the  United  States  and/or  other  countries.  

•  CAP  –  Consistency  (C)  –  Availability  (A)  –  Network  Par<<on  Tolerance  (P)  –  Most  of  distributed  systems  are  CP  or  AP  –  Impossible:  CAP  

•  Ignite  –  Strongly  CP  –  But  s<ll  highly  available?  

Ignite  and  CAP  Theorem  

Page 7: Building)Consistentand)Highly)Available)Distributed ... · Apache®,)Apache)Ignite,)Ignite®,)and)the)Apache)Ignite)logo)are)either)registered)trademarks)or)trademarks)of)the)Apache)So8ware)Foundaon)in)the)United)States)and

Apache®,  Apache  Ignite,  Ignite®,  and  the  Apache  Ignite  logo  are  either  registered  trademarks  or  trademarks  of  the  Apache  So8ware  Founda<on  in  the  United  States  and/or  other  countries.  

Cache  Backups:  ParHHon  vs.  Replicated  

Page 8: Building)Consistentand)Highly)Available)Distributed ... · Apache®,)Apache)Ignite,)Ignite®,)and)the)Apache)Ignite)logo)are)either)registered)trademarks)or)trademarks)of)the)Apache)So8ware)Foundaon)in)the)United)States)and

Apache®,  Apache  Ignite,  Ignite®,  and  the  Apache  Ignite  logo  are  either  registered  trademarks  or  trademarks  of  the  Apache  So8ware  Founda<on  in  the  United  States  and/or  other  countries.  

Cache  Backups  and  Network  SegmentaHon  

Rack 1

Switch

Node 1

Node 2

Node 3

Clients

Rack 2

Switch

Node 4

Node 5

Node 6

1

2

3

4

5

6

5

3

1

6

2

4

Lost partitions 1 and 3!

Page 9: Building)Consistentand)Highly)Available)Distributed ... · Apache®,)Apache)Ignite,)Ignite®,)and)the)Apache)Ignite)logo)are)either)registered)trademarks)or)trademarks)of)the)Apache)So8ware)Foundaon)in)the)United)States)and

Apache®,  Apache  Ignite,  Ignite®,  and  the  Apache  Ignite  logo  are  either  registered  trademarks  or  trademarks  of  the  Apache  So8ware  Founda<on  in  the  United  States  and/or  other  countries.  

Cache  Backups  and  Network  SegmentaHon:  SoluHon  

•  Assign  a^ribute  to  each  node:  

•  Implement  backup  filter:  

<property name="userAttributes"> <map> <entry key="rack" value="rack-1"/> </map> </property>

public class RackFilter implements IgniteBiPredicate<ClusterNode, List<ClusterNode>> { @Override public boolean apply(ClusterNode candidate, List<ClusterNode> assigned) { String candidateRack = candidate.attribute("rack"); String primaryRack = assigned.get(0).attribute("rack"); return !Objects.equals(candidateRack, primaryRack); } }

Page 10: Building)Consistentand)Highly)Available)Distributed ... · Apache®,)Apache)Ignite,)Ignite®,)and)the)Apache)Ignite)logo)are)either)registered)trademarks)or)trademarks)of)the)Apache)So8ware)Foundaon)in)the)United)States)and

Apache®,  Apache  Ignite,  Ignite®,  and  the  Apache  Ignite  logo  are  either  registered  trademarks  or  trademarks  of  the  Apache  So8ware  Founda<on  in  the  United  States  and/or  other  countries.  

Cache  Backups  and  Network  SegmentaHon:  Solved!  

Rack 1

Switch

Node 1

Node 2

Node 3

Clients

Rack 2

Switch

Node 4

Node 5

Node 6

1

2

3

4

5

6

5

4

6

3

1

2

No partitions lost!

Page 11: Building)Consistentand)Highly)Available)Distributed ... · Apache®,)Apache)Ignite,)Ignite®,)and)the)Apache)Ignite)logo)are)either)registered)trademarks)or)trademarks)of)the)Apache)So8ware)Foundaon)in)the)United)States)and

Apache®,  Apache  Ignite,  Ignite®,  and  the  Apache  Ignite  logo  are  either  registered  trademarks  or  trademarks  of  the  Apache  So8ware  Founda<on  in  the  United  States  and/or  other  countries.  

Persistence  

Ignite  Persistent  Store  

•  Addi<onal  Disk  Tier  •  SQL  &  key-­‐value  over  both  

memory  and  disk  •  Memory  warmup  never  

required  •  Distributed  disk  storage  •  Reads/writes  are  distributed  

3rd  Party  Store  

•  RDBMS,  MongoDB,  etc.  •  Key-­‐value  over  both  memory  

and  disk  •  Memory  warmup  might  be  

required  (SQL  usage)  •  Single  point  of  failure  (RDBMS)  •  Bo^leneck  for  writes  (RDBMS)  

Page 12: Building)Consistentand)Highly)Available)Distributed ... · Apache®,)Apache)Ignite,)Ignite®,)and)the)Apache)Ignite)logo)are)either)registered)trademarks)or)trademarks)of)the)Apache)So8ware)Foundaon)in)the)United)States)and

Apache®,  Apache  Ignite,  Ignite®,  and  the  Apache  Ignite  logo  are  either  registered  trademarks  or  trademarks  of  the  Apache  So8ware  Founda<on  in  the  United  States  and/or  other  countries.  

Ignite  Persistence  Store:  Per-­‐Node  Architecture  

Page 13: Building)Consistentand)Highly)Available)Distributed ... · Apache®,)Apache)Ignite,)Ignite®,)and)the)Apache)Ignite)logo)are)either)registered)trademarks)or)trademarks)of)the)Apache)So8ware)Foundaon)in)the)United)States)and

Apache®,  Apache  Ignite,  Ignite®,  and  the  Apache  Ignite  logo  are  either  registered  trademarks  or  trademarks  of  the  Apache  So8ware  Founda<on  in  the  United  States  and/or  other  countries.  

Ignite  Persistence  Store:  Consistency  and  Durability  

•  Write-­‐Ahead  Log  (WAL)  –  Append  only  file  –  Propagates  updates  to  disk  –  Provides  recovery  mechanism  

•  Checkpoin<ng  –  Triggered  periodically  –  Copies  actual  data  from  RAM  to  disk  –  Reduces  WAL  size  

Page 14: Building)Consistentand)Highly)Available)Distributed ... · Apache®,)Apache)Ignite,)Ignite®,)and)the)Apache)Ignite)logo)are)either)registered)trademarks)or)trademarks)of)the)Apache)So8ware)Foundaon)in)the)United)States)and

Apache®,  Apache  Ignite,  Ignite®,  and  the  Apache  Ignite  logo  are  either  registered  trademarks  or  trademarks  of  the  Apache  So8ware  Founda<on  in  the  United  States  and/or  other  countries.  

•  Mul<ple  (up  to  32)  Data  Centers  •  Ac<ve-­‐Ac<ve  &  Ac<ve-­‐Passive  •  Smart  Conflict  Resolu<on  •  Durable  Persistent  Queues  •  Automa<c  Thro^ling  

Data  Center  ReplicaHon  

GridGain Enterprise Edition Only!

Page 15: Building)Consistentand)Highly)Available)Distributed ... · Apache®,)Apache)Ignite,)Ignite®,)and)the)Apache)Ignite)logo)are)either)registered)trademarks)or)trademarks)of)the)Apache)So8ware)Foundaon)in)the)United)States)and

Apache®,  Apache  Ignite,  Ignite®,  and  the  Apache  Ignite  logo  are  either  registered  trademarks  or  trademarks  of  the  Apache  So8ware  Founda<on  in  the  United  States  and/or  other  countries.  

Data  Snapshots  •  Full  snapshots  

–  Full  state  –  May  take  long  <me  

•  Incremental  snapshots  –  Par<al  state  –  Only  delta  since  last  full  snapshot  

•  Scheduled  snapshots  •  Restore  on  different  clusters  •  Fully  managed  

GridGain Ultimate Edition Only!

Page 16: Building)Consistentand)Highly)Available)Distributed ... · Apache®,)Apache)Ignite,)Ignite®,)and)the)Apache)Ignite)logo)are)either)registered)trademarks)or)trademarks)of)the)Apache)So8ware)Foundaon)in)the)United)States)and

Apache®,  Apache  Ignite,  Ignite®,  and  the  Apache  Ignite  logo  are  either  registered  trademarks  or  trademarks  of  the  Apache  So8ware  Founda<on  in  the  United  States  and/or  other  countries.  

ANY  QUESTIONS?  Thank  you  for  joining  us.  Follow  the  conversa<on.  

h^p://ignite.apache.org  

#apacheignite