SlideShare una empresa de Scribd logo
1 de 38
Descargar para leer sin conexión
r
        restats
 Processing real-time data to
cubes on data structure servers
Proble
                                                                            Solutio
 problem           solution                                             What is re
                                                                            Trackin
                                                  tracking                dimensi
                                                                             cubin
                                                                            1st dep
 lessons
 learned
                                                           dimensions      2nd dep
                                                                           3rd dep
                                                                               keys
                              restats                           cubing     increme
                                                                          geo cub
           speed
                                                                         geo increm
            test
                                                         1st, 2nd, 3rd
                                                            depth       query inte
                                                                        query resp
                                      query
                                    interface            keys
                                                                      geo query in
                                                                        scaling str
                         response                                          speed t
                   geo
                                                incement                lessons lea
scaling
                                                                              scales
theProblem
                                   r
    Rails
                                       mySQL                        Redis




Application                    Warehouse                        Statistics

              Trackings                          Calculate

                                                every X hours




                                              Doesn’t Scale!




                          800 M+           500 GB+
Proble
                                                                            Solutio
 problem           solution                                             What is re
                                                                            Trackin
                                                  tracking                dimensi
                                                                             cubin
                                                                            1st dep
 lessons
 learned
                                                           dimensions      2nd dep
                                                                           3rd dep
                                                                               keys
                              restats                           cubing     increme
                                                                          geo cub
           speed
                                                                         geo increm
            test
                                                         1st, 2nd, 3rd
                                                            depth       query inte
                                                                        query resp
                                      query
                                    interface            keys
                                                                      geo query in
                                                                        scaling str
                         response                                          speed t
                   geo
                                                incement                lessons lea
scaling
                                                                              scales
Proble
                                                                            Solutio
 problem           solution                                             What is re
                                                                            Trackin
                                                  tracking                dimensi
                                                                             cubin
                                                                            1st dep
 lessons
 learned
                                                           dimensions      2nd dep
                                                                           3rd dep
                                                                               keys
                              restats                           cubing     increme
                                                                          geo cub
           speed
                                                                         geo increm
            test
                                                         1st, 2nd, 3rd
                                                            depth       query inte
                                                                        query resp
                                      query
                                    interface            keys
                                                                      geo query in
                                                                        scaling str
                         response                                          speed t
                   geo
                                                incement                lessons lea
scaling
                                                                              scales
r
                      theSolution
    Rails
                                                    Redis




                            r
Application                                     Statistics

              Trackings             Process



                          restats
                                    Real-Time
Proble
                                                                            Solutio
 problem           solution                                             What is re
                                                                            Trackin
                                                  tracking                dimensi
                                                                             cubin
                                                                            1st dep
 lessons
 learned
                                                           dimensions      2nd dep
                                                                           3rd dep
                                                                               keys
                              restats                           cubing     increme
                                                                          geo cub
           speed
                                                                         geo increm
            test
                                                         1st, 2nd, 3rd
                                                            depth       query inte
                                                                        query resp
                                      query
                                    interface            keys
                                                                      geo query in
                                                                        scaling str
                         response                                          speed t
                   geo
                                                incement                lessons lea
scaling
                                                                              scales
Proble
                                                                            Solutio
 problem           solution                                             What is re
                                                                            Trackin
                                                  tracking                dimensi
                                                                             cubin
                                                                            1st dep
 lessons
 learned
                                                           dimensions      2nd dep
                                                                           3rd dep
                                                                               keys
                              restats                           cubing     increme
                                                                          geo cub
           speed
                                                                         geo increm
            test
                                                         1st, 2nd, 3rd
                                                            depth       query inte
                                                                        query resp
                                      query
                                    interface            keys
                                                                      geo query in
                                                                        scaling str
                         response                                          speed t
                   geo
                                                incement                lessons lea
scaling
                                                                              scales
what is restats?
                           r
                Redis          Statistics
advanced key-value store       data cubes
   data structure server       geo-location cubes
Proble
                                                                            Solutio
 problem           solution                                             What is re
                                                                            Trackin
                                                  tracking                dimensi
                                                                             cubin
                                                                            1st dep
 lessons
 learned
                                                           dimensions      2nd dep
                                                                           3rd dep
                                                                               keys
                              restats                           cubing     increme
                                                                          geo cub
           speed
                                                                         geo increm
            test
                                                         1st, 2nd, 3rd
                                                            depth       query inte
                                                                        query resp
                                      query
                                    interface            keys
                                                                      geo query in
                                                                        scaling str
                         response                                          speed t
                   geo
                                                incement                lessons lea
