SlideShare une entreprise Scribd logo
1  sur  143
Schema Design
             for Riak
               Sean Cribbs
            Developer Advocate




b a sho
Thinking
          Non-Relationally


b a sho
“There is no spoon
              schema.”


b a sho
There is an
          application.


b a sho
What you lose




b a sho
What you lose

          •Tables




b a sho
What you lose

          •Tables
          •Foreign keys and constraints




b a sho
What you lose

          •Tables
          •Foreign keys and constraints
          •ACID



b a sho
What you lose

          •Tables
          •Foreign keys and constraints
          •ACID
          •Sophisticated query planners


b a sho
What you lose

          •Tables
          •Foreign keys and constraints
          •ACID
          •Sophisticated query planners
          •Declarative query language (SQL)
b a sho
What you gain




b a sho
What you gain

          •More flexible, fluid designs




b a sho
What you gain

          •More flexible, fluid designs
          •More natural data representations



b a sho
What you gain

          •More flexible, fluid designs
          •More natural data representations
          •Scaling without pain


b a sho
What you gain

          •More flexible, fluid designs
          •More natural data representations
          •Scaling without pain
          •Reduced operational complexity

b a sho
Walking without
          Relational crutches




b a sho
Walking without
           Relational crutches
          •Sparse data (optional/multi-value fields)




b a sho
Walking without
           Relational crutches
          •Sparse data (optional/multi-value fields)
          •Richer data structures



b a sho
Walking without
           Relational crutches
          •Sparse data (optional/multi-value fields)
          •Richer data structures
          •Meaningful identifiers


b a sho
Walking without
           Relational crutches
          •Sparse data (optional/multi-value fields)
          •Richer data structures
          •Meaningful identifiers
          •Innovative access patterns

b a sho
Know your data



b a sho
Make your Top 10 list




b a sho
Make your Top 10 list

          •Frequently requested pages/screens




b a sho
Make your Top 10 list

          •Frequently requested pages/screens
          •Slow queries



b a sho
Make your Top 10 list

          •Frequently requested pages/screens
          •Slow queries
          •Secondary indexes


b a sho
Make your Top 10 list

          •Frequently requested pages/screens
          •Slow queries
          •Secondary indexes
          •Complicated joins or aggregations

b a sho
Analyze




b a sho
Analyze

          •Interdependencies, coupling




b a sho
Analyze

          •Interdependencies, coupling
          •Cardinalities of relationships



b a sho
Analyze

          •Interdependencies, coupling
          •Cardinalities of relationships
          •Access pattern


b a sho
Analyze

          •Interdependencies, coupling
          •Cardinalities of relationships
          •Access pattern
          •Shoehorned structures

b a sho
Example



b a sho
Radiant CMS radiantcms.org

b a sho
The “Styled Blog” Template
b a sho
Date-organized pages



             The “Styled Blog” Template
b a sho
Static sidebar content




   Date-organized pages



             The “Styled Blog” Template
b a sho
Administration UI

b a sho
hierarchical site structure


          Administration UI

b a sho
add new pages by parent




                hierarchical site structure


             Administration UI

b a sho
add new pages by parent



                           special “virtual” pages


                hierarchical site structure


             Administration UI

b a sho
b a sho
slug, breadcrumb




b a sho
slug, breadcrumb



             content blocks




b a sho
slug, breadcrumb



                   content blocks


          layout




b a sho
b a sho
template tags




b a sho
Content-Type


             template tags




b a sho
Relational Schema
              pages




b a sho
Relational Schema
              parent

              pages




b a sho
Relational Schema
              parent

              pages    page_parts




b a sho
Relational Schema
              parent

              pages    page_parts


                           layouts




b a sho
Relational Schema
              parent

              pages    page_parts


                           layouts


                        snippets




b a sho
Relational Schema
                   parent

                   pages    page_parts


                                layouts
           users
                             snippets




b a sho
Relational Schema
                          parent

                          pages    page_parts

          created/modified by
                                       layouts
                  users
                                    snippets




b a sho
Converting to Riak



b a sho
Layouts and Snippets




b a sho
Layouts and Snippets
          • Layouts and Snippets
            are accessed by name




b a sho
Layouts and Snippets
          • Layouts and Snippets
            are accessed by name

          • SQL: WHERE name=?




b a sho
Layouts and Snippets
          • Layouts and Snippets
            are accessed by name
                                    layouts/Main
          • SQL: WHERE name=?
          • Simple access by key   snippets/top-nav




b a sho
Layouts and Snippets
          • Layouts and Snippets
            are accessed by name
                                      layouts/Main
          • SQL: WHERE name=?
          • Simple access by key     snippets/top-nav

          • Simple value structure
            (content + metadata)



b a sho
Users
          Normally accessed by login or email: WHERE login=? OR email=?




b a sho
Users
          Normally accessed by login or email: WHERE login=? OR email=?

             • #1: Login or Email key




b a sho
Users
          Normally accessed by login or email: WHERE login=? OR email=?

             • #1: Login or Email key
              • Easy lookup on one,
                  manual index other




b a sho
Users
          Normally accessed by login or email: WHERE login=? OR email=?

             • #1: Login or Email key
              • Easy lookup on one,
                  manual index other

             • #2: Arbitrary key




b a sho
Users
          Normally accessed by login or email: WHERE login=? OR email=?

             • #1: Login or Email key
              • Easy lookup on one,
                  manual index other

             • #2: Arbitrary key
              • Independent of
                  email/login changes




b a sho
Users
          Normally accessed by login or email: WHERE login=? OR email=?

             • #1: Login or Email key
              • Easy lookup on one,
                  manual index other

             • #2: Arbitrary key
              • Independent of
                  email/login changes

               • Manually index both
b a sho
Users
          Normally accessed by login or email: WHERE login=? OR email=?

             • #1: Login or Email key      • #3: Users-list object
              • Easy lookup on one,
                  manual index other

             • #2: Arbitrary key
              • Independent of
                  email/login changes

               • Manually index both
b a sho
Users
          Normally accessed by login or email: WHERE login=? OR email=?

             • #1: Login or Email key      • #3: Users-list object
              • Easy lookup on one,         • Fits “small teams”
                  manual index other             philosophy

             • #2: Arbitrary key
              • Independent of
                  email/login changes

               • Manually index both
b a sho
Users
          Normally accessed by login or email: WHERE login=? OR email=?

             • #1: Login or Email key      • #3: Users-list object
              • Easy lookup on one,         • Fits “small teams”
                  manual index other             philosophy

             • #2: Arbitrary key              • Quick lookup
                                                 (one fetch)
              • Independent of
                  email/login changes

               • Manually index both
