SlideShare a Scribd company logo
Exploring Data Modeling
Doing More with Lists
2 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc.
 Hi again! I’m Ronen Botzer, and I’m a solutions architect at Aerospike.
 I’ve worked at Aerospike since June 2014, first on the Python and PHP clients.
 I’m active on StackOverflow and the Aerospike community forum.
 This is the second in a series of tech talks about data modeling.
 Check out the slides from the first Israeli ASUG meetup.
Welcome to Aerospike User Group – Tel Aviv!
3 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc.
 A Quick Overview of Aerospike Data Types
 The List API – Modify flags, return types for List operations
 Modeling with Lists
 Lists as queues
 Unique ordered lists
 Containers for time series data
 Leaderboards
 New Additions to the Map API
Agenda
4 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc.
Aerospike is a Primary Key Database
Objects stored in Aerospike are called records
A bin holds the value of a supported data type: integer, double, string, bytes, list, map,
geospatial
Every record is uniquely identified by the 3-tuple (namespace, set, primary-key)
A record contains one or more bins
(namespace, set, primary-key)
EXP – Expiration Timestamp
LUT – Last Update Time
GEN – Generation
RECORD
EXP LUT GEN BIN1 BIN2
5 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc.
 Aerospike is a row-oriented distributed database
 Rows (records) contain one or more columns (bins)
 Similar to an RDBMS with primary-key table lookups
 Single record transactions
 Namespaces can be configured for strong consistency
Aerospike Concepts
Aerospike RDBMS
Namespace Tablespace or Database
Set Table
Record Row
Bin Column
Bin type
Integer
Double
String
Bytes
List (Unordered, Ordered)
Map (Unordered,
K-Ordered, KV-Ordered)
GeoJSON
6 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc.
 Aerospike data types have powerful APIs.
 Atomic operations simplify application logic and reduce network load.
 Complex Data Types (List, Map) can be nested to many levels.
 Atomic operations can execute only at the top level of a List or Map.
 Native operations perform and scale better than UDFs.
Data Modeling in Aerospike
7 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc.
[ 1, 4, 7, 3, 9, 26, 11 ]
 The index is the (0 origin) position of an element in the list.
 The value at index 2 is 7. The value at index -2 is 26.
 The rank is the value order of the elements in the list.
 The lowest value element has rank 0. The highest value element has rank -1.
 The value of the element with rank 2 is 4. The value of the element with rank -2 is 11.
List Terms
8 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc.
 Starting with release 3.16, a List has a type, either unordered (default) or ordered.
Unordered [ 1, 4, 7, 3, 9, 26, 11 ]
Ordered [ 1, 3, 4, 7, 9, 11, 26 ]
 An unordered list maintains insertion order, as long as new elements are appended.
 An ordered list maintains rank order, and sorts itself every time new elements are added.
List Types
9 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc.
Ordered [ 1, 3, 4, 7, 9, 11, 26, 'a', 'c', [ 25, 'y' ] ]
 Elements of different data types are ordered by type.
 Nil < (Boolean) < Integer < String < List < Map < Bytes < Double < GeoJSON
 In an unordered list, getting elements by rank will obey this (just-in-time) ordering.
List Element Ordering
10 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc.
List operations supported by the server. Method names in the clients might be different.
set_type() (unordered, ordered)
append(), append_items(), insert(), insert_items(), set()
increment()
sort(), clear(), size()
remove_by_index(), remove_by_index_range()
remove_by_rank(), remove_by_rank_range()
remove_by_value(), remove_by_value_interval(), remove_all_by_value()
remove_all_by_value_list(), remove_by_value_rel_rank_range()
get_by_index(), get_by_index_range()
get_by_rank(), get_by_rank_range()
get_by_value(), get_by_value_interval(), get_all_by_value()
get_all_by_value_list(), get_by_value_rel_rank_range()
List Operations
11 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc.
Unordered [ 1, 4, 7, 3, 9, [ 25 ], 11 ]
 List increment() is atomic, and can only execute on integer or float values.
 You cannot increment the value at index 5 because its data type is a list.
 Atomic list operations only work against top level elements, not nested values.
Incrementing a List Value
12 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc.
opFlags include the result type flags and the INVERTED flag.
Return Types for List Operations
Result Type Description
None No results
Index Index order: 0 = smallest index, -1 = largest index
RevIndex Reverse index order: 0 = largest index
Rank Value order: 0 = smallest value, -1 = largest value
RevRank Reverse value order: 0 = largest value
Count Return number of items matching criteria
Value Value for single item operations, list of values for multi-ops
13 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc.
Unordered [ 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233 ]
Queue:
append_items([377, 610], UNORDERED)
Dequeue:
remove_by_index_range(VALUE, 0, 1)
Lists as Queues
14 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc.
 append(value[, createType, modifyFlag])
 append_items(items[, createType, modifyFlag])
 insert(index, value[, modifyFlag])
 insert_items(index, items[, modifyFlag])