scaling
                                                                              scales
Proble
                                                                             Solutio
 problem           solution                                              What is re
                                                                             Trackin
                                                  tracking                 dimensi
                                                                              cubin
                                                                             1st dep
 lessons
 learned
                                                            dimensions      2nd dep
                                                                            3rd dep
                                                                                keys
                              restats                            cubing     increme
                                                                           geo cub
           speed
                                                                          geo increm
            test
                                                          1st, 2nd, 3rd
                                                             depth       query inte
                                                                         query resp
                                      query
                                    interface             keys
                                                                       geo query in
                                                                         scaling str
                         response                                           speed t
                   geo
                                                increment                lessons lea
scaling
                                                                               scales
r
    how does it work: tracking

                           {
    Rails                      "created_at":     "2012-10-18T21:34:56+02:00",
                               "type":           "adrequest",
              Produces         "location_id":    1,
                               "campaign_id":    1,
                               "publisher_id":   1,
                JSON           "latitude":       "53.36669921875",
                               "longitude":      "-1.5",
Application                    "bannersize":     "320x50"
                           }




  At 2012-10-18, there was an adrequest for campaign 1
         at 53.366,-1.5 for the bannersize 320x50
r
how does it work: dimensions



    Attribute       Geo        Time
        type
     location_id                day
                    latitude
    campaign_id                month
                   longitude
    publisher_id                year
     bannersize
how does it work: cubing
                                                           r
                                Attribute       Geo             Time    Depth
                                    type
                                 location_id                     day
                                                latitude
                                campaign_id                     month     3
                                               longitude
                                publisher_id                     year
                                 bannersize




                                                     Maps
               1 Attribute                                              1 Redis Key
              Combination                          Redis INCR




                Time         Attribute
            day-month-year     type                  Maps               INCR
1st Depth                                                               day-month-year-type:
              18-10-2012     adrequest             Redis INCR           18-10-2012-adrequest
how does it work: 1st depth
                                                r
                     Attribute       Geo             Time    Depth
                         type
                      location_id                     day
                                     latitude
                     campaign_id                     month     3
                                    longitude
                     publisher_id                     year
                      bannersize




     Time         Attribute
 day-month-year     type                  Maps               INCR
                                                             day-month-year-type:
   18-10-2012     adrequest             Redis INCR           18-10-2012-adrequest

     Time         Attribute
  month-year        type                  Maps               INCR
                                                             month-year-type:
    10-2012       adrequest             Redis INCR           10-2012-adrequest

     Time         Attribute
      year          type                  Maps               INCR
                                                             year-type:
     2012         adrequest             Redis INCR           2012-adrequest
how does it work: 2nd depth
                                                                 r
                                      Attribute       Geo             Time    Depth
                                          type
                                       location_id                     day
                                                      latitude
                                      campaign_id                     month     3
                                                     longitude
                                      publisher_id                     year
                                       bannersize




    Time                  Attribute
day-month-year     type         location_id                Maps               INCR
                                                                              day-month-year-type-location_id:
  18-10-2012     adrequest            1                                       18-10-2012-adrequest-1
                                                         Redis INCR

    Time                  Attribute
day-month-year     type         campaign_id                Maps               INCR
                                                                              day-month-year-type-campaign_id:
                                                                              18-10-2012-adrequest-1

                                                            ...
  18-10-2012     adrequest            1
                                                         Redis INCR


                                                      Combinations
how does it work: 3rd depth
                                                                     r
                                      Attribute             Geo          Time        Depth
                                          type
                                       location_id                        day
                                                          latitude
                                      campaign_id                        month         3
                                                         longitude
                                      publisher_id                        year
                                       bannersize




    Time                     Attribute
day-month-year     type      location_id     campaign_id                 Maps                INCR
                                                                                             day-month-year-type-location_id
                                                                                             -campaign_id:
  18-10-2012     adrequest       1                   1                                       18-10-2012-adrequest-1-1
                                                                        Redis INCR

    Time                     Attribute
day-month-year     type      location_id     publisher_id                Maps                INCR
                                                                                             day-month-year-type-location_id
                                                                                             -publisher_id:
                                                                                             18-10-2012-adrequest-1-1


                                                                  ...
  18-10-2012     adrequest       1                   1                  Redis INCR


                                                            Combinations