b a sho
Users
          Normally accessed by login or email: WHERE login=? OR email=?

             • #1: Login or Email key      • #3: Users-list object
              • Easy lookup on one,         • Fits “small teams”
                  manual index other             philosophy

             • #2: Arbitrary key              • Quick lookup
                                                 (one fetch)
              • Independent of
                  email/login changes         • Bad for large list, still
                                                 need unique IDs
               • Manually index both
b a sho
The Bigger Problems



b a sho
Page Rendering




b a sho
Page Rendering

          • Load and render layout
            in page context




b a sho
Page Rendering

          • Load and render layout
            in page context

          • Render parts, snippets
            via template tags




b a sho
Page Rendering

          • Load and render layout
            in page context

          • Render parts, snippets
            via template tags

          • Iterate over sections of
            page hierarchy




b a sho
Rendering Page Parts




b a sho
Rendering Page Parts

          •Parts are dependent on the page




b a sho
Rendering Page Parts

          •Parts are dependent on the page
          •Compose / Denormalize (part of page)



b a sho
Rendering Page Parts

          •Parts are dependent on the page
          •Compose / Denormalize (part of page)
           •Reduces lookups, conceptual unity, no
              index needed




b a sho
Rendering Page Parts

          •Parts are dependent on the page
          •Compose / Denormalize (part of page)
           •Reduces lookups, conceptual unity, no
              index needed

           • Larger objects, no lazy fetching

b a sho
Denormalized Page
          {
              title:”Home Page”,
              parts:[
                 {name:”body”,
                  content:”...”},
                 {name:”sidebar”,
                  content:”...”},
               ],
               // ...
          }


b a sho
Denormalized Page
          {
              title:”Home Page”,
              parts:[
                 {name:”body”,
                  content:”...”},
                 {name:”sidebar”,
                  content:”...”},
               ],
               // ...
          }                         dependent objects inline

b a sho
Site Hierarchy
          ...or, how to find a page (currently)




b a sho
Site Hierarchy
               ...or, how to find a page (currently)
          • Start at the root:
             WHERE parent_id IS NULL




b a sho
Site Hierarchy
               ...or, how to find a page (currently)
          • Start at the root:
             WHERE parent_id IS NULL



          • Check if the current
             page matches URL




b a sho
Site Hierarchy
               ...or, how to find a page (currently)
          • Start at the root:
             WHERE parent_id IS NULL



          • Check if the current
             page matches URL

          • Check children for
             matching path
             segment, recurse




b a sho
Site Hierarchy
               ...or, how to find a page (currently)
          • Start at the root:
             WHERE parent_id IS NULL



          • Check if the current
             page matches URL

          • Check children for
             matching path
             segment, recurse

          • Return “not found”
             page or 404


b a sho
Site Hierarchy
          ...or, how to find a page (analysis)




b a sho
Site Hierarchy
              ...or, how to find a page (analysis)

          • O(log N) queries to
            find requested page




b a sho
Site Hierarchy
              ...or, how to find a page (analysis)

          • O(log N) queries to
            find requested page

          • Index on parent_id
            speeds retrieval




b a sho
Site Hierarchy
               ...or, how to find a page (analysis)

          • O(log N) queries to
            find requested page

          • Index on parent_id
            speeds retrieval

          • Traversing/iterating for
            content generation




b a sho
Site Hierarchy
               ...or, how to find a page (analysis)

          • O(log N) queries to
            find requested page

          • Index on parent_id
            speeds retrieval

          • Traversing/iterating for
            content generation

          • Generating URL paths

b a sho
Site Hierarchy
          ...or, how to find a page (in Riak)




b a sho
Site Hierarchy
               ...or, how to find a page (in Riak)


          • Blog post:
            http://ow.ly/3jDAO




b a sho
Site Hierarchy
               ...or, how to find a page (in Riak)


          • Blog post:
            http://ow.ly/3jDAO

          • #1 Parent/child links




b a sho
Site Hierarchy
               ...or, how to find a page (in Riak)


          • Blog post:
            http://ow.ly/3jDAO

          • #1 Parent/child links
          • #2 Material path key



b a sho
Site Hierarchy
               ...or, how to find a page (in Riak)


          • Blog post:
            http://ow.ly/3jDAO

          • #1 Parent/child links
          • #2 Material path key
          • #3 Tree object


b a sho
#1: Parent/Child Links
                 A Natural Tree

                                  A



                             B        C


                         D        E       F


b a sho
#1: Parent/Child Links
                             A Natural Tree

          •   Easy to understand &            A
              implement


                                         B        C


                                     D        E       F


b a sho
#1: Parent/Child Links
                               A Natural Tree
                                                    </riak/pages/C>;
                                                     riaktag=”child”

          •   Easy to understand &              A
              implement
                                                          </riak/pages/A>;
                                                          riaktag=”parent”

          • Doubly-linked for easy
              traversal in either          B        C
              direction


                                       D        E         F


b a sho
#1: Parent/Child Links
                               A Natural Tree
                                                    </riak/pages/C>;
                                                     riaktag=”child”

          •   Easy to understand &              A
              implement
                                                          </riak/pages/A>;
                                                          riaktag=”parent”

          • Doubly-linked for easy
              traversal in either          B        C
              direction

          • Easy to move entire
              subtrees                 D        E         F


b a sho
#1: Parent/Child Links
                 A Natural Tree

                                  A



                             B        C


                         D        E       F


b a sho
#1: Parent/Child Links
                             A Natural Tree

                                               A
          • Child order is arbitrary
                                           B       C


                                       D       E       F


b a sho
#1: Parent/Child Links
                             A Natural Tree

                                               A
          • Child order is arbitrary
          • Still O(log N) traversal       B       C


                                       D       E       F


b a sho
#1: Parent/Child Links
                             A Natural Tree

                                               A
          • Child order is arbitrary
          • Still O(log N) traversal       B       C
          • Two writes to add or
            update
                                       D       E       F


b a sho
#2: Material Path Key
              “Best Guess” discovery

                              _root_ (A)


                              B


                              C


                              B/D


                              C/E

                              “pages” bucket

b a sho
#2: Material Path Key
                     “Best Guess” discovery

                                     _root_ (A)
          • Use path-to-page as
            key                      B


                                     C


                                     B/D


                                     C/E

                                     “pages” bucket

b a sho
#2: Material Path Key
                     “Best Guess” discovery

                                     _root_ (A)
          • Use path-to-page as
            key                      B


          • Best case: one lookup    C
            to find requested page
                                     B/D


                                     C/E

                                     “pages” bucket