Modify Flags for Operations that Add Elements
Flag Description
ADD_UNIQUE Only add elements that do not already exist in the list
INSERT_BOUNDED Do not insert past index N, where N is element count
NO_FAIL No-op instead of fail if policy violation occured, such as
ADD_UNIQUE or INSERT_BOUNDED
DO_PARTIAL When used with NO_FAIL, add elements that did not violate
policy
15 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc.
modifyFlags = ADD_UNIQUE | DO_PARTIAL| NO_FAIL
• append_items(ORDERED, [ 'michaelz', 'robert', 'minting', 'srini' ], modifyFlags)
• append_items(ORDERED, [ 'srini', 'psi', 'mark', 'tibor' ], modifyFlags)
• append_items(ORDERED, [ 'matt', 'heidi', 'claudia', 'brianb' ], modifyFlags)
• get_by_index_range(VALUE, 0)
['brianb', 'claudia', 'heidi', 'mark', 'matt', 'michaelz', 'minting', 'psi',
'robert', 'srini', 'tibor']
Unique Contacts using Ordered Lists
16 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc.
Starting Aerospike Database 4.3.1, lists are compared as follows
1. [1, 1] < [1, 3] – Compare the entries in order.
2. [1, 2] < [1, 2, 0, 1] – Length is the secondary criteria.
So [1, 1] < [1, 2] < [1, 2, 0, 1] < [1, 3]
This can be used by these List API methods
• get_by_value_interval( [v1, nil], [v2, nil] )
• get_all_by_value( [v1, *])
• get_all_by_value_list( [v1, *], [v2, *])
* In the C client * is AS_CMP_WILDCARD, in the Python client it’s Aerospike.CDTWildcard(),
etc
How List Values are Compared
17 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc.
[
[1523474230000, 39.04],
[1523474231001, 39.78],
[1523474236006, 40.07],
[1523474235005, 41.18],
[1523474233003, 40.89],
[1523474234004, 40.93]
]
get_all_by_value_interval(VALUE, [1523474231000, nil], [1523474234000, nil])
[
[1523474231001: 39.78],
[1523474233003: 40.89]
]
Lists as Containers for Time Series Data
18 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc.
[
[1523474230000, 39.04],
[1523474231001, 39.78],
[1523474236006, 40.07],
[1523474235005, 41.18],
[1523474233003, 40.89],
[1523474234004, 40.93]
]
Insert a list of [timestamp, price] tuples; remove all but the most recent 100 elements; return the size.
ops = [
append_items([ [1523474237007, 40.11], [1523474238008, 40.26], .. ], UNORDERED)
remove_by_rank_range(NONE | INVERTED, -100, 100)
size()
]
operate(ops)
Lists as Capped Collections
19 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc.
[
[10.03, "Jim Hines", "Sacramento, USA", "June 20, 1968"],
[10.02, "Charles Greene", "Mexico City, Mexico", "October 13, 1968"],
[9.95, "Jim Hines", "Mexico City, Mexico", "October 14, 1968"],
[9.93, "Calvin Smith", "Colorado Springs, USA", "July 3, 1983"],
[9.93, "Carl Lewis", "Rome, Italy", "August 30, 1987"],
[9.92, "Carl Lewis", "Seoul, South Korea", "September 24, 1988"]
]
get_by_value_rel_rank_range(VALUE, [10.0, nil], -1, 2)
[
[9.95, 'Jim Hines', 'Mexico City, Mexico', 'October 14, 1968'],
[10.02, 'Charles Greene', 'Mexico City, Mexico', 'October 13, 1968']
]
Lists as Leaderboards
20 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc.
Map operations supported by the server. Method names in the clients might be different.
set_type() (unordered, k-ordered or kv-ordered)
add(), add_items(), increment(), decrement(), size(), clear()
remove_by_key(), remove_by_index(), remove_by_rank()
remove_by_key_interval(), remove_by_index_range()
remove_by_value_interval(), remove_by_rank_range(), remove_all_by_value()
remove_by_key_rel_index_range(), remove_by_value_rel_rank_range()
remove_all_by_key_list(), remove_all_by_value_list()
get_by_key(), get_by_index(), get_by_rank()
get_by_key_interval(), get_by_index_range()
get_by_value_interval(), get_by_rank_range(), get_all_by_value()
get_by_key_rel_index_range(), get_by_value_rel_rank_range()
get_all_by_key_list(), get_all_by_value_list()
Map Operations – New Additions
21 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc.
{
1523474230000: ['fav', {'sku':1, 'b':2}],
1523474231001: ['comment', {'sku':2, 'b':22}],
1523474236006: ['viewed', {'foo':'bar', 'sku':3, 'zz':'top'}],
1523474235005: ['comment', {'sku':1, 'c':1234}],
1523474233003: ['viewed', {'sku':3, 'z':26}],
1523474234004: ['viewed', {'sku':1, 'ff':'hhhl'}]
}
get_key_rel_index_range(KEYVALUE, 1523474232000, -1, 2)
{
1523474231001: ['comment', {'b': 22, 'sku': 2}],
1523474233003: ['viewed', {'sku': 3, 'z': 26}]
}
Maps as Containers for Events – Timestamp Keys
22 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc.
{
'0edf5b73-535c-4be7-b653-c0513dc79fb4': [1523474230, "Billie Jean is not my lover", "MJ"],
'29342a0b-e20f-4676-9ecf-dfdf02ef6683': [1523474241, "She's just a girl who", "MJ"],
'31a8ba1b-8415-aab7-0ecc-56ee659f0a83': [1523474245, "claims that I am the one", "MJ"],
'9f54b4f8-992e-427f-9fb3-e63348cd6ac9': [1523474249, "...", "Tito"],
'1ae56b18-7a3c-4f64-adb7-2e845eb5094e': [1523474257, "But the kid is not my son", "MJ"],
'08785e96-eb1b-4a74-a767-7b56e8f13ea9': [1523474306, "ok...", "Tito"],
'319fa1a6-0640-4354-a426-10c4d3459f0a': [1523474316, "Hee-hee!", "MJ"]
}
get_by_value_rel_rank_range(VALUE, [1523474235, nil], -1, 2)
{
[1523474230, 'Billie Jean is not my lover', 'MJ'],
[1523474241, "She's just a girl who", 'MJ']
}
Maps as Containers for Events – Timestamp Values
23 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc.
 We talked about Aerospike’s data types, and how they can be used for modeling
 We looked more closely at the List API
 We modeled several collection types with lists
 Relative key-index range and relative value-rank methods are really useful!