Proble
                                                                             Solutio
 problem           solution                                              What is re
                                                                             Trackin
                                                  tracking                 dimensi
                                                                              cubin
                                                                             1st dep
 lessons
 learned
                                                            dimensions      2nd dep
                                                                            3rd dep
                                                                                keys
                              restats                            cubing     increme
                                                                           geo cub
           speed
                                                                          geo increm
            test
                                                          1st, 2nd, 3rd
                                                             depth       query inte
                                                                         query resp
                                      query
                                    interface             keys
                                                                       geo query in
                                                                         scaling str
                         response                                           speed t
                   geo
                                                increment                lessons lea
scaling
                                                                               scales
Proble
                                                                             Solutio
 problem           solution                                              What is re
                                                                             Trackin
                                                  tracking                 dimensi
                                                                              cubin
                                                                             1st dep
 lessons
 learned
                                                            dimensions      2nd dep
                                                                            3rd dep
                                                                                keys
                              restats                            cubing     increme
                                                                           geo cub
           speed
                                                                          geo increm
            test
                                                          1st, 2nd, 3rd
                                                             depth       query inte
                                                                         query resp
                                      query
                                    interface             keys
                                                                       geo query in
                                                                         scaling str
                         response                                           speed t
                   geo
                                                increment                lessons lea
scaling
                                                                               scales
how does it work: keys
                                        r
             Attribute       Geo            Time    Depth
                 type
              location_id                    day
                             latitude
             campaign_id                    month     3
                            longitude
             publisher_id                    year
              bannersize




                     n = attribute dimensions (5)
                     d = max depth            (3)
                     t = time dimensions      (3)


Total Amount of =
Keys per Tracking


  (5 + 10 + 10) • 3 = 75 Keys
how does it work: increment
                                   r
                           Computed Keys
              day-month-year-type:18-10-2012-adrequest
                  month-year-type:10-2012-adrequest
                      year-type:2012-adrequest
day-month-year-type-location_id-publisher_id:18-10-2012-adrequest-1-1
                                 ...




                              Digest   SHA1




                           Redis Batch INCR
                    INCR   76f374viq4vi7fti374oo76
                    INCR   o8qf374fvlqizfvil7v2o8v
                    INCR   fqwevlrfli74l3fzlizflzf
                    INCR   fbliaguzvf736i4cjsztudz
                                  ...
how does it work: geo cubing
                             r
                Redis Sorted Set
           set with a score for each member

     ZADD key score member   # adds a member to key
     ZINCRBY key 1 member    # increases member by 1




                      Mapping
          Rounded position specifies precision

     member = “latitude:longitude”
     score = # of trackings at that location




     ZINCRBY sdvouzg 1 53.3666:-1.5
     ZRANGE sdvouzg 0 -1 withscores
     1) 54.3215:0.3456
     2) 5
     3) 53.3666:-1.5
     4) 2763
how does it work: geo increment
                                 r
                     Computed Keys
              INCR   76f374viq4vi7fti374oo76
              INCR   o8qf374fvlqizfvil7v2o8v
              INCR   fqwevlrfli74l3fzlizflzf
              INCR   fbliaguzvf736i4cjsztudz
                            ...


                Round Position       ZINCRBY 1




                  Redis Batch ZINCRBY
              INCR 76f374viq4vi7fti374oo76
   ZINCRBY   76f374viq4vi7fti374oo76g 1 53.3666:-1.5
              INCR o8qf374fvlqizfvil7v2o8v
   ZINCRBY   o8qf374fvlqizfvil7v2o8vg 1 53.3666:-1.5
              INCR fqwevlrfli74l3fzlizflzf
   ZINCRBY   fqwevlrfli74l3fzlizflzfg 1 53.3666:-1.5
              INCR fbliaguzvf736i4cjsztudz
   ZINCRBY   fbliaguzvf736i4cjsztudzg 1 53.3666:-1.5
                           ...
Proble
                                                                             Solutio
 problem           solution                                              What is re
                                                                             Trackin
                                                  tracking                 dimensi
                                                                              cubin
                                                                             1st dep
 lessons
 learned
                                                            dimensions      2nd dep
                                                                            3rd dep
                                                                                keys
                              restats                            cubing     increme
                                                                           geo cub
           speed
                                                                          geo increm
            test
                                                          1st, 2nd, 3rd
                                                             depth       query inte
                                                                         query resp
                                      query
                                    interface             keys
                                                                       geo query in
                                                                         scaling str
                         response                                           speed t
                   geo
                                                increment                lessons lea
