4. CREATE TABLE users (
id uuid PRIMARY KEY,
name text,
state text,
birth_date int
);
!
!
CREATE INDEX ON users(state);
!
SELECT * FROM users
WHERE state=‘Texas’
AND birth_date > 1950;
New Core Value
•Massively scalable
•High performance
•Reliable/Available
•Productivity + ease of use
5. CREATE TABLE users (
id uuid PRIMARY KEY,
name text,
state text,
birth_date int
);
Collections
6. CREATE TABLE users (
id uuid PRIMARY KEY,
name text,
state text,
birth_date int
);
CREATE TABLE users_addresses (
user_id uuid REFERENCES users,
email text
);
!
SELECT *
FROM users NATURAL JOIN users_addresses;
Collections
7. CREATE TABLE users (
id uuid PRIMARY KEY,
name text,
state text,
birth_date int
);
CREATE TABLE users_addresses (
user_id uuid REFERENCES users,
email text
);
!
SELECT *
FROM users NATURAL JOIN users_addresses;
X
Collections
8. CREATE TABLE users (
id uuid PRIMARY KEY,
name text,
state text,
birth_date int,
email_addresses set<text>
);
Collections
9. UPDATE users
SET email_addresses = email_addresses +
{‘jbellis@gmail.com’, ‘jbellis@datastax.com’};
CREATE TABLE users (
id uuid PRIMARY KEY,
name text,
state text,
birth_date int,
email_addresses set<text>
);
Collections
47. User defined types
CREATE TYPE address (
street text,
city text,
zip_code int,
phones set<text>
)
!
CREATE TABLE users (
id uuid PRIMARY KEY,
name text,
addresses map<text, address>
)
!
SELECT id, name, addresses.city, addresses.phones FROM users;
!
id | name | addresses.city | addresses.phones
--------------------+----------------+--------------------------
63bf691f | jbellis | Austin | {'512-4567', '512-9999'}
48. Collection indexing
CREATE TABLE songs (
id uuid PRIMARY KEY,
artist text,
album text,
title text,
data blob,
tags set<text>
);
!
CREATE INDEX song_tags_idx ON songs(tags);
!
SELECT * FROM songs WHERE tags CONTAINS 'blues';
!
id | album | artist | tags | title
----------+---------------+-------------------+-----------------------+------------------
5027b27e | Country Blues | Lightnin' Hopkins | {'acoustic', 'blues'} | Worrying My Mind
!
!
54. Counters++
•simpler implementation, no more edge cases
•possible to properly repair now
•significantly less garbage and internode traffic generated
•better performance for 99% of uses
55. Counters++
•simpler implementation, no more edge cases
•possible to properly repair now
•significantly less garbage and internode traffic generated
•better performance for 99% of uses
•RF>1, replicate_on_write=true
56. Counters++
•simpler implementation, no more edge cases
•possible to properly repair now
•significantly less garbage and internode traffic generated
•better performance for 99% of uses
•RF>1, replicate_on_write=true
•topology changes not leading to data loss (#4071)
57. Counters++
•simpler implementation, no more edge cases
•possible to properly repair now
•significantly less garbage and internode traffic generated
•better performance for 99% of uses
•RF>1, replicate_on_write=true
•topology changes not leading to data loss (#4071)
•commitlog now 100% safe to replay (#4417)
58. Counters++
•simpler implementation, no more edge cases
•possible to properly repair now
•significantly less garbage and internode traffic generated
•better performance for 99% of uses
•RF>1, replicate_on_write=true
•topology changes not leading to data loss (#4071)
•commitlog now 100% safe to replay (#4417)
•Internal format overhaul still coming in 3.0 (#6506)
62. What hasn’t changed
•same API
•same average throughput
•same restrictions on mixing counter and non-counter columns
63. What hasn’t changed
•same API
•same average throughput
•same restrictions on mixing counter and non-counter columns
•same restrictions on mixing counter and non-counter updates
64. What hasn’t changed
•same API
•same average throughput
•same restrictions on mixing counter and non-counter columns
•same restrictions on mixing counter and non-counter updates
•same restrictions on counter deletes
65. What hasn’t changed
•same API
•same average throughput
•same restrictions on mixing counter and non-counter columns
•same restrictions on mixing counter and non-counter updates
•same restrictions on counter deletes
•same retry limitations
89. The new row cache
CREATE TABLE notifications (
target_user text,
notification_id timeuuid,
source_id uuid,
source_type text,
activity text,
PRIMARY KEY (target_user, notification_id)
)
WITH CLUSTERING ORDER BY (notification_id DESC)
AND caching = 'rows_only'
AND rows_per_partition_to_cache = '3';
!
90. The new row cache
target_user notification_id source_id source_type activity
nick e1bd2bcb- d972b679- photo jbellis liked
nick 321998c- d972b679- photo rbranson commented
nick ea1c5d35- 88a049d5- user
mbulman created
account
nick 5321998c- 64613f27- photo jbellis commented
nick 07581439- 076eab7e- user
thobbs created
account
rbranson 1c34467a- f04e309f- user
jbellis created
account
91. The new row cache
target_user notification_id source_id source_type activity
nick e1bd2bcb- d972b679- photo jbellis liked
nick 321998c- d972b679- photo rbranson commented
nick ea1c5d35- 88a049d5- user
mbulman created
account
nick 5321998c- 64613f27- photo jbellis commented
nick 07581439- 076eab7e- user
thobbs created
account
rbranson 1c34467a- f04e309f- user
jbellis created
account