b a sho
#2: Material Path Key
                      “Best Guess” discovery

                                      _root_ (A)
          • Use path-to-page as
            key                       B


          • Best case: one lookup     C
            to find requested page
                                      B/D
          • Ancestor pages listed
            inside object             C/E

                                      “pages” bucket

b a sho
#2: Material Path Key
                      “Best Guess” discovery
                                    { _root_ (A)
          • Use path-to-page as      title:”D”,
            key                      ancestors:[
                                         B
                                      “B”,
          • Best case: one lookup     “_root_”
                                         C
            to find requested page    ]
                                       B/D
          • Ancestor pages listed
            inside object              C/E

                                      “pages” bucket

b a sho
#2: Material Path Key
              “Best Guess” discovery

                              _root_ (A)


                              B


                              C


                              B/D


                              C/E

                              “pages” bucket

b a sho
#2: Material Path Key
                      “Best Guess” discovery
          • Large update cost for     _root_ (A)
            internal nodes
                                      B


                                      C


                                      B/D


                                      C/E

                                      “pages” bucket

b a sho
#2: Material Path Key
                      “Best Guess” discovery
          • Large update cost for     _root_ (A)
            internal nodes

          • Dynamic URLs hard         B


                                      C


                                      B/D


                                      C/E

                                      “pages” bucket

b a sho
#2: Material Path Key
                      “Best Guess” discovery
          • Large update cost for     _root_ (A)
            internal nodes

          • Dynamic URLs hard         B



          • Key-filters (0.14)         C

            needed for efficient
                                      B/D
            child lists

                                      C/E

                                      “pages” bucket

b a sho
#2: Material Path Key
                       “Best Guess” discovery
          • Large update cost for      _root_ (A)
              internal nodes

          • Dynamic URLs hard          B



          • Key-filters (0.14)          C

              needed for efficient
                                       B/D
              child lists

          •   Need fallback for        C/E

              “misses”
                                       “pages” bucket

b a sho
#3: Tree Object
            “Branches and Leaves”


                       {
                           key:”A”,
                           children:[
                             {key:”B”,
                              children:[“D”]},
                             {key:”C”,
                              children:[“E”,”F”]}
                           ]
                       }




b a sho
#3: Tree Object
                        “Branches and Leaves”

          • One request to get site
            structure
                                      {
                                          key:”A”,
                                          children:[
                                            {key:”B”,
                                             children:[“D”]},
                                            {key:”C”,
                                             children:[“E”,”F”]}
                                          ]
                                      }




b a sho
#3: Tree Object
                        “Branches and Leaves”

          • One request to get site
            structure
                                      {
                                          key:”A”,
          • Separates content from        children:[
                                            {key:”B”,
            organization
                                             children:[“D”]},
                                            {key:”C”,
                                             children:[“E”,”F”]}
                                          ]
                                      }




b a sho
#3: Tree Object
                        “Branches and Leaves”

          • One request to get site
            structure
                                      {
                                          key:”A”,
          • Separates content from        children:[
                                            {key:”B”,
            organization
                                             children:[“D”]},
                                            {key:”C”,
          • Intrinsic ordering            ]
                                             children:[“E”,”F”]}

                                      }




b a sho
#3: Tree Object
                        “Branches and Leaves”

          • One request to get site
            structure
                                      {
                                          key:”A”,
          • Separates content from        children:[
                                            {key:”B”,
            organization
                                             children:[“D”]},
                                            {key:”C”,
          • Intrinsic ordering            ]
                                             children:[“E”,”F”]}

                                      }
          • Massive structure
            changes are quick



b a sho
#3: Tree Object
            “Branches and Leaves”


                       {
                           key:”A”,
                           children:[
                             {key:”B”,
                              children:[“D”]},
                             {key:”C”,
                              children:[“E”,”F”]}
                           ]
                       }




b a sho
#3: Tree Object
                       “Branches and Leaves”
          • Large site = large tree
            object (expensive to
            transfer)                 {
                                          key:”A”,
                                          children:[
                                            {key:”B”,
                                             children:[“D”]},
                                            {key:”C”,
                                             children:[“E”,”F”]}
                                          ]
                                      }




b a sho
#3: Tree Object
                       “Branches and Leaves”
          • Large site = large tree
            object (expensive to
            transfer)                 {
                                          key:”A”,

          • Some metadata                 children:[
                                            {key:”B”,
            (slug?)will need to be           children:[“D”]},
                                            {key:”C”,
            in-tree for efficient             children:[“E”,”F”]}
            traversal                     ]
                                      }




b a sho
#3: Tree Object
                       “Branches and Leaves”
          • Large site = large tree
            object (expensive to
            transfer)                 {
                                          key:”A”,

          • Some metadata                 children:[
                                            {key:”B”,
            (slug?)will need to be           children:[“D”]},
                                            {key:”C”,
            in-tree for efficient             children:[“E”,”F”]}
            traversal                     ]
                                      }

          • Multiple writers
            problematic


b a sho
Hybrid Solutions
              TIMTOWTDI




b a sho
Hybrid Solutions
                         TIMTOWTDI



          •Material paths for quick lookups, links
            for relative traversal




b a sho
Hybrid Solutions
                         TIMTOWTDI



          •Material paths for quick lookups, links
            for relative traversal

          •Tree object for relative lookups,
            secondary index for material paths




b a sho
Key Takeaways




b a sho
Key Takeaways
          •Design for most common access pattern:
            the key is your index




b a sho
Key Takeaways
          •Design for most common access pattern:
            the key is your index

          •Denormalize dependent data types



b a sho
Key Takeaways
          •Design for most common access pattern:
            the key is your index

          •Denormalize dependent data types
          •Build richer (or simpler) data structures


b a sho
Key Takeaways
          •Design for most common access pattern:
            the key is your index

          •Denormalize dependent data types
          •Build richer (or simpler) data structures
          •Use links to connect normalized or
            independent types


b a sho
Useful Tips




b a sho
Useful Tips

          •Use query or identity caches to reduce
            duplicate fetches




b a sho
Useful Tips

          •Use query or identity caches to reduce
            duplicate fetches

          •Store data in JSON, XML, or Erlang
            terms for MapReduce




b a sho
Useful Tips

          •Use query or identity caches to reduce
            duplicate fetches

          •Store data in JSON, XML, or Erlang
            terms for MapReduce

          •Use Riak Search where appropriate to
            reduce complexity


b a sho
Review




b a sho
Review

          •Analyze your relational model




b a sho
Review

          •Analyze your relational model
          •Identify pain points, take stats



b a sho
Review

          •Analyze your relational model
          •Identify pain points, take stats
          •Design some alternatives


b a sho
Review

          •Analyze your relational model
          •Identify pain points, take stats
          •Design some alternatives
          •Test, Measure, Repeat!

b a sho
Plug
          Interested in learning about support,
          consulting, or Enterprise features?
            
          Email info@basho.com or go to
          http://www.basho.com/contact.html to talk
          with us.

                        www.basho.com


b a sho
Plug
          Interested in learning about support,
          consulting, or Enterprise features?
            
          Email info@basho.com or go to
          http://www.basho.com/contact.html to talk
          with us.

                          www.basho.com
                 sean@basho.com
                   @seancribbs

b a sho

Contenu connexe

Similaire à Schema Design for Riak (Take 2)

Linked Data Best Practices and BibFrame
Linked Data Best Practices and BibFrameLinked Data Best Practices and BibFrame
Linked Data Best Practices and BibFrameRobert Sanderson
 
Plone for Education: Bibliographies
Plone for Education: BibliographiesPlone for Education: Bibliographies
Plone for Education: BibliographiesCristopher Ewing
 
Everything You Need To Know About SharePoint Social Capabilities - SPLive360
Everything You Need To Know About SharePoint Social Capabilities - SPLive360Everything You Need To Know About SharePoint Social Capabilities - SPLive360
Everything You Need To Know About SharePoint Social Capabilities - SPLive360Richard Harbridge
 
Project Tools in Web Development
Project Tools in Web DevelopmentProject Tools in Web Development
Project Tools in Web Developmentkmloomis
 
Enterprise 2.0 - Everything You Need To Know About SharePoint 2010 Social Cap...
Enterprise 2.0 - Everything You Need To Know About SharePoint 2010 Social Cap...Enterprise 2.0 - Everything You Need To Know About SharePoint 2010 Social Cap...
Enterprise 2.0 - Everything You Need To Know About SharePoint 2010 Social Cap...Richard Harbridge
 
Selfish Accessibility — Harbour Front HK
Selfish Accessibility — Harbour Front HKSelfish Accessibility — Harbour Front HK
Selfish Accessibility — Harbour Front HKAdrian Roselli
 
Selfish Accessibility — CodeDaze
Selfish Accessibility — CodeDazeSelfish Accessibility — CodeDaze
Selfish Accessibility — CodeDazeAdrian Roselli
 
SPSHawaii: Navigation: A Step Towards Success in SharePoint
SPSHawaii:  Navigation: A Step Towards Success in SharePointSPSHawaii:  Navigation: A Step Towards Success in SharePoint
SPSHawaii: Navigation: A Step Towards Success in SharePointStacy Deere
 
Hortonworks Technical Workshop: HBase For Mission Critical Applications
Hortonworks Technical Workshop: HBase For Mission Critical ApplicationsHortonworks Technical Workshop: HBase For Mission Critical Applications
Hortonworks Technical Workshop: HBase For Mission Critical ApplicationsHortonworks
 
Writing for the Web
Writing for the WebWriting for the Web
Writing for the Webrebrennan
 
Cold-Start Recommendations to Users With Rich Profiles
Cold-Start Recommendations to Users With Rich ProfilesCold-Start Recommendations to Users With Rich Profiles
Cold-Start Recommendations to Users With Rich ProfilesHarlan Harris
 
Harmon.ie Webinar - SharePoint Tips and Tricks for Document Management, User ...
Harmon.ie Webinar - SharePoint Tips and Tricks for Document Management, User ...Harmon.ie Webinar - SharePoint Tips and Tricks for Document Management, User ...
Harmon.ie Webinar - SharePoint Tips and Tricks for Document Management, User ...Richard Harbridge
 
LibGuides v2 Migration
LibGuides v2 MigrationLibGuides v2 Migration
LibGuides v2 MigrationLinda Galloway
 
High ROI Content Strategies for SEO
High ROI Content Strategies for SEOHigh ROI Content Strategies for SEO
High ROI Content Strategies for SEOCyrus Shepard
 
Modeling Data in MongoDB
Modeling Data in MongoDBModeling Data in MongoDB
Modeling Data in MongoDBlehresman
 
Bing Webmaster Tools Women 2.0 2013 presentation
Bing Webmaster Tools Women 2.0 2013 presentationBing Webmaster Tools Women 2.0 2013 presentation
Bing Webmaster Tools Women 2.0 2013 presentationDuane Forrester
 
BITM3730 9-27.pptx
BITM3730 9-27.pptxBITM3730 9-27.pptx
BITM3730 9-27.pptxMattMarino13
 
SharePoint Navigation: A Step Towards Success
SharePoint Navigation: A Step Towards SuccessSharePoint Navigation: A Step Towards Success
SharePoint Navigation: A Step Towards SuccessStacy Deere
 
Corporate blogging
Corporate bloggingCorporate blogging
Corporate bloggingdifuzr
 

Similaire à Schema Design for Riak (Take 2) (20)

Linked Data Best Practices and BibFrame
Linked Data Best Practices and BibFrameLinked Data Best Practices and BibFrame
Linked Data Best Practices and BibFrame
 
Plone for Education: Bibliographies
Plone for Education: BibliographiesPlone for Education: Bibliographies
Plone for Education: Bibliographies
 
Everything You Need To Know About SharePoint Social Capabilities - SPLive360
Everything You Need To Know About SharePoint Social Capabilities - SPLive360Everything You Need To Know About SharePoint Social Capabilities - SPLive360
Everything You Need To Know About SharePoint Social Capabilities - SPLive360
 
Project Tools in Web Development
Project Tools in Web DevelopmentProject Tools in Web Development
Project Tools in Web Development
 
Enterprise 2.0 - Everything You Need To Know About SharePoint 2010 Social Cap...
Enterprise 2.0 - Everything You Need To Know About SharePoint 2010 Social Cap...Enterprise 2.0 - Everything You Need To Know About SharePoint 2010 Social Cap...
Enterprise 2.0 - Everything You Need To Know About SharePoint 2010 Social Cap...
 
Selfish Accessibility — Harbour Front HK
Selfish Accessibility — Harbour Front HKSelfish Accessibility — Harbour Front HK
Selfish Accessibility — Harbour Front HK
 
Selfish Accessibility — CodeDaze
Selfish Accessibility — CodeDazeSelfish Accessibility — CodeDaze
Selfish Accessibility — CodeDaze
 
SPSHawaii: Navigation: A Step Towards Success in SharePoint
SPSHawaii:  Navigation: A Step Towards Success in SharePointSPSHawaii:  Navigation: A Step Towards Success in SharePoint
SPSHawaii: Navigation: A Step Towards Success in SharePoint
 
Hortonworks Technical Workshop: HBase For Mission Critical Applications
Hortonworks Technical Workshop: HBase For Mission Critical ApplicationsHortonworks Technical Workshop: HBase For Mission Critical Applications
Hortonworks Technical Workshop: HBase For Mission Critical Applications
 
Writing for the Web
Writing for the WebWriting for the Web
Writing for the Web
 
Cold-Start Recommendations to Users With Rich Profiles
Cold-Start Recommendations to Users With Rich ProfilesCold-Start Recommendations to Users With Rich Profiles
Cold-Start Recommendations to Users With Rich Profiles
 
Harmon.ie Webinar - SharePoint Tips and Tricks for Document Management, User ...
Harmon.ie Webinar - SharePoint Tips and Tricks for Document Management, User ...Harmon.ie Webinar - SharePoint Tips and Tricks for Document Management, User ...
Harmon.ie Webinar - SharePoint Tips and Tricks for Document Management, User ...
 
LibGuides v2 Migration
LibGuides v2 MigrationLibGuides v2 Migration
LibGuides v2 Migration
 
High ROI Content Strategies for SEO
High ROI Content Strategies for SEOHigh ROI Content Strategies for SEO
High ROI Content Strategies for SEO
 
Modeling Data in MongoDB
Modeling Data in MongoDBModeling Data in MongoDB
Modeling Data in MongoDB
 
Spshnl oh the places you will go in share point
Spshnl   oh the places you will go in share pointSpshnl   oh the places you will go in share point
Spshnl oh the places you will go in share point
 
Bing Webmaster Tools Women 2.0 2013 presentation
Bing Webmaster Tools Women 2.0 2013 presentationBing Webmaster Tools Women 2.0 2013 presentation
Bing Webmaster Tools Women 2.0 2013 presentation
 
BITM3730 9-27.pptx
BITM3730 9-27.pptxBITM3730 9-27.pptx
BITM3730 9-27.pptx
 
SharePoint Navigation: A Step Towards Success
SharePoint Navigation: A Step Towards SuccessSharePoint Navigation: A Step Towards Success
SharePoint Navigation: A Step Towards Success
 
Corporate blogging
Corporate bloggingCorporate blogging
Corporate blogging
 

Plus de Sean Cribbs

Eventually Consistent Data Structures (from strangeloop12)
Eventually Consistent Data Structures (from strangeloop12)Eventually Consistent Data Structures (from strangeloop12)
Eventually Consistent Data Structures (from strangeloop12)Sean Cribbs
 
Eventually-Consistent Data Structures
Eventually-Consistent Data StructuresEventually-Consistent Data Structures
Eventually-Consistent Data StructuresSean Cribbs
 
A Case of Accidental Concurrency
A Case of Accidental ConcurrencyA Case of Accidental Concurrency
A Case of Accidental ConcurrencySean Cribbs
 
Embrace NoSQL and Eventual Consistency with Ripple
Embrace NoSQL and Eventual Consistency with RippleEmbrace NoSQL and Eventual Consistency with Ripple
Embrace NoSQL and Eventual Consistency with RippleSean Cribbs
 
Riak with node.js
Riak with node.jsRiak with node.js
Riak with node.jsSean Cribbs
 
Riak (Øredev nosql day)
Riak (Øredev nosql day)Riak (Øredev nosql day)
Riak (Øredev nosql day)Sean Cribbs
 
Riak Tutorial (Øredev)
Riak Tutorial (Øredev)Riak Tutorial (Øredev)
Riak Tutorial (Øredev)Sean Cribbs
 
The Radiant Ethic
The Radiant EthicThe Radiant Ethic
The Radiant EthicSean Cribbs
 
Introduction to Riak and Ripple (KC.rb)
Introduction to Riak and Ripple (KC.rb)Introduction to Riak and Ripple (KC.rb)
Introduction to Riak and Ripple (KC.rb)Sean Cribbs
 
Introduction to Riak - Red Dirt Ruby Conf Training
Introduction to Riak - Red Dirt Ruby Conf TrainingIntroduction to Riak - Red Dirt Ruby Conf Training
Introduction to Riak - Red Dirt Ruby Conf TrainingSean Cribbs
 
Introducing Riak and Ripple
Introducing Riak and RippleIntroducing Riak and Ripple
Introducing Riak and RippleSean Cribbs
 
Round PEG, Round Hole - Parsing Functionally
Round PEG, Round Hole - Parsing FunctionallyRound PEG, Round Hole - Parsing Functionally
Round PEG, Round Hole - Parsing FunctionallySean Cribbs
 
Story Driven Development With Cucumber
Story Driven Development With CucumberStory Driven Development With Cucumber
Story Driven Development With CucumberSean Cribbs
 
Achieving Parsing Sanity In Erlang
Achieving Parsing Sanity In ErlangAchieving Parsing Sanity In Erlang
Achieving Parsing Sanity In ErlangSean Cribbs
 
Of Rats And Dragons
Of Rats And DragonsOf Rats And Dragons
Of Rats And DragonsSean Cribbs
 
Erlang/OTP for Rubyists
Erlang/OTP for RubyistsErlang/OTP for Rubyists
Erlang/OTP for RubyistsSean Cribbs
 
Content Management That Won't Rot Your Brain
Content Management That Won't Rot Your BrainContent Management That Won't Rot Your Brain
Content Management That Won't Rot Your BrainSean Cribbs
 

Plus de Sean Cribbs (18)

Eventually Consistent Data Structures (from strangeloop12)
Eventually Consistent Data Structures (from strangeloop12)Eventually Consistent Data Structures (from strangeloop12)
Eventually Consistent Data Structures (from strangeloop12)
 
Eventually-Consistent Data Structures
Eventually-Consistent Data StructuresEventually-Consistent Data Structures
Eventually-Consistent Data Structures
 
A Case of Accidental Concurrency
A Case of Accidental ConcurrencyA Case of Accidental Concurrency
A Case of Accidental Concurrency
 
Embrace NoSQL and Eventual Consistency with Ripple
Embrace NoSQL and Eventual Consistency with RippleEmbrace NoSQL and Eventual Consistency with Ripple
Embrace NoSQL and Eventual Consistency with Ripple
 
Riak with node.js
Riak with node.jsRiak with node.js
Riak with node.js
 
Riak (Øredev nosql day)
Riak (Øredev nosql day)Riak (Øredev nosql day)
Riak (Øredev nosql day)
 
Riak Tutorial (Øredev)
Riak Tutorial (Øredev)Riak Tutorial (Øredev)
Riak Tutorial (Øredev)
 
The Radiant Ethic
The Radiant EthicThe Radiant Ethic
The Radiant Ethic
 
Introduction to Riak and Ripple (KC.rb)
Introduction to Riak and Ripple (KC.rb)Introduction to Riak and Ripple (KC.rb)
Introduction to Riak and Ripple (KC.rb)
 
Riak with Rails
Riak with RailsRiak with Rails
Riak with Rails
 
Introduction to Riak - Red Dirt Ruby Conf Training
Introduction to Riak - Red Dirt Ruby Conf TrainingIntroduction to Riak - Red Dirt Ruby Conf Training
Introduction to Riak - Red Dirt Ruby Conf Training
 
Introducing Riak and Ripple
Introducing Riak and RippleIntroducing Riak and Ripple
Introducing Riak and Ripple
 
Round PEG, Round Hole - Parsing Functionally
Round PEG, Round Hole - Parsing FunctionallyRound PEG, Round Hole - Parsing Functionally
Round PEG, Round Hole - Parsing Functionally
 
Story Driven Development With Cucumber
Story Driven Development With CucumberStory Driven Development With Cucumber
Story Driven Development With Cucumber
 
Achieving Parsing Sanity In Erlang
Achieving Parsing Sanity In ErlangAchieving Parsing Sanity In Erlang
Achieving Parsing Sanity In Erlang
 
Of Rats And Dragons
Of Rats And DragonsOf Rats And Dragons
Of Rats And Dragons
 
Erlang/OTP for Rubyists
Erlang/OTP for RubyistsErlang/OTP for Rubyists
Erlang/OTP for Rubyists
 
Content Management That Won't Rot Your Brain
Content Management That Won't Rot Your BrainContent Management That Won't Rot Your Brain
Content Management That Won't Rot Your Brain
 

Dernier

What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 

Dernier (20)

What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 

Schema Design for Riak (Take 2)

  • 1. Schema Design for Riak Sean Cribbs Developer Advocate b a sho
  • 2. Thinking Non-Relationally b a sho
  • 3. “There is no spoon schema.” b a sho
  • 4. There is an application. b a sho
  • 6. What you lose •Tables b a sho
  • 7. What you lose •Tables •Foreign keys and constraints b a sho
  • 8. What you lose •Tables •Foreign keys and constraints •ACID b a sho
  • 9. What you lose •Tables •Foreign keys and constraints •ACID •Sophisticated query planners b a sho
  • 10. What you lose •Tables •Foreign keys and constraints •ACID •Sophisticated query planners •Declarative query language (SQL) b a sho
  • 12. What you gain •More flexible, fluid designs b a sho
  • 13. What you gain •More flexible, fluid designs •More natural data representations b a sho
  • 14. What you gain •More flexible, fluid designs •More natural data representations •Scaling without pain b a sho
  • 15. What you gain •More flexible, fluid designs •More natural data representations •Scaling without pain •Reduced operational complexity b a sho
  • 16. Walking without Relational crutches b a sho
  • 17. Walking without Relational crutches •Sparse data (optional/multi-value fields) b a sho
  • 18. Walking without Relational crutches •Sparse data (optional/multi-value fields) •Richer data structures b a sho
  • 19. Walking without Relational crutches •Sparse data (optional/multi-value fields) •Richer data structures •Meaningful identifiers b a sho
  • 20. Walking without Relational crutches •Sparse data (optional/multi-value fields) •Richer data structures •Meaningful identifiers •Innovative access patterns b a sho
  • 22. Make your Top 10 list b a sho
  • 23. Make your Top 10 list •Frequently requested pages/screens b a sho
  • 24. Make your Top 10 list •Frequently requested pages/screens •Slow queries b a sho
  • 25. Make your Top 10 list •Frequently requested pages/screens •Slow queries •Secondary indexes b a sho
  • 26. Make your Top 10 list •Frequently requested pages/screens •Slow queries •Secondary indexes •Complicated joins or aggregations b a sho
  • 28. Analyze •Interdependencies, coupling b a sho
  • 29. Analyze •Interdependencies, coupling •Cardinalities of relationships b a sho
  • 30. Analyze •Interdependencies, coupling •Cardinalities of relationships •Access pattern b a sho
  • 31. Analyze •Interdependencies, coupling •Cardinalities of relationships •Access pattern •Shoehorned structures b a sho
  • 34. The “Styled Blog” Template b a sho
  • 35. Date-organized pages The “Styled Blog” Template b a sho
  • 36. Static sidebar content Date-organized pages The “Styled Blog” Template b a sho
  • 38. hierarchical site structure Administration UI b a sho
  • 39. add new pages by parent hierarchical site structure Administration UI b a sho
  • 40. add new pages by parent special “virtual” pages hierarchical site structure Administration UI b a sho
  • 43. slug, breadcrumb content blocks b a sho
  • 44. slug, breadcrumb content blocks layout b a sho
  • 47. Content-Type template tags b a sho
  • 48. Relational Schema pages b a sho
  • 49. Relational Schema parent pages b a sho
  • 50. Relational Schema parent pages page_parts b a sho
  • 51. Relational Schema parent pages page_parts layouts b a sho
  • 52. Relational Schema parent pages page_parts layouts snippets b a sho
  • 53. Relational Schema parent pages page_parts layouts users snippets b a sho
  • 54. Relational Schema parent pages page_parts created/modified by layouts users snippets b a sho
  • 57. Layouts and Snippets • Layouts and Snippets are accessed by name b a sho
  • 58. Layouts and Snippets • Layouts and Snippets are accessed by name • SQL: WHERE name=? b a sho
  • 59. Layouts and Snippets • Layouts and Snippets are accessed by name layouts/Main • SQL: WHERE name=? • Simple access by key snippets/top-nav b a sho
  • 60. Layouts and Snippets • Layouts and Snippets are accessed by name layouts/Main • SQL: WHERE name=? • Simple access by key snippets/top-nav • Simple value structure (content + metadata) b a sho
  • 61. Users Normally accessed by login or email: WHERE login=? OR email=? b a sho
  • 62. Users Normally accessed by login or email: WHERE login=? OR email=? • #1: Login or Email key b a sho
  • 63. Users Normally accessed by login or email: WHERE login=? OR email=? • #1: Login or Email key • Easy lookup on one, manual index other b a sho
  • 64. Users Normally accessed by login or email: WHERE login=? OR email=? • #1: Login or Email key • Easy lookup on one, manual index other • #2: Arbitrary key b a sho
  • 65. Users Normally accessed by login or email: WHERE login=? OR email=? • #1: Login or Email key • Easy lookup on one, manual index other • #2: Arbitrary key • Independent of email/login changes b a sho
  • 66. Users Normally accessed by login or email: WHERE login=? OR email=? • #1: Login or Email key • Easy lookup on one, manual index other • #2: Arbitrary key • Independent of email/login changes • Manually index both b a sho
  • 67. Users Normally accessed by login or email: WHERE login=? OR email=? • #1: Login or Email key • #3: Users-list object • Easy lookup on one, manual index other • #2: Arbitrary key • Independent of email/login changes • Manually index both b a sho
  • 68. Users Normally accessed by login or email: WHERE login=? OR email=? • #1: Login or Email key • #3: Users-list object • Easy lookup on one, • Fits “small teams” manual index other philosophy • #2: Arbitrary key • Independent of email/login changes • Manually index both b a sho
  • 69. Users Normally accessed by login or email: WHERE login=? OR email=? • #1: Login or Email key • #3: Users-list object • Easy lookup on one, • Fits “small teams” manual index other philosophy • #2: Arbitrary key • Quick lookup (one fetch) • Independent of email/login changes • Manually index both b a sho
  • 70. Users Normally accessed by login or email: WHERE login=? OR email=? • #1: Login or Email key • #3: Users-list object • Easy lookup on one, • Fits “small teams” manual index other philosophy • #2: Arbitrary key • Quick lookup (one fetch) • Independent of email/login changes • Bad for large list, still need unique IDs • Manually index both b a sho
  • 73. Page Rendering • Load and render layout in page context b a sho
  • 74. Page Rendering • Load and render layout in page context • Render parts, snippets via template tags b a sho
  • 75. Page Rendering • Load and render layout in page context • Render parts, snippets via template tags • Iterate over sections of page hierarchy b a sho
  • 77. Rendering Page Parts •Parts are dependent on the page b a sho
  • 78. Rendering Page Parts •Parts are dependent on the page •Compose / Denormalize (part of page) b a sho
  • 79. Rendering Page Parts •Parts are dependent on the page •Compose / Denormalize (part of page) •Reduces lookups, conceptual unity, no index needed b a sho
  • 80. Rendering Page Parts •Parts are dependent on the page •Compose / Denormalize (part of page) •Reduces lookups, conceptual unity, no index needed • Larger objects, no lazy fetching b a sho
  • 81. Denormalized Page { title:”Home Page”, parts:[ {name:”body”, content:”...”}, {name:”sidebar”, content:”...”}, ], // ... } b a sho
  • 82. Denormalized Page { title:”Home Page”, parts:[ {name:”body”, content:”...”}, {name:”sidebar”, content:”...”}, ], // ... } dependent objects inline b a sho
  • 83. Site Hierarchy ...or, how to find a page (currently) b a sho
  • 84. Site Hierarchy ...or, how to find a page (currently) • Start at the root: WHERE parent_id IS NULL b a sho
  • 85. Site Hierarchy ...or, how to find a page (currently) • Start at the root: WHERE parent_id IS NULL • Check if the current page matches URL b a sho
  • 86. Site Hierarchy ...or, how to find a page (currently) • Start at the root: WHERE parent_id IS NULL • Check if the current page matches URL • Check children for matching path segment, recurse b a sho
  • 87. Site Hierarchy ...or, how to find a page (currently) • Start at the root: WHERE parent_id IS NULL • Check if the current page matches URL • Check children for matching path segment, recurse • Return “not found” page or 404 b a sho
  • 88. Site Hierarchy ...or, how to find a page (analysis) b a sho
  • 89. Site Hierarchy ...or, how to find a page (analysis) • O(log N) queries to find requested page b a sho
  • 90. Site Hierarchy ...or, how to find a page (analysis) • O(log N) queries to find requested page • Index on parent_id speeds retrieval b a sho
  • 91. Site Hierarchy ...or, how to find a page (analysis) • O(log N) queries to find requested page • Index on parent_id speeds retrieval • Traversing/iterating for content generation b a sho
  • 92. Site Hierarchy ...or, how to find a page (analysis) • O(log N) queries to find requested page • Index on parent_id speeds retrieval • Traversing/iterating for content generation • Generating URL paths b a sho
  • 93. Site Hierarchy ...or, how to find a page (in Riak) b a sho
  • 94. Site Hierarchy ...or, how to find a page (in Riak) • Blog post: http://ow.ly/3jDAO b a sho
  • 95. Site Hierarchy ...or, how to find a page (in Riak) • Blog post: http://ow.ly/3jDAO • #1 Parent/child links b a sho
  • 96. Site Hierarchy ...or, how to find a page (in Riak) • Blog post: http://ow.ly/3jDAO • #1 Parent/child links • #2 Material path key b a sho
  • 97. Site Hierarchy ...or, how to find a page (in Riak) • Blog post: http://ow.ly/3jDAO • #1 Parent/child links • #2 Material path key • #3 Tree object b a sho
  • 98. #1: Parent/Child Links A Natural Tree A B C D E F b a sho
  • 99. #1: Parent/Child Links A Natural Tree • Easy to understand & A implement B C D E F b a sho
  • 100. #1: Parent/Child Links A Natural Tree </riak/pages/C>; riaktag=”child” • Easy to understand & A implement </riak/pages/A>; riaktag=”parent” • Doubly-linked for easy traversal in either B C direction D E F b a sho
  • 101. #1: Parent/Child Links A Natural Tree </riak/pages/C>; riaktag=”child” • Easy to understand & A implement </riak/pages/A>; riaktag=”parent” • Doubly-linked for easy traversal in either B C direction • Easy to move entire subtrees D E F b a sho
  • 102. #1: Parent/Child Links A Natural Tree A B C D E F b a sho
  • 103. #1: Parent/Child Links A Natural Tree A • Child order is arbitrary B C D E F b a sho
  • 104. #1: Parent/Child Links A Natural Tree A • Child order is arbitrary • Still O(log N) traversal B C D E F b a sho
  • 105. #1: Parent/Child Links A Natural Tree A • Child order is arbitrary • Still O(log N) traversal B C • Two writes to add or update D E F b a sho
  • 106. #2: Material Path Key “Best Guess” discovery _root_ (A) B C B/D C/E “pages” bucket b a sho
  • 107. #2: Material Path Key “Best Guess” discovery _root_ (A) • Use path-to-page as key B C B/D C/E “pages” bucket b a sho
  • 108. #2: Material Path Key “Best Guess” discovery _root_ (A) • Use path-to-page as key B • Best case: one lookup C to find requested page B/D C/E “pages” bucket b a sho
  • 109. #2: Material Path Key “Best Guess” discovery _root_ (A) • Use path-to-page as key B • Best case: one lookup C to find requested page B/D • Ancestor pages listed inside object C/E “pages” bucket b a sho
  • 110. #2: Material Path Key “Best Guess” discovery { _root_ (A) • Use path-to-page as title:”D”, key ancestors:[ B “B”, • Best case: one lookup “_root_” C to find requested page ] B/D • Ancestor pages listed inside object C/E “pages” bucket b a sho
  • 111. #2: Material Path Key “Best Guess” discovery _root_ (A) B C B/D C/E “pages” bucket b a sho
  • 112. #2: Material Path Key “Best Guess” discovery • Large update cost for _root_ (A) internal nodes B C B/D C/E “pages” bucket b a sho
  • 113. #2: Material Path Key “Best Guess” discovery • Large update cost for _root_ (A) internal nodes • Dynamic URLs hard B C B/D C/E “pages” bucket b a sho
  • 114. #2: Material Path Key “Best Guess” discovery • Large update cost for _root_ (A) internal nodes • Dynamic URLs hard B • Key-filters (0.14) C needed for efficient B/D child lists C/E “pages” bucket b a sho
  • 115. #2: Material Path Key “Best Guess” discovery • Large update cost for _root_ (A) internal nodes • Dynamic URLs hard B • Key-filters (0.14) C needed for efficient B/D child lists • Need fallback for C/E “misses” “pages” bucket b a sho
  • 116. #3: Tree Object “Branches and Leaves” { key:”A”, children:[ {key:”B”, children:[“D”]}, {key:”C”, children:[“E”,”F”]} ] } b a sho
  • 117. #3: Tree Object “Branches and Leaves” • One request to get site structure { key:”A”, children:[ {key:”B”, children:[“D”]}, {key:”C”, children:[“E”,”F”]} ] } b a sho
  • 118. #3: Tree Object “Branches and Leaves” • One request to get site structure { key:”A”, • Separates content from children:[ {key:”B”, organization children:[“D”]}, {key:”C”, children:[“E”,”F”]} ] } b a sho
  • 119. #3: Tree Object “Branches and Leaves” • One request to get site structure { key:”A”, • Separates content from children:[ {key:”B”, organization children:[“D”]}, {key:”C”, • Intrinsic ordering ] children:[“E”,”F”]} } b a sho
  • 120. #3: Tree Object “Branches and Leaves” • One request to get site structure { key:”A”, • Separates content from children:[ {key:”B”, organization children:[“D”]}, {key:”C”, • Intrinsic ordering ] children:[“E”,”F”]} } • Massive structure changes are quick b a sho
  • 121. #3: Tree Object “Branches and Leaves” { key:”A”, children:[ {key:”B”, children:[“D”]}, {key:”C”, children:[“E”,”F”]} ] } b a sho
  • 122. #3: Tree Object “Branches and Leaves” • Large site = large tree object (expensive to transfer) { key:”A”, children:[ {key:”B”, children:[“D”]}, {key:”C”, children:[“E”,”F”]} ] } b a sho
  • 123. #3: Tree Object “Branches and Leaves” • Large site = large tree object (expensive to transfer) { key:”A”, • Some metadata children:[ {key:”B”, (slug?)will need to be children:[“D”]}, {key:”C”, in-tree for efficient children:[“E”,”F”]} traversal ] } b a sho
  • 124. #3: Tree Object “Branches and Leaves” • Large site = large tree object (expensive to transfer) { key:”A”, • Some metadata children:[ {key:”B”, (slug?)will need to be children:[“D”]}, {key:”C”, in-tree for efficient children:[“E”,”F”]} traversal ] } • Multiple writers problematic b a sho
  • 125. Hybrid Solutions TIMTOWTDI b a sho
  • 126. Hybrid Solutions TIMTOWTDI •Material paths for quick lookups, links for relative traversal b a sho
  • 127. Hybrid Solutions TIMTOWTDI •Material paths for quick lookups, links for relative traversal •Tree object for relative lookups, secondary index for material paths b a sho
  • 129. Key Takeaways •Design for most common access pattern: the key is your index b a sho
  • 130. Key Takeaways •Design for most common access pattern: the key is your index •Denormalize dependent data types b a sho
  • 131. Key Takeaways •Design for most common access pattern: the key is your index •Denormalize dependent data types •Build richer (or simpler) data structures b a sho
  • 132. Key Takeaways •Design for most common access pattern: the key is your index •Denormalize dependent data types •Build richer (or simpler) data structures •Use links to connect normalized or independent types b a sho
  • 134. Useful Tips •Use query or identity caches to reduce duplicate fetches b a sho
  • 135. Useful Tips •Use query or identity caches to reduce duplicate fetches •Store data in JSON, XML, or Erlang terms for MapReduce b a sho
  • 136. Useful Tips •Use query or identity caches to reduce duplicate fetches •Store data in JSON, XML, or Erlang terms for MapReduce •Use Riak Search where appropriate to reduce complexity b a sho
  • 138. Review •Analyze your relational model b a sho
  • 139. Review •Analyze your relational model •Identify pain points, take stats b a sho
  • 140. Review •Analyze your relational model •Identify pain points, take stats •Design some alternatives b a sho
  • 141. Review •Analyze your relational model •Identify pain points, take stats •Design some alternatives •Test, Measure, Repeat! b a sho
  • 142. Plug Interested in learning about support, consulting, or Enterprise features?   Email info@basho.com or go to http://www.basho.com/contact.html to talk with us. www.basho.com b a sho
  • 143. Plug Interested in learning about support, consulting, or Enterprise features?   Email info@basho.com or go to http://www.basho.com/contact.html to talk with us. www.basho.com sean@basho.com @seancribbs b a sho

Notes de l'éditeur

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n
  73. \n
  74. \n
  75. \n
  76. \n
  77. \n
  78. \n
  79. \n
  80. \n
  81. \n
  82. \n
  83. \n
  84. \n
  85. \n
  86. \n
  87. \n
  88. \n
  89. \n
  90. \n
  91. \n
  92. \n
  93. \n
  94. \n
  95. \n
  96. \n
  97. \n
  98. \n
  99. \n
  100. \n
  101. \n
  102. \n
  103. \n
  104. \n
  105. \n
  106. \n
  107. \n
  108. \n
  109. \n
  110. \n
  111. \n
  112. \n
  113. \n
  114. \n
  115. \n
  116. \n
  117. \n
  118. \n
  119. \n
  120. \n
  121. \n
  122. \n