scaling
                                                                               scales
Proble
                                                                             Solutio
 problem           solution                                              What is re
                                                                             Trackin
                                                  tracking                 dimensi
                                                                              cubin
                                                                             1st dep
 lessons
 learned
                                                            dimensions      2nd dep
                                                                            3rd dep
                                                                                keys
                              restats                            cubing     increme
                                                                           geo cub
           speed
                                                                          geo increm
            test
                                                          1st, 2nd, 3rd
                                                             depth       query inte
                                                                         query resp
                                      query
                                    interface             keys
                                                                       geo query in
                                                                         scaling str
                         response                                           speed t
                   geo
                                                increment                lessons lea
scaling
                                                                               scales
r
the queryinterface
               Query
    converts the attributes to keys
  multi-fetch to save round-trip time
the queryresponse
                 r
   Query-able Ruby Hash
  allows to iterate over the responses
         merged aggregations
the geoqueryresponse
                    r
    Query-able Ruby Hash
              list of positions
    scores are trackings at that position
Proble
                                                                             Solutio
 problem           solution                                              What is re
                                                                             Trackin
                                                  tracking                 dimensi
                                                                              cubin
                                                                             1st dep
 lessons
 learned
                                                            dimensions      2nd dep
                                                                            3rd dep
                                                                                keys
                              restats                            cubing     increme
                                                                           geo cub
           speed
                                                                          geo increm
            test
                                                          1st, 2nd, 3rd
                                                             depth       query inte
                                                                         query resp
                                      query
                                    interface             keys
                                                                       geo query in
                                                                         scaling str
                         response                                           speed t
                   geo
                                                increment                lessons lea
scaling
                                                                               scales
Proble
                                                                             Solutio
 problem           solution                                              What is re
                                                                             Trackin
                                                  tracking                 dimensi
                                                                              cubin
                                                                             1st dep
 lessons
 learned
                                                            dimensions      2nd dep
                                                                            3rd dep
                                                                                keys
                              restats                            cubing     increme
                                                                           geo cub
           speed
                                                                          geo increm
            test
                                                          1st, 2nd, 3rd
                                                             depth       query inte
                                                                         query resp
                                      query
                                    interface             keys
                                                                       geo query in
                                                                         scaling str
                         response                                           speed t
                   geo
                                                increment                lessons lea
scaling
                                                                               scales
the scalingstrategy
                                     r
  Trackings In

                              add worker PR > 0
                           remove worker PR < 0
                 monitor value over a time period, e.g. 10 mins




Processing Ratio =
                                                                  Trackings Out
Proble
                                                                             Solutio
 problem           solution                                              What is re
                                                                             Trackin
                                                  tracking                 dimensi
                                                                              cubin
                                                                             1st dep
 lessons
 learned
                                                            dimensions      2nd dep
                                                                            3rd dep
                                                                                keys
                              restats                            cubing     increme
                                                                           geo cub
           speed
                                                                          geo increm
            test
                                                          1st, 2nd, 3rd
                                                             depth       query inte
                                                                         query resp
                                      query
                                    interface             keys
                                                                       geo query in
                                                                         scaling str
                         response                                           speed t
                   geo
                                                increment                lessons lea
scaling
                                                                               scales
Proble
                                                                             Solutio
 problem           solution                                              What is re
                                                                             Trackin
                                                  tracking                 dimensi
                                                                              cubin
                                                                             1st dep
 lessons
 learned
                                                            dimensions      2nd dep
                                                                            3rd dep
                                                                                keys
                              restats                            cubing     increme
                                                                           geo cub
           speed
                                                                          geo increm
            test
                                                          1st, 2nd, 3rd
                                                             depth       query inte
                                                                         query resp
                                      query
                                    interface             keys
                                                                       geo query in
                                                                         scaling str
                         response                                           speed t
                   geo
                                                increment                lessons lea
scaling
                                                                               scales
the speedtest
                            r
2.4 GHz Intel Core i5 with 8 GB 1067 MHz DDR3
                   5 attribute dimensions
                         5 max depth
                     geo cube enabled




 85 processings / second
      (5 + 10 + 10 + 5) • 3 • 2 = 180 keys / tracking
                                = 15,300 keys / second
                  bottleneck = cpu; calculation of combinations
