+ All Categories
Home > Technology > NoSQL Implementation - Part 1 (Velocity 2015)

NoSQL Implementation - Part 1 (Velocity 2015)

Date post: 07-Aug-2015
Category:
Upload: basho-technologies
View: 396 times
Download: 0 times
Share this document with a friend
Popular Tags:
15
NoSQL Implementations Real-world designs explored by Matt Brender
Transcript
Page 1: NoSQL Implementation - Part 1 (Velocity 2015)

NoSQL Implementations

Real-world designs explored by

Matt Brender

Page 2: NoSQL Implementation - Part 1 (Velocity 2015)

Aging Buckets

Emphasis on persisting data.Not a lot of data.

Possibility of conflict.

2

Page 3: NoSQL Implementation - Part 1 (Velocity 2015)

Aging Buckets

Problem

Difficult to know what user viewed who’s profile• Don’t want to heavily edit current database design• Want a simple, scalable solution

Solution

Buckets of relationships using sets (CRDT)• Allows for simultaneous writes without siblings• Denormalize and flatten data as JSON• Store in Riak, index with Solr

3

Page 4: NoSQL Implementation - Part 1 (Velocity 2015)

Aging Buckets

{

[“Beth” : “Tom”],[“Beth” : “Jim”],[“Beth” : “George”]

}

2015:05:27

{

[“George” : “Tom”],[“Beth” : “Jim”],[“George” : “Jim”]

}

2015:05:26

{

[“Tom” : “Beth”],[“Beth” : “Tom”],[“George” : “Jim”]

}

2015:05:25

4

Page 5: NoSQL Implementation - Part 1 (Velocity 2015)

Aging Buckets

Riak

5

ClientClient

Client

Page 6: NoSQL Implementation - Part 1 (Velocity 2015)

Aging Buckets

Riak

6

ClientClient

Client

{ [“Tom” : “Beth”],[“Beth” : “Tom”],[“George” : “Jim”] }

{ [“Tom” : “Beth”],[“Beth” : “Tom”],[“George” : “Jim”] }

Page 7: NoSQL Implementation - Part 1 (Velocity 2015)

Aging Buckets

Riak

7

ClientClient

Client

{ [“Tom” : “Beth”],[“Beth” : “Tom”],[“George” : “Jim”] }

{ [“Jane”: “Tom”],[“Tom” : “Beth”],[“Beth” : “Tom”],[“George” : “Jim”] }

Page 8: NoSQL Implementation - Part 1 (Velocity 2015)

Aging Buckets

Riak

8

ClientClient

Client

{ [“Jane”: “Tom”],[“Tom” : “Beth”],[“Beth” : “Tom”],[“George” : “Jim”] }

{ [“Jane”: “Tom”],[“Tom” : “Beth”],[“Beth” : “Tom”],[“George” : “Jim”] }

Page 9: NoSQL Implementation - Part 1 (Velocity 2015)

Aging Buckets

Riak

9

ClientClient

Client

{ [“Jane”: “Tom”],[“Tom” : “Beth”],[“Beth” : “Tom”],[“George” : “Jim”] }

{ [“Jane”: “Tom”],[“Tom” : “Beth”],[“Beth” : “Tom”],[“George” : “Jim”] } {

[“Jane”: “Tom”],[“Tom” : “Beth”],[“Beth” : “Tom”],[“George” : “Jim”] }

Page 10: NoSQL Implementation - Part 1 (Velocity 2015)

Aging Buckets

Riak

10

ClientClient

Client

{ [“Jane”: “Tom”],[“Tom” : “Beth”],[“Beth” : “Tom”],[“George” : “Jim”] }

{ [“Jane”: “Tom”],[“Tom” : “Beth”],[“Beth” : “Tom”],[“George” : “Jim”] } {

[“Jane”: “Tom”],[“Tom” : “Beth”],[“Beth” : “Tom”],[“George” : “Jim”] }

Page 11: NoSQL Implementation - Part 1 (Velocity 2015)

Aging Buckets

Riak

11

ClientClient

Client

{ [“Jane”: “Tom”],[“Tom” : “Beth”],[“Beth” : “Tom”],[“George” : “Jim”],[“Tom”: “Jane”] }

{ [“Jane”: “Tom”],[“Tom” : “Beth”],[“Beth” : “Tom”],[“George” : “Jim”] } {

[“Jane”: “Tom”],[“Tom” : “Beth”],[“Beth” : “Tom”],[“George” : “Jim”] }

Page 12: NoSQL Implementation - Part 1 (Velocity 2015)

Aging Buckets

Riak

12

ClientClient

Client

{ [“Jane”: “Tom”],[“Tom” : “Beth”],[“Beth” : “Tom”],[“George” : “Jim”],[“Tom”: “Jane”] }

{ [“Jane”: “Tom”],[“Tom” : “Beth”],[“Beth” : “Tom”],[“George” : “Jim”],[“Beth”, “Jane”]} {

[“Jane”: “Tom”],[“Tom” : “Beth”],[“Beth” : “Tom”],[“George” : “Jim”] }

Page 13: NoSQL Implementation - Part 1 (Velocity 2015)

Aging Buckets

Riak

13

ClientClient

Client

{ [“Jane”: “Tom”],[“Tom” : “Beth”],[“Beth” : “Tom”],[“George” : “Jim”],[“Tom”: “Jane”] }

{ [“Jane”: “Tom”],[“Tom” : “Beth”],[“Beth” : “Tom”],[“George” : “Jim”],[“Beth”, “Jane”]}

{ [“Jane”: “Tom”],[“Tom” : “Beth”],[“Beth” : “Tom”],[“George” : “Jim”],[“Beth”, “Jane”]}

Page 14: NoSQL Implementation - Part 1 (Velocity 2015)

14

Bucket propertiesan important step in this case

➜ bin/riak-admin bucket-type create sets '{"props":{"datatype":"set"}}'

sets created

➜ bin/riak-admin bucket-type activate setssets has been activated

require ‘riak’Riak::Crdt::DEFAULT_BUCKET_TYPES[:set] = 'sets'

Page 15: NoSQL Implementation - Part 1 (Velocity 2015)

Aging Buckets

{ [“Jane”: “Tom”], [“Tom” : “Beth”], [“Beth” : “Tom”], [“George” : “Jim”], [“Tom”: “Jane”], [“Beth”: “Jane”] }

15

{ [“Jane”: “Tom”],[“Tom” : “Beth”],[“Beth” : “Tom”],[“George” : “Jim”],[“Tom”: “Jane”] }

{ [“Jane”: “Tom”],[“Tom” : “Beth”],[“Beth” : “Tom”],[“George” : “Jim”],[“Beth”, “Jane”]}

}set CRDT behavior


Recommended