What next?
 If you haven’t seen it, take a look at the slides from the first Israeli ASUG meetup
 Go to GitHub; clone the code samples repo; run it; read the code
 Read the Aerospike blog. Get familiar with all the database features
 Participate in the community forum (https://discuss.aerospike.com), StackOverflow’s
aerospike tag
Summary
24 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc.
List & Map API
 https://www.aerospike.com/docs/guide/cdt-list.html
 https://www.aerospike.com/docs/guide/cdt-ordering.html
 https://www.aerospike.com/docs/guide/cdt-list-ops.html
 https://aerospike-python-
client.readthedocs.io/en/latest/aerospike_helpers.operations.html
 https://www.aerospike.com/apidocs/java/com/aerospike/client/cdt/ListOperation.html
 https://www.aerospike.com/docs/guide/cdt-map.html
Code Samples
 https://github.com/rbotzer/aerospike-cdt-examples
Aerospike Training
 https://www.aerospike.com/training/
More material you can explore:
Thank You!
Any questions?
ronen@aerospike.com

More Related Content

What's hot

Css Display Property
Css Display PropertyCss Display Property
Css Display Property
Webtech Learning
 
Infix prefix postfix expression -conversion
Infix  prefix postfix expression -conversionInfix  prefix postfix expression -conversion
Infix prefix postfix expression -conversion
Syed Mustafa
 
Queue
QueueQueue
Spring Caches with Protocol Buffers
Spring Caches with Protocol BuffersSpring Caches with Protocol Buffers
Spring Caches with Protocol Buffers
VMware Tanzu
 
PHP 8.1 - What's new and changed
PHP 8.1 - What's new and changedPHP 8.1 - What's new and changed
PHP 8.1 - What's new and changed
Ayesh Karunaratne
 
2022 HTML5: The future is now
2022 HTML5: The future is now2022 HTML5: The future is now
2022 HTML5: The future is now
Gonzalo Cordero
 
Introduction to JCR and Apache Jackrabbi
Introduction to JCR and Apache JackrabbiIntroduction to JCR and Apache Jackrabbi
Introduction to JCR and Apache JackrabbiJukka Zitting
 
Logging with Elasticsearch, Logstash & Kibana
Logging with Elasticsearch, Logstash & KibanaLogging with Elasticsearch, Logstash & Kibana
Logging with Elasticsearch, Logstash & KibanaAmazee Labs
 
Array Presentation (EngineerBaBu.com)
Array Presentation (EngineerBaBu.com)Array Presentation (EngineerBaBu.com)
Array Presentation (EngineerBaBu.com)
EngineerBabu
 
Using Logstash, elasticsearch & kibana
Using Logstash, elasticsearch & kibanaUsing Logstash, elasticsearch & kibana
Using Logstash, elasticsearch & kibana
Alejandro E Brito Monedero
 
ES6 presentation
ES6 presentationES6 presentation
ES6 presentation
ritika1
 
Numpy tutorial
Numpy tutorialNumpy tutorial
Numpy tutorial
HarikaReddy115
 
Presentation of bootstrap
Presentation of bootstrapPresentation of bootstrap
Presentation of bootstrap
1amitgupta
 
Railway Oriented Programming
Railway Oriented ProgrammingRailway Oriented Programming
Railway Oriented Programming
Scott Wlaschin
 
Vector
VectorVector
Data structures in c#
Data structures in c#Data structures in c#
Data structures in c#
SivaSankar Gorantla
 
Java presentation on insertion sort
Java presentation on insertion sortJava presentation on insertion sort
Java presentation on insertion sort_fahad_shaikh
 
stacks and queues
stacks and queuesstacks and queues
stacks and queues
DurgaDeviCbit
 
Html images syntax
Html images syntaxHtml images syntax
Html images syntax
JayjZens
 

What's hot (20)

Css Display Property
Css Display PropertyCss Display Property
Css Display Property
 
Infix prefix postfix expression -conversion
Infix  prefix postfix expression -conversionInfix  prefix postfix expression -conversion
Infix prefix postfix expression -conversion
 
Queue
QueueQueue
Queue
 
Spring Caches with Protocol Buffers
Spring Caches with Protocol BuffersSpring Caches with Protocol Buffers
Spring Caches with Protocol Buffers
 
PHP 8.1 - What's new and changed
PHP 8.1 - What's new and changedPHP 8.1 - What's new and changed
PHP 8.1 - What's new and changed
 
2022 HTML5: The future is now
2022 HTML5: The future is now2022 HTML5: The future is now
2022 HTML5: The future is now
 
Introduction to JCR and Apache Jackrabbi
Introduction to JCR and Apache JackrabbiIntroduction to JCR and Apache Jackrabbi
Introduction to JCR and Apache Jackrabbi
 
Logging with Elasticsearch, Logstash & Kibana
Logging with Elasticsearch, Logstash & KibanaLogging with Elasticsearch, Logstash & Kibana
Logging with Elasticsearch, Logstash & Kibana
 
Array Presentation (EngineerBaBu.com)
Array Presentation (EngineerBaBu.com)Array Presentation (EngineerBaBu.com)
Array Presentation (EngineerBaBu.com)
 
Using Logstash, elasticsearch & kibana
Using Logstash, elasticsearch & kibanaUsing Logstash, elasticsearch & kibana
Using Logstash, elasticsearch & kibana
 
ES6 presentation
ES6 presentationES6 presentation
ES6 presentation
 
Numpy tutorial
Numpy tutorialNumpy tutorial
Numpy tutorial
 
Presentation of bootstrap
Presentation of bootstrapPresentation of bootstrap
Presentation of bootstrap
 
Arrays in PHP
Arrays in PHPArrays in PHP
Arrays in PHP
 
Railway Oriented Programming
Railway Oriented ProgrammingRailway Oriented Programming
Railway Oriented Programming
 
Vector
VectorVector
Vector
 
Data structures in c#
Data structures in c#Data structures in c#
Data structures in c#
 
Java presentation on insertion sort
Java presentation on insertion sortJava presentation on insertion sort
Java presentation on insertion sort
 
stacks and queues
stacks and queuesstacks and queues
stacks and queues
 
Html images syntax
Html images syntaxHtml images syntax
Html images syntax
 

Similar to Exploring Modeling - Doing More with Lists

Aerospike Nested CDTs - Meetup Dec 2019
Aerospike Nested CDTs - Meetup Dec 2019Aerospike Nested CDTs - Meetup Dec 2019
Aerospike Nested CDTs - Meetup Dec 2019
Aerospike
 
TSAT Presentation1.pptx
TSAT Presentation1.pptxTSAT Presentation1.pptx
TSAT Presentation1.pptx
Rajitha Reddy Alugati
 
Java Collections
Java CollectionsJava Collections
Java Collections
rithustutorials
 
High Performance GPU computing with Ruby, Rubykaigi 2018
High Performance GPU computing with Ruby, Rubykaigi 2018High Performance GPU computing with Ruby, Rubykaigi 2018
High Performance GPU computing with Ruby, Rubykaigi 2018
Prasun Anand
 
Wcf data services
Wcf data servicesWcf data services
Wcf data services
Eyal Vardi
 
Get started with R lang
Get started with R langGet started with R lang
Get started with R lang
senthil0809
 
20180420 hk-the powerofmysql8
20180420 hk-the powerofmysql820180420 hk-the powerofmysql8
20180420 hk-the powerofmysql8
Ivan Ma
 
Aerospike User Group: Exploring Data Modeling
Aerospike User Group: Exploring Data ModelingAerospike User Group: Exploring Data Modeling
Aerospike User Group: Exploring Data Modeling
Brillix
 
IRJET- Comparison of Stack and Queue Data Structures
IRJET- Comparison of Stack and Queue Data StructuresIRJET- Comparison of Stack and Queue Data Structures
IRJET- Comparison of Stack and Queue Data Structures
IRJET Journal
 
Making Nested Columns as First Citizen in Apache Spark SQL
Making Nested Columns as First Citizen in Apache Spark SQLMaking Nested Columns as First Citizen in Apache Spark SQL
Making Nested Columns as First Citizen in Apache Spark SQL
Databricks
 
9781337102087 ppt ch16
9781337102087 ppt ch169781337102087 ppt ch16
9781337102087 ppt ch16
Terry Yoast
 
Certification preparation - Net classses and functions.pptx
Certification preparation - Net classses and functions.pptxCertification preparation - Net classses and functions.pptx
Certification preparation - Net classses and functions.pptx
Rohit Radhakrishnan
 
Optimizer percona live_ams2015
Optimizer percona live_ams2015Optimizer percona live_ams2015
Optimizer percona live_ams2015
Manyi Lu
 
.Net Classes and Objects | UiPath Community
.Net Classes and Objects | UiPath Community.Net Classes and Objects | UiPath Community
.Net Classes and Objects | UiPath Community
Rohit Radhakrishnan
 
LINQ.pptx
LINQ.pptxLINQ.pptx
LINQ.pptx
IrfanPinjari2
 
Tk2323 lecture 9 api json
Tk2323 lecture 9   api jsonTk2323 lecture 9   api json
Tk2323 lecture 9 api json
MengChun Lam
 
Data visualization in python/Django
Data visualization in python/DjangoData visualization in python/Django
Data visualization in python/Django
kenluck2001
 
Pebank java handsout
Pebank java handsoutPebank java handsout
Pebank java handsout
PE-BANK
 
Association Rule Mining using RHadoop
Association Rule Mining using RHadoopAssociation Rule Mining using RHadoop
Association Rule Mining using RHadoop
IRJET Journal
 

Similar to Exploring Modeling - Doing More with Lists (20)

Aerospike Nested CDTs - Meetup Dec 2019
Aerospike Nested CDTs - Meetup Dec 2019Aerospike Nested CDTs - Meetup Dec 2019
Aerospike Nested CDTs - Meetup Dec 2019
 
TSAT Presentation1.pptx
TSAT Presentation1.pptxTSAT Presentation1.pptx
TSAT Presentation1.pptx
 
Java Collections
Java CollectionsJava Collections
Java Collections
 
High Performance GPU computing with Ruby, Rubykaigi 2018
High Performance GPU computing with Ruby, Rubykaigi 2018High Performance GPU computing with Ruby, Rubykaigi 2018
High Performance GPU computing with Ruby, Rubykaigi 2018
 
Wcf data services
Wcf data servicesWcf data services
Wcf data services
 
Get started with R lang
Get started with R langGet started with R lang
Get started with R lang
 
20180420 hk-the powerofmysql8
20180420 hk-the powerofmysql820180420 hk-the powerofmysql8
20180420 hk-the powerofmysql8
 
Aerospike User Group: Exploring Data Modeling
Aerospike User Group: Exploring Data ModelingAerospike User Group: Exploring Data Modeling
Aerospike User Group: Exploring Data Modeling
 
Cs341
Cs341Cs341
Cs341
 
IRJET- Comparison of Stack and Queue Data Structures
IRJET- Comparison of Stack and Queue Data StructuresIRJET- Comparison of Stack and Queue Data Structures
IRJET- Comparison of Stack and Queue Data Structures
 
Making Nested Columns as First Citizen in Apache Spark SQL
Making Nested Columns as First Citizen in Apache Spark SQLMaking Nested Columns as First Citizen in Apache Spark SQL
Making Nested Columns as First Citizen in Apache Spark SQL
 
9781337102087 ppt ch16
9781337102087 ppt ch169781337102087 ppt ch16
9781337102087 ppt ch16
 
Certification preparation - Net classses and functions.pptx
Certification preparation - Net classses and functions.pptxCertification preparation - Net classses and functions.pptx
Certification preparation - Net classses and functions.pptx
 
Optimizer percona live_ams2015
Optimizer percona live_ams2015Optimizer percona live_ams2015
Optimizer percona live_ams2015
 
.Net Classes and Objects | UiPath Community
.Net Classes and Objects | UiPath Community.Net Classes and Objects | UiPath Community
.Net Classes and Objects | UiPath Community
 
LINQ.pptx
LINQ.pptxLINQ.pptx
LINQ.pptx
 
Tk2323 lecture 9 api json
Tk2323 lecture 9   api jsonTk2323 lecture 9   api json
Tk2323 lecture 9 api json
 
Data visualization in python/Django
Data visualization in python/DjangoData visualization in python/Django
Data visualization in python/Django
 
Pebank java handsout
Pebank java handsoutPebank java handsout
Pebank java handsout
 
Association Rule Mining using RHadoop
Association Rule Mining using RHadoopAssociation Rule Mining using RHadoop
Association Rule Mining using RHadoop
 

Recently uploaded

Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
kalichargn70th171
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
IES VE
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
Tier1 app
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
Cyanic lab
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
vrstrong314
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
Globus
 

Recently uploaded (20)

Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 

Exploring Modeling - Doing More with Lists

  • 2. 2 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc.  Hi again! I’m Ronen Botzer, and I’m a solutions architect at Aerospike.  I’ve worked at Aerospike since June 2014, first on the Python and PHP clients.  I’m active on StackOverflow and the Aerospike community forum.  This is the second in a series of tech talks about data modeling.  Check out the slides from the first Israeli ASUG meetup. Welcome to Aerospike User Group – Tel Aviv!
  • 3. 3 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc.  A Quick Overview of Aerospike Data Types  The List API – Modify flags, return types for List operations  Modeling with Lists  Lists as queues  Unique ordered lists  Containers for time series data  Leaderboards  New Additions to the Map API Agenda
  • 4. 4 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc. Aerospike is a Primary Key Database Objects stored in Aerospike are called records A bin holds the value of a supported data type: integer, double, string, bytes, list, map, geospatial Every record is uniquely identified by the 3-tuple (namespace, set, primary-key) A record contains one or more bins (namespace, set, primary-key) EXP – Expiration Timestamp LUT – Last Update Time GEN – Generation RECORD EXP LUT GEN BIN1 BIN2
  • 5. 5 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc.  Aerospike is a row-oriented distributed database  Rows (records) contain one or more columns (bins)  Similar to an RDBMS with primary-key table lookups  Single record transactions  Namespaces can be configured for strong consistency Aerospike Concepts Aerospike RDBMS Namespace Tablespace or Database Set Table Record Row Bin Column Bin type Integer Double String Bytes List (Unordered, Ordered) Map (Unordered, K-Ordered, KV-Ordered) GeoJSON
  • 6. 6 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc.  Aerospike data types have powerful APIs.  Atomic operations simplify application logic and reduce network load.  Complex Data Types (List, Map) can be nested to many levels.  Atomic operations can execute only at the top level of a List or Map.  Native operations perform and scale better than UDFs. Data Modeling in Aerospike
  • 7. 7 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc. [ 1, 4, 7, 3, 9, 26, 11 ]  The index is the (0 origin) position of an element in the list.  The value at index 2 is 7. The value at index -2 is 26.  The rank is the value order of the elements in the list.  The lowest value element has rank 0. The highest value element has rank -1.  The value of the element with rank 2 is 4. The value of the element with rank -2 is 11. List Terms
  • 8. 8 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc.  Starting with release 3.16, a List has a type, either unordered (default) or ordered. Unordered [ 1, 4, 7, 3, 9, 26, 11 ] Ordered [ 1, 3, 4, 7, 9, 11, 26 ]  An unordered list maintains insertion order, as long as new elements are appended.  An ordered list maintains rank order, and sorts itself every time new elements are added. List Types
  • 9. 9 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc. Ordered [ 1, 3, 4, 7, 9, 11, 26, 'a', 'c', [ 25, 'y' ] ]  Elements of different data types are ordered by type.  Nil < (Boolean) < Integer < String < List < Map < Bytes < Double < GeoJSON  In an unordered list, getting elements by rank will obey this (just-in-time) ordering. List Element Ordering
  • 10. 10 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc. List operations supported by the server. Method names in the clients might be different. set_type() (unordered, ordered) append(), append_items(), insert(), insert_items(), set() increment() sort(), clear(), size() remove_by_index(), remove_by_index_range() remove_by_rank(), remove_by_rank_range() remove_by_value(), remove_by_value_interval(), remove_all_by_value() remove_all_by_value_list(), remove_by_value_rel_rank_range() get_by_index(), get_by_index_range() get_by_rank(), get_by_rank_range() get_by_value(), get_by_value_interval(), get_all_by_value() get_all_by_value_list(), get_by_value_rel_rank_range() List Operations
  • 11. 11 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc. Unordered [ 1, 4, 7, 3, 9, [ 25 ], 11 ]  List increment() is atomic, and can only execute on integer or float values.  You cannot increment the value at index 5 because its data type is a list.  Atomic list operations only work against top level elements, not nested values. Incrementing a List Value
  • 12. 12 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc. opFlags include the result type flags and the INVERTED flag. Return Types for List Operations Result Type Description None No results Index Index order: 0 = smallest index, -1 = largest index RevIndex Reverse index order: 0 = largest index Rank Value order: 0 = smallest value, -1 = largest value RevRank Reverse value order: 0 = largest value Count Return number of items matching criteria Value Value for single item operations, list of values for multi-ops
  • 13. 13 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc. Unordered [ 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233 ] Queue: append_items([377, 610], UNORDERED) Dequeue: remove_by_index_range(VALUE, 0, 1) Lists as Queues
  • 14. 14 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc.  append(value[, createType, modifyFlag])  append_items(items[, createType, modifyFlag])  insert(index, value[, modifyFlag])  insert_items(index, items[, modifyFlag]) Modify Flags for Operations that Add Elements Flag Description ADD_UNIQUE Only add elements that do not already exist in the list INSERT_BOUNDED Do not insert past index N, where N is element count NO_FAIL No-op instead of fail if policy violation occured, such as ADD_UNIQUE or INSERT_BOUNDED DO_PARTIAL When used with NO_FAIL, add elements that did not violate policy
  • 15. 15 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc. modifyFlags = ADD_UNIQUE | DO_PARTIAL| NO_FAIL • append_items(ORDERED, [ 'michaelz', 'robert', 'minting', 'srini' ], modifyFlags) • append_items(ORDERED, [ 'srini', 'psi', 'mark', 'tibor' ], modifyFlags) • append_items(ORDERED, [ 'matt', 'heidi', 'claudia', 'brianb' ], modifyFlags) • get_by_index_range(VALUE, 0) ['brianb', 'claudia', 'heidi', 'mark', 'matt', 'michaelz', 'minting', 'psi', 'robert', 'srini', 'tibor'] Unique Contacts using Ordered Lists
  • 16. 16 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc. Starting Aerospike Database 4.3.1, lists are compared as follows 1. [1, 1] < [1, 3] – Compare the entries in order. 2. [1, 2] < [1, 2, 0, 1] – Length is the secondary criteria. So [1, 1] < [1, 2] < [1, 2, 0, 1] < [1, 3] This can be used by these List API methods • get_by_value_interval( [v1, nil], [v2, nil] ) • get_all_by_value( [v1, *]) • get_all_by_value_list( [v1, *], [v2, *]) * In the C client * is AS_CMP_WILDCARD, in the Python client it’s Aerospike.CDTWildcard(), etc How List Values are Compared
  • 17. 17 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc. [ [1523474230000, 39.04], [1523474231001, 39.78], [1523474236006, 40.07], [1523474235005, 41.18], [1523474233003, 40.89], [1523474234004, 40.93] ] get_all_by_value_interval(VALUE, [1523474231000, nil], [1523474234000, nil]) [ [1523474231001: 39.78], [1523474233003: 40.89] ] Lists as Containers for Time Series Data
  • 18. 18 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc. [ [1523474230000, 39.04], [1523474231001, 39.78], [1523474236006, 40.07], [1523474235005, 41.18], [1523474233003, 40.89], [1523474234004, 40.93] ] Insert a list of [timestamp, price] tuples; remove all but the most recent 100 elements; return the size. ops = [ append_items([ [1523474237007, 40.11], [1523474238008, 40.26], .. ], UNORDERED) remove_by_rank_range(NONE | INVERTED, -100, 100) size() ] operate(ops) Lists as Capped Collections
  • 19. 19 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc. [ [10.03, "Jim Hines", "Sacramento, USA", "June 20, 1968"], [10.02, "Charles Greene", "Mexico City, Mexico", "October 13, 1968"], [9.95, "Jim Hines", "Mexico City, Mexico", "October 14, 1968"], [9.93, "Calvin Smith", "Colorado Springs, USA", "July 3, 1983"], [9.93, "Carl Lewis", "Rome, Italy", "August 30, 1987"], [9.92, "Carl Lewis", "Seoul, South Korea", "September 24, 1988"] ] get_by_value_rel_rank_range(VALUE, [10.0, nil], -1, 2) [ [9.95, 'Jim Hines', 'Mexico City, Mexico', 'October 14, 1968'], [10.02, 'Charles Greene', 'Mexico City, Mexico', 'October 13, 1968'] ] Lists as Leaderboards
  • 20. 20 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc. Map operations supported by the server. Method names in the clients might be different. set_type() (unordered, k-ordered or kv-ordered) add(), add_items(), increment(), decrement(), size(), clear() remove_by_key(), remove_by_index(), remove_by_rank() remove_by_key_interval(), remove_by_index_range() remove_by_value_interval(), remove_by_rank_range(), remove_all_by_value() remove_by_key_rel_index_range(), remove_by_value_rel_rank_range() remove_all_by_key_list(), remove_all_by_value_list() get_by_key(), get_by_index(), get_by_rank() get_by_key_interval(), get_by_index_range() get_by_value_interval(), get_by_rank_range(), get_all_by_value() get_by_key_rel_index_range(), get_by_value_rel_rank_range() get_all_by_key_list(), get_all_by_value_list() Map Operations – New Additions
  • 21. 21 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc. { 1523474230000: ['fav', {'sku':1, 'b':2}], 1523474231001: ['comment', {'sku':2, 'b':22}], 1523474236006: ['viewed', {'foo':'bar', 'sku':3, 'zz':'top'}], 1523474235005: ['comment', {'sku':1, 'c':1234}], 1523474233003: ['viewed', {'sku':3, 'z':26}], 1523474234004: ['viewed', {'sku':1, 'ff':'hhhl'}] } get_key_rel_index_range(KEYVALUE, 1523474232000, -1, 2) { 1523474231001: ['comment', {'b': 22, 'sku': 2}], 1523474233003: ['viewed', {'sku': 3, 'z': 26}] } Maps as Containers for Events – Timestamp Keys
  • 22. 22 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc. { '0edf5b73-535c-4be7-b653-c0513dc79fb4': [1523474230, "Billie Jean is not my lover", "MJ"], '29342a0b-e20f-4676-9ecf-dfdf02ef6683': [1523474241, "She's just a girl who", "MJ"], '31a8ba1b-8415-aab7-0ecc-56ee659f0a83': [1523474245, "claims that I am the one", "MJ"], '9f54b4f8-992e-427f-9fb3-e63348cd6ac9': [1523474249, "...", "Tito"], '1ae56b18-7a3c-4f64-adb7-2e845eb5094e': [1523474257, "But the kid is not my son", "MJ"], '08785e96-eb1b-4a74-a767-7b56e8f13ea9': [1523474306, "ok...", "Tito"], '319fa1a6-0640-4354-a426-10c4d3459f0a': [1523474316, "Hee-hee!", "MJ"] } get_by_value_rel_rank_range(VALUE, [1523474235, nil], -1, 2) { [1523474230, 'Billie Jean is not my lover', 'MJ'], [1523474241, "She's just a girl who", 'MJ'] } Maps as Containers for Events – Timestamp Values
  • 23. 23 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc.  We talked about Aerospike’s data types, and how they can be used for modeling  We looked more closely at the List API  We modeled several collection types with lists  Relative key-index range and relative value-rank methods are really useful! What next?  If you haven’t seen it, take a look at the slides from the first Israeli ASUG meetup  Go to GitHub; clone the code samples repo; run it; read the code  Read the Aerospike blog. Get familiar with all the database features  Participate in the community forum (https://discuss.aerospike.com), StackOverflow’s aerospike tag Summary
  • 24. 24 Proprietary & Confidential | All rights reserved. © 2018 Aerospike Inc. List & Map API  https://www.aerospike.com/docs/guide/cdt-list.html  https://www.aerospike.com/docs/guide/cdt-ordering.html  https://www.aerospike.com/docs/guide/cdt-list-ops.html  https://aerospike-python- client.readthedocs.io/en/latest/aerospike_helpers.operations.html  https://www.aerospike.com/apidocs/java/com/aerospike/client/cdt/ListOperation.html  https://www.aerospike.com/docs/guide/cdt-map.html Code Samples  https://github.com/rbotzer/aerospike-cdt-examples Aerospike Training  https://www.aerospike.com/training/ More material you can explore:

Editor's Notes

  1. Who am I?
  2. Remind everybody that there are training classes. See aerospike.com/training
  3. We’ll start with a recap from the beginning of my previous talk
  4. In an RDBMS we connect to a database. In that database we have tables containing rows. Each row will typically have a primary key that uniquely identifies it Rows contain one or more columns of a supported data types Most applications avoid entity-relationship purity for access speed, denormalizing into a single table, and accessed by primary-key lookup
  5. Do not use UDFs for latency sensitive operations. There’s a place for them, and that’s covered in training.
  6. This isn’t Lua. Decent people don’t start arrays at 1.
  7. Removing items and inserting items other than at the end will shift the elements
  8. Boolean has a place holder, but it’s not an official data type
  9. These are the atomic list operations supported by the server The method names for these operations is slightly different in each language client. Python: list_get_by_rank_range() The set_type() method is declared in the Java client through the ListOrder argument to the ListPolicy constructor. Python client has it explicitly.
  10. useful for faster remove operations Previous examples use KeyValue return type
  11. The VALUE return type will return the front of the queue while removing it from the list.
  12. In the Java client these are fields of class ListWriteFlags
  13. ‘srini’ was added once, and the elements are in order Because of ADD_UNIQUE this should fail. We tall it to NO_FAIL, and also to do the best it can with DO_PARTIAL
  14. Value intervals are [inclusive, exclusive) and nil is the lowest value in ordering. Nil is used in value ranges Wildcard is used when looking for specific values – single value or list of specific values
  15. Fetch and operate on time slices of events Inserting at index 0 or appending to the end are both O(1) operations in a list
  16. Both operations are wrapped in a single transaction, under a record lock. Again, Aerospike is a primary key database.
  17. The list of 100 Meter world records (unique values) Finding elements by relative rank. 10.0 isn’t an actual value in the list, but this allows us to extract the element with the nearest -1 rank and a total of 2 elements.
  18. New relative index and relative rank methods Java client getByKeyRelativeIndexRange, getByKeyRelativeIndexRange, getByValueRelativeRankRange, getByValueRelativeRankRange We’ll see examples of how to use relative rank k >= origin + index and [k < origin + index + count]
  19. There is no such key, but relative index range gets us the key before and after the given balue
  20. Because time increases monotonously, rank operations can also be used “The two most recent messages”
  21. More of these to come