Proble
                                                                             Solutio
 problem           solution                                              What is re
                                                                             Trackin
                                                  tracking                 dimensi
                                                                              cubin
                                                                             1st dep
 lessons
 learned
                                                            dimensions      2nd dep
                                                                            3rd dep
                                                                                keys
                              restats                            cubing     increme
                                                                           geo cub
           speed
                                                                          geo increm
            test
                                                          1st, 2nd, 3rd
                                                             depth       query inte
                                                                         query resp
                                      query
                                    interface             keys
                                                                       geo query in
                                                                         scaling str
                         response                                           speed t
                   geo
                                                increment                lessons lea
scaling
                                                                               scales
Proble
                                                                             Solutio
 problem           solution                                              What is re
                                                                             Trackin
                                                  tracking                 dimensi
                                                                              cubin
                                                                             1st dep
 lessons
 learned
                                                            dimensions      2nd dep
                                                                            3rd dep
                                                                                keys
                              restats                            cubing     increme
                                                                           geo cub
           speed
                                                                          geo increm
            test
                                                          1st, 2nd, 3rd
                                                             depth       query inte
                                                                         query resp
                                      query
                                    interface             keys
                                                                       geo query in
                                                                         scaling str
                         response                                           speed t
                   geo
                                                increment                lessons lea
scaling
                                                                               scales
the lessonslearned
                                                 r
                                   not NoSQL, newSQL!
                                      we’re still querying, right?
dare to customize                                                     know your data
    you’ll be rewarded                                               dynamics kills performance




                                      process on write
                                     if you need fast read-access
    denormalize                                                            no CRON
in this field, it’s your friend                                      recurring tasks don’t scale



                                   use mini-benchmarks
                              when you’re unsure during implementation
r
now let’sscale!
      try scales!
        itscales.org




           s
thomas fankhauser, m.sc.
   tommy@southdesign.de
      southdesign.de

Más contenido relacionado

Destacado

Agile delivery facilitation
Agile delivery facilitationAgile delivery facilitation
Agile delivery facilitationVinay Aggarwal
 
Singers senstion group 4 areas that teach
Singers senstion group 4 areas that teachSingers senstion group 4 areas that teach
Singers senstion group 4 areas that teachSHAUN J FEDERICO
 
March WeMN Event Business Planning
March WeMN Event Business Planning March WeMN Event Business Planning
March WeMN Event Business Planning WeMN
 
Strategic Planning for Board Directors and Staff
Strategic Planning for Board Directors and StaffStrategic Planning for Board Directors and Staff
Strategic Planning for Board Directors and StaffMarsha Smith
 
Roadmap To Innovation: A CEO Checklist
Roadmap To Innovation: A CEO Checklist Roadmap To Innovation: A CEO Checklist
Roadmap To Innovation: A CEO Checklist Nick Gregg
 
Board of Director Presentation
Board of Director PresentationBoard of Director Presentation
Board of Director PresentationChristian Nguyen
 
Board reporting template
Board reporting templateBoard reporting template
Board reporting templateInspiring Women
 
BOARD OF DIRECTOR
BOARD OF DIRECTORBOARD OF DIRECTOR
BOARD OF DIRECTORAmit Roy
 
2010 sample board presentation
2010 sample board presentation2010 sample board presentation
2010 sample board presentationkipmcc
 

Destacado (12)

Github - Social Coding
Github - Social CodingGithub - Social Coding
Github - Social Coding
 
Agile delivery facilitation
Agile delivery facilitationAgile delivery facilitation
Agile delivery facilitation
 
Singers senstion group 4 areas that teach
Singers senstion group 4 areas that teachSingers senstion group 4 areas that teach
Singers senstion group 4 areas that teach
 
March WeMN Event Business Planning
March WeMN Event Business Planning March WeMN Event Business Planning
March WeMN Event Business Planning
 
Strategic Planning for Board Directors and Staff
Strategic Planning for Board Directors and StaffStrategic Planning for Board Directors and Staff
Strategic Planning for Board Directors and Staff
 
Roadmap To Innovation: A CEO Checklist
Roadmap To Innovation: A CEO Checklist Roadmap To Innovation: A CEO Checklist
Roadmap To Innovation: A CEO Checklist
 
Board of Director Presentation
Board of Director PresentationBoard of Director Presentation
Board of Director Presentation
 
The CEO Roadmap
The CEO RoadmapThe CEO Roadmap
The CEO Roadmap
 
