Slide 1

Slide 1 text

Automated  tes+ng  with     MongoDB  and  OffScale   Get  your  database  under  control   Omer  Gertel   CTO  @  OffScale  

Slide 2

Slide 2 text

Managing   databases  is   complicated  

Slide 3

Slide 3 text

Many  people   are  involved   Developers   QA   DBAs   IT  

Slide 4

Slide 4 text

Production Dev QA Integration MulAple   environments  

Slide 5

Slide 5 text

MulAple   copies  and   versions  

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

We  Help  Companies…     Iterate  Faster  &   Release  Be-er  Products       By…     Shortening  product  cycles   with  DB  management   automa=on  

Slide 8

Slide 8 text

Production Dev QA Integration Copy  data   Write  code   Write  unit  tests   Clone  Schema   Copy  data   Test  the  applicaAon Clone  schema   Copy  data   Run  integraAon  

Slide 9

Slide 9 text

Copy  data   Write  code   Write  unit  tests   Clone  Schema   Copy  data   Test  the  applicaAon Clone  schema   Copy  data   Run  integraAon   DataGrove   Git  for  databases Production Dev QA Staging

Slide 10

Slide 10 text

For  developers,  by  developers   $ datagrove tag -n=new_tag $ datagrove list $ datagrove load -n=old_tag $ datagrove unload •  Works  automagically   •  Easy  to  integrate  with  exisAng  tools   •  Your  personal  database  Ame  machine  for  FREE  

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

Automated  TesAng   • IntegraAon  tests   • Build  servers  and  conAnuous  integraAon   • MigraAons   – Some  MongoDB  specific  issues  

Slide 13

Slide 13 text

Automated  Tests   •  Isolated   •  Repeatable   •  Researchable   •  Fast  

Slide 14

Slide 14 text

Automated  Tests   •  For  each  test:   – Populate  database   – Run  test   – Drop  database  

Slide 15

Slide 15 text

What  happens  if  a  test  breaks?   •  Does  it  affect  other  tests?   •  Does  it  stop  the  build  cycle?   •  How  do  you  discover  what  went  wrong?   •  Is  the  bug  related  to  the  data?   •  How  can  you  reproduce  the  bug?   •  What  happens  when  you  push  a  fix?  

Slide 16

Slide 16 text

Automated  Tests   •  For  each  test:   – Load  dataset   – Run  test   – If  test  fails:   •  Tag  dataset  at  end  of  run  

Slide 17

Slide 17 text

Schema  MigraAons  

Slide 18

Slide 18 text

Schema  MigraAons  

Slide 19

Slide 19 text

•  Migrate  ALL  the  objects   – Test  before  you  run   •  Support  older  structures  in  code   – Test  code  against  old  objects   – Have  datasets  ready  tagged  by  version   Schema  MigraAons   Object  Structure  &  Index  Changes  

Slide 20

Slide 20 text

       Make  MongoDB  a  first   class  ciAzen  of  the   development  cycle   Version  management  that  doesn’t   suck  

Slide 21

Slide 21 text

ExisAng  MongoDB  Support   For  single  node  environments   $ datagrove load - n=tag_name Create  virtual  mount  point:     /media/offscale   (1-­‐10  sec)   mongod  -­‐-­‐dpath=  /media/offscale   /media/offscale   Mongod   path-­‐to-­‐old-­‐data   path-­‐to-­‐store-­‐ changes   (opAonal)  

Slide 22

Slide 22 text

ExisAng  MongoDB  Support   For  single  node  environments   $ datagrove tag - n=tag_name Tag  point  in  Ame  in  virtual  drive   (1-­‐10  sec)   {fsync:1,lock:1}     (using  Java  driver)   /media/offscale   Mongod   path-­‐to-­‐old-­‐data   path-­‐to-­‐store-­‐ changes   (opAonal)   db.$cmd.sys.unlock.findOne()  

Slide 23

Slide 23 text

Replica  Set   Primary   Slave   Slave   Replica  Set   Primary   Slave   Slave   Upcoming  MongoDB  Cluster  Support    Conceptual  architecture  for  taking  a  snapshot   Replica  Set   Primary   Slave   Slave   One  node  managed  under   OffScale,  per  replica  set,   allows  for  backup,  recovery   and  creaAng  new  nodes   ConfiguraAon   cluster   Cfg  1   Cfg  2   Cfg  3   One  or  more  nodes   managed  by  OffScale  for   backup  and  recovery  of   configuraAon  servers   $ datagrove tag-n=ta Issue  datagrove  tag  for   configuraAon  server   Pause  shard   balancing   Resume  shard   balancing   Issue  datagrove  tag,   one  shard  at  a  Ame  

Slide 24

Slide 24 text

•  Data  is  a  first  class   ciAzen  in  your   environment   •  TesAng  is  important  to   keep  your  code  working   •  Iterate  faster  &  release   beher  products   Automated  tesAng  with     OffScale  &  MongoDB  

Slide 25

Slide 25 text

Now  available  at   hhp://off-­‐scale.com/   Get  your  database  under  control