Creating an Actionable Roadmap for Company Growth
Creating an Actionable Roadmap for Company Growth Creating an Actionable Roadmap for Company Growth
Creating an Actionable Roadmap for Company Growth
 
Board reporting template
Board reporting templateBoard reporting template
Board reporting template
 
BOARD OF DIRECTOR
BOARD OF DIRECTORBOARD OF DIRECTOR
BOARD OF DIRECTOR
 
2010 sample board presentation
2010 sample board presentation2010 sample board presentation
2010 sample board presentation
 

Más de Thomas Fankhauser

Más de Thomas Fankhauser (6)

Hands on AngularJS
Hands on AngularJSHands on AngularJS
Hands on AngularJS
 
iOS Sensors
iOS SensorsiOS Sensors
iOS Sensors
 
Benji - Ruby on Rails Profiler
Benji - Ruby on Rails ProfilerBenji - Ruby on Rails Profiler
Benji - Ruby on Rails Profiler
 
Railscale
RailscaleRailscale
Railscale
 
Super Social Everybody
Super Social EverybodySuper Social Everybody
Super Social Everybody
 
OAuth 101
OAuth 101OAuth 101
OAuth 101
 

Último

Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 

Último (20)

Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 

Restats

  • 1. r restats Processing real-time data to cubes on data structure servers
  • 2. Proble Solutio problem solution What is re Trackin tracking dimensi cubin 1st dep lessons learned dimensions 2nd dep 3rd dep keys restats cubing increme geo cub speed geo increm test 1st, 2nd, 3rd depth query inte query resp query interface keys geo query in scaling str response speed t geo incement lessons lea scaling scales
  • 3. theProblem r Rails mySQL Redis Application Warehouse Statistics Trackings Calculate every X hours Doesn’t Scale! 800 M+ 500 GB+
  • 4. Proble Solutio problem solution What is re Trackin tracking dimensi cubin 1st dep lessons learned dimensions 2nd dep 3rd dep keys restats cubing increme geo cub speed geo increm test 1st, 2nd, 3rd depth query inte query resp query interface keys geo query in scaling str response speed t geo incement lessons lea scaling scales
  • 5. Proble Solutio problem solution What is re Trackin tracking dimensi cubin 1st dep lessons learned dimensions 2nd dep 3rd dep keys restats cubing increme geo cub speed geo increm test 1st, 2nd, 3rd depth query inte query resp query interface keys geo query in scaling str response speed t geo incement lessons lea scaling scales
  • 6. r theSolution Rails Redis r Application Statistics Trackings Process restats Real-Time
  • 7. Proble Solutio problem solution What is re Trackin tracking dimensi cubin 1st dep lessons learned dimensions 2nd dep 3rd dep keys restats cubing increme geo cub speed geo increm test 1st, 2nd, 3rd depth query inte query resp query interface keys geo query in scaling str response speed t geo incement lessons lea scaling scales
  • 8. Proble Solutio problem solution What is re Trackin tracking dimensi cubin 1st dep lessons learned dimensions 2nd dep 3rd dep keys restats cubing increme geo cub speed geo increm test 1st, 2nd, 3rd depth query inte query resp query interface keys geo query in scaling str response speed t geo incement lessons lea scaling scales
  • 9. what is restats? r Redis Statistics advanced key-value store data cubes data structure server geo-location cubes
  • 10. Proble Solutio problem solution What is re Trackin tracking dimensi cubin 1st dep lessons learned dimensions 2nd dep 3rd dep keys restats cubing increme geo cub speed geo increm test 1st, 2nd, 3rd depth query inte query resp query interface keys geo query in scaling str response speed t geo incement lessons lea scaling scales
  • 11. Proble Solutio problem solution What is re Trackin tracking dimensi cubin 1st dep lessons learned dimensions 2nd dep 3rd dep keys restats cubing increme geo cub speed geo increm test 1st, 2nd, 3rd depth query inte query resp query interface keys geo query in scaling str response speed t geo increment lessons lea scaling scales
  • 12. r how does it work: tracking { Rails "created_at": "2012-10-18T21:34:56+02:00", "type": "adrequest", Produces "location_id": 1, "campaign_id": 1, "publisher_id": 1, JSON "latitude": "53.36669921875", "longitude": "-1.5", Application "bannersize": "320x50" } At 2012-10-18, there was an adrequest for campaign 1 at 53.366,-1.5 for the bannersize 320x50
  • 13. r how does it work: dimensions Attribute Geo Time type location_id day latitude campaign_id month longitude publisher_id year bannersize
  • 14. how does it work: cubing r Attribute Geo Time Depth type location_id day latitude campaign_id month 3 longitude publisher_id year bannersize Maps 1 Attribute 1 Redis Key Combination Redis INCR Time Attribute day-month-year type Maps INCR 1st Depth day-month-year-type: 18-10-2012 adrequest Redis INCR 18-10-2012-adrequest
  • 15. how does it work: 1st depth r Attribute Geo Time Depth type location_id day latitude campaign_id month 3 longitude publisher_id year bannersize Time Attribute day-month-year type Maps INCR day-month-year-type: 18-10-2012 adrequest Redis INCR 18-10-2012-adrequest Time Attribute month-year type Maps INCR month-year-type: 10-2012 adrequest Redis INCR 10-2012-adrequest Time Attribute year type Maps INCR year-type: 2012 adrequest Redis INCR 2012-adrequest
  • 16. how does it work: 2nd depth r Attribute Geo Time Depth type location_id day latitude campaign_id month 3 longitude publisher_id year bannersize Time Attribute day-month-year type location_id Maps INCR day-month-year-type-location_id: 18-10-2012 adrequest 1 18-10-2012-adrequest-1 Redis INCR Time Attribute day-month-year type campaign_id Maps INCR day-month-year-type-campaign_id: 18-10-2012-adrequest-1 ... 18-10-2012 adrequest 1 Redis INCR Combinations
  • 17. how does it work: 3rd depth r Attribute Geo Time Depth type location_id day latitude campaign_id month 3 longitude publisher_id year bannersize Time Attribute day-month-year type location_id campaign_id Maps INCR day-month-year-type-location_id -campaign_id: 18-10-2012 adrequest 1 1 18-10-2012-adrequest-1-1 Redis INCR Time Attribute day-month-year type location_id publisher_id Maps INCR day-month-year-type-location_id -publisher_id: 18-10-2012-adrequest-1-1 ... 18-10-2012 adrequest 1 1 Redis INCR Combinations
  • 18. Proble Solutio problem solution What is re Trackin tracking dimensi cubin 1st dep lessons learned dimensions 2nd dep 3rd dep keys restats cubing increme geo cub speed geo increm test 1st, 2nd, 3rd depth query inte query resp query interface keys geo query in scaling str response speed t geo increment lessons lea scaling scales
  • 19. Proble Solutio problem solution What is re Trackin tracking dimensi cubin 1st dep lessons learned dimensions 2nd dep 3rd dep keys restats cubing increme geo cub speed geo increm test 1st, 2nd, 3rd depth query inte query resp query interface keys geo query in scaling str response speed t geo increment lessons lea scaling scales
  • 20. how does it work: keys r Attribute Geo Time Depth type location_id day latitude campaign_id month 3 longitude publisher_id year bannersize n = attribute dimensions (5) d = max depth (3) t = time dimensions (3) Total Amount of = Keys per Tracking (5 + 10 + 10) • 3 = 75 Keys
  • 21. how does it work: increment r Computed Keys day-month-year-type:18-10-2012-adrequest month-year-type:10-2012-adrequest year-type:2012-adrequest day-month-year-type-location_id-publisher_id:18-10-2012-adrequest-1-1 ... Digest SHA1 Redis Batch INCR INCR 76f374viq4vi7fti374oo76 INCR o8qf374fvlqizfvil7v2o8v INCR fqwevlrfli74l3fzlizflzf INCR fbliaguzvf736i4cjsztudz ...
  • 22. how does it work: geo cubing r Redis Sorted Set set with a score for each member ZADD key score member # adds a member to key ZINCRBY key 1 member # increases member by 1 Mapping Rounded position specifies precision member = “latitude:longitude” score = # of trackings at that location ZINCRBY sdvouzg 1 53.3666:-1.5 ZRANGE sdvouzg 0 -1 withscores 1) 54.3215:0.3456 2) 5 3) 53.3666:-1.5 4) 2763
  • 23. how does it work: geo increment r Computed Keys INCR 76f374viq4vi7fti374oo76 INCR o8qf374fvlqizfvil7v2o8v INCR fqwevlrfli74l3fzlizflzf INCR fbliaguzvf736i4cjsztudz ... Round Position ZINCRBY 1 Redis Batch ZINCRBY INCR 76f374viq4vi7fti374oo76 ZINCRBY 76f374viq4vi7fti374oo76g 1 53.3666:-1.5 INCR o8qf374fvlqizfvil7v2o8v ZINCRBY o8qf374fvlqizfvil7v2o8vg 1 53.3666:-1.5 INCR fqwevlrfli74l3fzlizflzf ZINCRBY fqwevlrfli74l3fzlizflzfg 1 53.3666:-1.5 INCR fbliaguzvf736i4cjsztudz ZINCRBY fbliaguzvf736i4cjsztudzg 1 53.3666:-1.5 ...
  • 24. Proble Solutio problem solution What is re Trackin tracking dimensi cubin 1st dep lessons learned dimensions 2nd dep 3rd dep keys restats cubing increme geo cub speed geo increm test 1st, 2nd, 3rd depth query inte query resp query interface keys geo query in scaling str response speed t geo increment lessons lea scaling scales
  • 25. Proble Solutio problem solution What is re Trackin tracking dimensi cubin 1st dep lessons learned dimensions 2nd dep 3rd dep keys restats cubing increme geo cub speed geo increm test 1st, 2nd, 3rd depth query inte query resp query interface keys geo query in scaling str response speed t geo increment lessons lea scaling scales
  • 26. r the queryinterface Query converts the attributes to keys multi-fetch to save round-trip time
  • 27. the queryresponse r Query-able Ruby Hash allows to iterate over the responses merged aggregations
  • 28. the geoqueryresponse r Query-able Ruby Hash list of positions scores are trackings at that position
  • 29. Proble Solutio problem solution What is re Trackin tracking dimensi cubin 1st dep lessons learned dimensions 2nd dep 3rd dep keys restats cubing increme geo cub speed geo increm test 1st, 2nd, 3rd depth query inte query resp query interface keys geo query in scaling str response speed t geo increment lessons lea scaling scales
  • 30. Proble Solutio problem solution What is re Trackin tracking dimensi cubin 1st dep lessons learned dimensions 2nd dep 3rd dep keys restats cubing increme geo cub speed geo increm test 1st, 2nd, 3rd depth query inte query resp query interface keys geo query in scaling str response speed t geo increment lessons lea scaling scales
  • 31. the scalingstrategy r Trackings In add worker PR > 0 remove worker PR < 0 monitor value over a time period, e.g. 10 mins Processing Ratio = Trackings Out
  • 32. Proble Solutio problem solution What is re Trackin tracking dimensi cubin 1st dep lessons learned dimensions 2nd dep 3rd dep keys restats cubing increme geo cub speed geo increm test 1st, 2nd, 3rd depth query inte query resp query interface keys geo query in scaling str response speed t geo increment lessons lea scaling scales
  • 33. Proble Solutio problem solution What is re Trackin tracking dimensi cubin 1st dep lessons learned dimensions 2nd dep 3rd dep keys restats cubing increme geo cub speed geo increm test 1st, 2nd, 3rd depth query inte query resp query interface keys geo query in scaling str response speed t geo increment lessons lea scaling scales
  • 34. the speedtest r 2.4 GHz Intel Core i5 with 8 GB 1067 MHz DDR3 5 attribute dimensions 5 max depth geo cube enabled 85 processings / second (5 + 10 + 10 + 5) • 3 • 2 = 180 keys / tracking = 15,300 keys / second bottleneck = cpu; calculation of combinations
  • 35. Proble Solutio problem solution What is re Trackin tracking dimensi cubin 1st dep lessons learned dimensions 2nd dep 3rd dep keys restats cubing increme geo cub speed geo increm test 1st, 2nd, 3rd depth query inte query resp query interface keys geo query in scaling str response speed t geo increment lessons lea scaling scales
  • 36. Proble Solutio problem solution What is re Trackin tracking dimensi cubin 1st dep lessons learned dimensions 2nd dep 3rd dep keys restats cubing increme geo cub speed geo increm test 1st, 2nd, 3rd depth query inte query resp query interface keys geo query in scaling str response speed t geo increment lessons lea scaling scales
  • 37. the lessonslearned r not NoSQL, newSQL! we’re still querying, right? dare to customize know your data you’ll be rewarded dynamics kills performance process on write if you need fast read-access denormalize no CRON in this field, it’s your friend recurring tasks don’t scale use mini-benchmarks when you’re unsure during implementation
  • 38. r now let’sscale! try scales! itscales.org s thomas fankhauser, m.sc. tommy@southdesign.de southdesign.de