SlideShare a Scribd company logo
1 of 57
Download to read offline
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
SPRINGONE2GX
WASHINGTON, DC
Cassandra and Grails
By Jeff Beck
@beckje01
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Agenda
• whoami
• What is Cassandra
• Cassandra Terminology
• Basic Data Modeling
• What is Available for Grails
• Cassandra ORM
• Cassandra GORM
• Astyanax
• Java Native Driver
• Which to Use
• Basic Configuration
2
• Tools to Use
• Advanced Data Modeling
• TokenStore Example
• Cleaning Up Mistakes
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
$ whoami
Jeff Beck
• Engineer at SmartThings
• Ratpack Team Member
• Organize Minneapolis Cassandra Meetup
3
beckje01
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
What is Cassandra
• Fast Writing Data Store
• Highly-Available, Distributed, Tuned Consistency
• Master-less Replication
• Redundancy Configurable
• Cluster can span Data Centers
4
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
When Cassandra
• High write throughput needs
• Cross datacenter replication required
• Mature data access patterns
5
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
When Not Cassandra
• When you depend on transactions
• Not sure how you will access the data
• Lack the shared responsibility on the running of Cassandra
6
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Cassandra Terminology
• Thrift - The old way to interface with Cassandra. Now longer getting
enhancements.
• CQL / CQL v3 - The new native protocol that replaced Thrift and the new way to
model data.
• Replication Factor - How many nodes will have a copy of the data.
• Consistency Level - When executing a query how many nodes need to agree.
• Cluster vs Ring
7
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Cassandra - Cluster vs Ring
8
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Data Modeling
It’s hard you are going to make mistakes.
9
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Basic Data Modeling
• You need to focus on Fan Out on Write, not the more traditional Fan Out on
Read.
• With Cassandra you really need to focus on the query not the thing being
represented.
10
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Basic Data Modeling Hints
• Duplicate Data
• Natural Key
• Careful around adding an index
• Get a Second Opinion
11
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Data Modeling Example Problem
Users have access to a location we want to get the details of a location for a
particular user.
12
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
SQL Solution
13
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
CQL Solution
14
1 CREATE TABLE user_location (
2 username text,
3 location_id text,
4 shard_id text,
5 name text,
6 background_image text,
7 PRIMARY KEY (username, location_id)
8 );
Notice the fanout on write, given 2 users with access to a location we will write 2
rows. We have to do that on the application side.
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Model your interactions as all idempotent upserts if possible. This is the
best case for Cassandra.
15
Idempotent Upserts
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
What is Available for Grails
• ORMs
• Cassandra ORM
• Cassandra GORM
• Direct Cassandra Access
• Astyanax Plugin
• Java Native Driver
16
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
The older of the two ORMs this was modeled after GORM but doesn't fully
participate in GORM.
Based on top of Astyanax and Thrift.
Provides many nice features out of the box that makes getting something
woking very quick.
17
Cassandra ORM
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Advantages
• Counters
• Indices
• Relations
• Expando map
18
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Drawbacks
• Dealing with bootstrapping
• Based on Thrift
• Only easy data access is via the application
19
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Example Object
20
1 class AppScheduledEventHistory {
2 UUID id
3 String shard
4 String appId
5 Date scheduledTime
6 Long executionTime
7 AppScheduledEventStatus executionStatus
8
9 static cassandraMapping = [
10 unindexedPrimaryKey: "id",
11 explicitIndexes: [ ["appId"],
12 ["scheduledEventId"],
13 ["timeBucket","shard"],
14 ["timeBucket","shard","executionStatus"]
15 ],
16 counters: [
17 [groupBy: ["scheduledTime","shard","executionStatus"]]
18 ]
19 ]
20 }
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Example Query
21
1 AppScheduledEventHistory.get(params.id.toUUID())
2
3 AppScheduledEventHistory.findAllByAppId(appId)
4
5 AppScheduledEventHistory.findAllByTimeBucketAndShard(timeBucket,
shard)
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
More Advanced Query
22
1 AppScheduledEventHistory
2 .findAllByTimeBucketAndShardAndExecutionStatus(
3 params.timeBucket,
4 params.id,
5 params.status,
6 [consistencyLevel: scheduledEventService.consistencyLevel])
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Query with Counters
23
1 AppScheduledEventHistory
2 .getCountsGroupByScheduledTimeAndShardAndExecutionStatus(
3 start: start,
4 finish: finish,
5 reversed: true,
6 consistencyLevel: scheduledEventService.consistencyLevel)
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Expando Map
24
1 class DeviceData {
2 String deviceId
3 Map data
4
5 static cassandraMapping = [
6 unindexedPrimaryKey: "deviceId",
7 expandoMap : "data"
8 ]
9 }
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Using Expando Map
25
1 def d = new DeviceData()
2
3 d.first = 'Bob'
4 d.last = 'Dole'
5
6 d.save()
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Cassandra GORM
26
A true GORM implementation for Cassandra based on Spring Data’s Cassandra work
which under the covers uses the Java Native Driver.
It is relatively new, so there are rough edges.
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Advantages
• Participates in GORM
• Can auto create the schema
• Same GORM syntax
27
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Disadvantages
• Allows use of Cassandra secondary indices
• All or nothing mapping*
28
*Implementation flaw, not an issue with GORM
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Example Object
29
1 class Subscription {
2 UUID id
3 URI product
4 Date startDate
5 State state
6 Date endDate
7
8 static mapping = {
9 table "subscription"
10 id generator: 'assigned'
11 version false
12 }
13
14 static constraints = {
15 startDate nullable: false
16 endDate nullable: true
17 state nullable: false
18 product nullable: false
19
20 }
21 }
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Example Query
30
1 def subs = Subscription.get(uuid)
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
With a Complex Primary Key
31
1 class Person {
2 String lastName
3 String firstName
4 Integer age = 0
5 String location
6
7 static mapping = {
8 id name:"lastName", primaryKey:[ordinal:0, type:"partitioned"], generator:"assigned"
9 firstName index:true, primaryKey:[ordinal:1, type: "clustered"]
10 age primaryKey:[ordinal:2, type: "clustered"]
11 version false
12 }
13 }
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Query Example
32
1 //Will work
2 def people = Person.findAllbyLastNameAndFirstName('Beck','Jeff')
3
4 //Will Fail
5 def people = Person.findAllbyFirstName('Jeff')
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Astyanax
33
This is a simple Grails plugin wrapping the Netflix Astyanax library.
A client for working with Cassandra.
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Advantages
• More direct access to Cassandra
• Works with legacy Thrift tables
• Provides features of modern Cassandra clients
• Client Side Load Balancing
• Token Aware
• Node Discovery
34
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Drawbacks
• A slightly outdated view of Cassandra.
• Still supported but not seeing tons of new features.
• Lots of configuration needed to get a sensible starting point.
35
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Example Interaction
36
1 final SETTINGS_CF = new ColumnFamily("EventSettings",
StringSerializer.get(), StringSerializer.get())
2
3 def m = astyanaxService.keyspace().prepareMutationBatch()
4 m.setConsistencyLevel(consistencyLevel)
5 m.withRow(SETTINGS_CF, "shards").putColumn(shard,
DateUtils.timeStamp(date))
6 m.execute()
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Java Native Driver
37
The new Driver put out by DataStax for Cassandra.
It doesn't have a plugin or anything yet so you must work with it directly.
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Advantages
• Supports Asynchronous Calls
• Default configuration is a sensible start
• Under active development
• Performance benefit for CQL prepared statements in C* 2.1+
• Low level
38
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Drawbacks
• Low level
• Have to wire up and manage all your own connections
39
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 40
1 class CQLSessionService implements InitializingBean {
2 //...
3
4 @Override
5 void afterPropertiesSet() throws Exception {
6 keyspace = grailsApplication.config.defaultKeyspace
7 def clusterBuilder = new Cluster.Builder()
8 .withRetryPolicy(DowngradingConsistencyRetryPolicy.INSTANCE)
9 .withLoadBalancingPolicy(new TokenAwarePolicy(new
DCAwareRoundRobinPolicy()))
10 .withReconnectionPolicy(new ConstantReconnectionPolicy(100L))
11 .withSocketOptions(new SocketOptions().setKeepAlive(true))
12
13 def contacts = ["192.168.0.1","192.168.0.3"]
14 contacts.each { String contact ->
15 clusterBuilder.addContactPoint(contact)
16 }
17
18 cluster = clusterBuilder.build()
19 cluster.getConfiguration()
20 session = cluster.connect()
21 }
22 }
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 41
1 class LoginAttemptService {
2 def CQLSessionService
3
4 static transactional = false
5
6 private final String tableName = "LoginAttempts"
7 private PreparedStatement login_attempt_insert
8
9 @PostConstruct
10 private void prepareStatements() {
11 def session = CQLSessionService.session
12 def keyspace = CQLSessionService.keyspace
13
14 login_attempt_insert = session.prepare(“""
INSERT INTO ${keyspace}.${tableName}
15 (userName, successful, ipAddress, userAgent, method, dateCreated)
VALUES ( ?, ?, ?, ?, ?, ?);""")
16 }
17 }
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Which to Use
42
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Client Config Options
• Seeds
• Datacenter Aware
• Token Aware
• Retries
• Speculative Execution
• Address Translater
43
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Dev Tools
• CCM - Local cassandra cluster
• DevCenter - Visual query tool
• CQL Data Modeler - Helps model CQL3 tables.
• Pillar - Migrations
44
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Server Tools
• OpsCenter - Visual display of clusters and nice dashboards
• Log aggregation - Cassandra generates good logs you need to monitor for
increased ERROR and WARN rates
• Cassandra Reaper - Repair tool
45
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Data Modeling Example Problem
Store every login and login attempt to the system. We want to find all attempts per
user for either successful or unsuccessful sorted by the date it happened.
46
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Data Modeling Example Solution
47
1 CREATE TABLE login_attempts (
2 user_name text,
3 successful boolean,
4 ip_address text,
5 user_agent text,
6 method text,
7 date_created timestamp,
8
9 PRIMARY KEY(user_name, successful, date_created)
10 );
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
CQL3 Primary Key
• Defined as PRIMARY KEY (last_name, first_name)
• Can query parts going left to right but no skipping.
48
One is just short hand for two. This is important because the first parameter is the partition key, the
rest is the cluster key.
1 PRIMARY KEY (last_name, first_name)
2 PRIMARY KEY ((last_name), first_name)
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
CQL3 Primary Key
49
The first part of the primary
key is the partition key, you
will always need to provide
this part.
1 PRIMARY KEY (last_name, first_name, age)
2 //Not Equal
3 PRIMARY KEY ((last_name, first_name), age)
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Implement TokenStore interface from SpringSecurity OAuth.
50
Token Store Example
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
It takes four tables to take the place of what is done in two in the JDBC
version of the token store.
It is an easy process to support this as we have a known interface that
defines all our queries and we can look at the SQL statements used to
verify the access patterns.
51
Token Store Example
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Token Store Example
52
1 CREATE TABLE oauth_access_token_by_client_with_token (
2 client_id text,
3 client_mod int,
4 user_id text,
5 oauth_token text,
6 access_token text,
7 authentication text,
8 last_modified timestamp,
9 PRIMARY KEY ((client_id, client_mod), user_id, oauth_token)
10 );
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Token Store Example
53
1 session.prepare("""
2 BEGIN BATCH
3 INSERT INTO ${keyspace}.oauth_access_token
4 (oauth_token, access_token, authentication, last_modified)
5 VALUES (?, ?, ?, ?);
6 INSERT INTO ${keyspace}.oauth_access_token_by_refresh
7 (refresh_token, access_token, authentication, last_modified)
8 VALUES (?, ?, ?, ?);
9 INSERT INTO ${keyspace}.oauth_access_token_by_authentication
10 (authentication_id, access_token, authentication, last_modified)
11 VALUES (?, ?, ?, ?);
12 INSERT INTO ${keyspace}.oauth_access_token_by_client
13 (client_id, client_mod, user_id, access_token, authentication,
last_modified)
14 VALUES (?, ?, ?, ?, ?, ?);
15 APPLY BATCH;
16 """).setConsistencyLevel(ConsistencyLevel.ONE)
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Bucketing
54
1 Hashing.consistentHash(
Hashing.murmur3_32().hashString(principal, Charsets.UTF_8), CLIENT_BUCKETS)
For some items we want to query on such as Client (ex: iOS, Android) there are too
many entries to to depend on a single wide row. So we create buckets, when
searching for things by Client we will run a query for each bucket.
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Search by client
55
1 Collection<OAuth2AccessToken> findTokensByClientId(String clientId) {
2 def tokens = []
3 for (int mod = 0; mod < CLIENT_BUCKETS; mod++) {
4 ResultSet rs =
session.execute(getAccessTokenByClient.bind(clientId, mod))
5 for (Row row : rs.all()) {
6 def tokenJson = row.getString("access_token")
7 tokens << objectMapper.readValue(tokenJson, OAuth2AccessToken.class)
8 }
9 }
10 return tokens
11 }
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Cleaning Up Mistakes
• Write two ways until you can drop old data, pairs well with TTLed data.
• Expect new queries to change how you insert the data.
• Use an external system to migrate all the data
• Spark
• The application itself
56
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a

Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 57
Starting with Cassandra make sure you know your queries!
Richer Data History with Event Sourcing by Steve Pember
Learn More. Stay Connected.
@springcentral Spring.io/video

More Related Content

What's hot

Case Study: Migrating Hyperic from EJB to Spring from JBoss to Apache Tomcat
Case Study: Migrating Hyperic from EJB to Spring from JBoss to Apache TomcatCase Study: Migrating Hyperic from EJB to Spring from JBoss to Apache Tomcat
Case Study: Migrating Hyperic from EJB to Spring from JBoss to Apache TomcatVMware Hyperic
 
The Edge to AI Deep Dive Barcelona Meetup March 2019
The Edge to AI Deep Dive Barcelona Meetup March 2019The Edge to AI Deep Dive Barcelona Meetup March 2019
The Edge to AI Deep Dive Barcelona Meetup March 2019Timothy Spann
 
Sherlock Homepage - A detective story about running large web services (VISUG...
Sherlock Homepage - A detective story about running large web services (VISUG...Sherlock Homepage - A detective story about running large web services (VISUG...
Sherlock Homepage - A detective story about running large web services (VISUG...Maarten Balliauw
 
Comparing JVM Web Frameworks - Devoxx 2010
Comparing JVM Web Frameworks - Devoxx 2010Comparing JVM Web Frameworks - Devoxx 2010
Comparing JVM Web Frameworks - Devoxx 2010Matt Raible
 
Apache Roller, Acegi Security and Single Sign-on
Apache Roller, Acegi Security and Single Sign-onApache Roller, Acegi Security and Single Sign-on
Apache Roller, Acegi Security and Single Sign-onMatt Raible
 
Java Web Application Security - UberConf 2011
Java Web Application Security - UberConf 2011Java Web Application Security - UberConf 2011
Java Web Application Security - UberConf 2011Matt Raible
 
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 202010 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020Matt Raible
 
Comparing JVM Web Frameworks - February 2014
Comparing JVM Web Frameworks - February 2014Comparing JVM Web Frameworks - February 2014
Comparing JVM Web Frameworks - February 2014Matt Raible
 
Top 8 react static site generators for 2020
Top 8 react static site generators for 2020Top 8 react static site generators for 2020
Top 8 react static site generators for 2020Katy Slemon
 
Simplifying Apache Geode with Spring Data
Simplifying Apache Geode with Spring DataSimplifying Apache Geode with Spring Data
Simplifying Apache Geode with Spring DataVMware Tanzu
 

What's hot (11)

Case Study: Migrating Hyperic from EJB to Spring from JBoss to Apache Tomcat
Case Study: Migrating Hyperic from EJB to Spring from JBoss to Apache TomcatCase Study: Migrating Hyperic from EJB to Spring from JBoss to Apache Tomcat
Case Study: Migrating Hyperic from EJB to Spring from JBoss to Apache Tomcat
 
The Edge to AI Deep Dive Barcelona Meetup March 2019
The Edge to AI Deep Dive Barcelona Meetup March 2019The Edge to AI Deep Dive Barcelona Meetup March 2019
The Edge to AI Deep Dive Barcelona Meetup March 2019
 
Sherlock Homepage - A detective story about running large web services (VISUG...
Sherlock Homepage - A detective story about running large web services (VISUG...Sherlock Homepage - A detective story about running large web services (VISUG...
Sherlock Homepage - A detective story about running large web services (VISUG...
 
Comparing JVM Web Frameworks - Devoxx 2010
Comparing JVM Web Frameworks - Devoxx 2010Comparing JVM Web Frameworks - Devoxx 2010
Comparing JVM Web Frameworks - Devoxx 2010
 
Apache Roller, Acegi Security and Single Sign-on
Apache Roller, Acegi Security and Single Sign-onApache Roller, Acegi Security and Single Sign-on
Apache Roller, Acegi Security and Single Sign-on
 
Wayin devops-2013
Wayin devops-2013Wayin devops-2013
Wayin devops-2013
 
Java Web Application Security - UberConf 2011
Java Web Application Security - UberConf 2011Java Web Application Security - UberConf 2011
Java Web Application Security - UberConf 2011
 
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 202010 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020
 
Comparing JVM Web Frameworks - February 2014
Comparing JVM Web Frameworks - February 2014Comparing JVM Web Frameworks - February 2014
Comparing JVM Web Frameworks - February 2014
 
Top 8 react static site generators for 2020
Top 8 react static site generators for 2020Top 8 react static site generators for 2020
Top 8 react static site generators for 2020
 
Simplifying Apache Geode with Spring Data
Simplifying Apache Geode with Spring DataSimplifying Apache Geode with Spring Data
Simplifying Apache Geode with Spring Data
 

Viewers also liked

Viewers also liked (7)

Top 5 Movie Villains Of The Decade 2000
Top 5 Movie Villains Of The Decade 2000Top 5 Movie Villains Of The Decade 2000
Top 5 Movie Villains Of The Decade 2000
 
Buzzworthy Events for Central Alabama Housing Fund
Buzzworthy Events for Central Alabama Housing FundBuzzworthy Events for Central Alabama Housing Fund
Buzzworthy Events for Central Alabama Housing Fund
 
B C T
B C TB C T
B C T
 
Youtubescenario
YoutubescenarioYoutubescenario
Youtubescenario
 
Whats New Slides
Whats New SlidesWhats New Slides
Whats New Slides
 
Ipads in the classroom
Ipads in the classroomIpads in the classroom
Ipads in the classroom
 
Biotechnology in Alabama
Biotechnology in AlabamaBiotechnology in Alabama
Biotechnology in Alabama
 

Similar to Cassandra and Grails: Options for Data Access

Enable SQL/JDBC Access to Apache Geode/GemFire Using Apache Calcite
Enable SQL/JDBC Access to Apache Geode/GemFire Using Apache CalciteEnable SQL/JDBC Access to Apache Geode/GemFire Using Apache Calcite
Enable SQL/JDBC Access to Apache Geode/GemFire Using Apache CalciteVMware Tanzu
 
Ratpack - SpringOne2GX 2015
Ratpack - SpringOne2GX 2015Ratpack - SpringOne2GX 2015
Ratpack - SpringOne2GX 2015Daniel Woods
 
High performance stream processing
High performance stream processingHigh performance stream processing
High performance stream processingGlenn Renfro
 
Building .NET Microservices
Building .NET MicroservicesBuilding .NET Microservices
Building .NET MicroservicesVMware Tanzu
 
P to V to C: The Value of Bringing “Everything” to Containers
P to V to C: The Value of Bringing “Everything” to ContainersP to V to C: The Value of Bringing “Everything” to Containers
P to V to C: The Value of Bringing “Everything” to ContainersVMware Tanzu
 
Running Java Applications on Cloud Foundry
Running Java Applications on Cloud FoundryRunning Java Applications on Cloud Foundry
Running Java Applications on Cloud FoundryVMware Tanzu
 
Cloud-Native Streaming and Event-Driven Microservices
Cloud-Native Streaming and Event-Driven MicroservicesCloud-Native Streaming and Event-Driven Microservices
Cloud-Native Streaming and Event-Driven MicroservicesVMware Tanzu
 
12 Factor, or Cloud Native Apps - What EXACTLY Does that Mean for Spring Deve...
12 Factor, or Cloud Native Apps - What EXACTLY Does that Mean for Spring Deve...12 Factor, or Cloud Native Apps - What EXACTLY Does that Mean for Spring Deve...
12 Factor, or Cloud Native Apps - What EXACTLY Does that Mean for Spring Deve...VMware Tanzu
 
SDLC for Pivotal Platform powered by Spring Initializr and Concourse
SDLC for Pivotal Platform powered by Spring Initializr and ConcourseSDLC for Pivotal Platform powered by Spring Initializr and Concourse
SDLC for Pivotal Platform powered by Spring Initializr and ConcourseVMware Tanzu
 
Deploying Spring Boot apps on Kubernetes
Deploying Spring Boot apps on KubernetesDeploying Spring Boot apps on Kubernetes
Deploying Spring Boot apps on KubernetesVMware Tanzu
 
Spring Cloud in a Nutshell
Spring Cloud in a NutshellSpring Cloud in a Nutshell
Spring Cloud in a NutshellTsuyoshi Miyake
 
The Beginner’s Guide To Spring Cloud
The Beginner’s Guide To Spring CloudThe Beginner’s Guide To Spring Cloud
The Beginner’s Guide To Spring CloudVMware Tanzu
 
Implementing a highly scalable stock prediction system with R, Geode, SpringX...
Implementing a highly scalable stock prediction system with R, Geode, SpringX...Implementing a highly scalable stock prediction system with R, Geode, SpringX...
Implementing a highly scalable stock prediction system with R, Geode, SpringX...William Markito Oliveira
 
Building Highly Scalable Spring Applications using In-Memory Data Grids
Building Highly Scalable Spring Applications using In-Memory Data GridsBuilding Highly Scalable Spring Applications using In-Memory Data Grids
Building Highly Scalable Spring Applications using In-Memory Data GridsJohn Blum
 
Lattice: A Cloud-Native Platform for Your Spring Applications
Lattice: A Cloud-Native Platform for Your Spring ApplicationsLattice: A Cloud-Native Platform for Your Spring Applications
Lattice: A Cloud-Native Platform for Your Spring ApplicationsMatt Stine
 
It’s a Multi-Cloud World, But What About The Data?
It’s a Multi-Cloud World, But What About The Data?It’s a Multi-Cloud World, But What About The Data?
It’s a Multi-Cloud World, But What About The Data?VMware Tanzu
 
Kafka Summit NYC 2017 - Cloud Native Data Streaming Microservices with Spring...
Kafka Summit NYC 2017 - Cloud Native Data Streaming Microservices with Spring...Kafka Summit NYC 2017 - Cloud Native Data Streaming Microservices with Spring...
Kafka Summit NYC 2017 - Cloud Native Data Streaming Microservices with Spring...confluent
 
Who Does What? Mapping Cloud Foundry Activities and Entitlements to IT Roles
Who Does What? Mapping Cloud Foundry Activities and Entitlements to IT RolesWho Does What? Mapping Cloud Foundry Activities and Entitlements to IT Roles
Who Does What? Mapping Cloud Foundry Activities and Entitlements to IT RolesVMware Tanzu
 
Innovating Faster with Continuous Application Security
Innovating Faster with Continuous Application Security Innovating Faster with Continuous Application Security
Innovating Faster with Continuous Application Security Jeff Williams
 
Machines Can Learn - a Practical Take on Machine Intelligence Using Spring Cl...
Machines Can Learn - a Practical Take on Machine Intelligence Using Spring Cl...Machines Can Learn - a Practical Take on Machine Intelligence Using Spring Cl...
Machines Can Learn - a Practical Take on Machine Intelligence Using Spring Cl...Christian Tzolov
 

Similar to Cassandra and Grails: Options for Data Access (20)

Enable SQL/JDBC Access to Apache Geode/GemFire Using Apache Calcite
Enable SQL/JDBC Access to Apache Geode/GemFire Using Apache CalciteEnable SQL/JDBC Access to Apache Geode/GemFire Using Apache Calcite
Enable SQL/JDBC Access to Apache Geode/GemFire Using Apache Calcite
 
Ratpack - SpringOne2GX 2015
Ratpack - SpringOne2GX 2015Ratpack - SpringOne2GX 2015
Ratpack - SpringOne2GX 2015
 
High performance stream processing
High performance stream processingHigh performance stream processing
High performance stream processing
 
Building .NET Microservices
Building .NET MicroservicesBuilding .NET Microservices
Building .NET Microservices
 
P to V to C: The Value of Bringing “Everything” to Containers
P to V to C: The Value of Bringing “Everything” to ContainersP to V to C: The Value of Bringing “Everything” to Containers
P to V to C: The Value of Bringing “Everything” to Containers
 
Running Java Applications on Cloud Foundry
Running Java Applications on Cloud FoundryRunning Java Applications on Cloud Foundry
Running Java Applications on Cloud Foundry
 
Cloud-Native Streaming and Event-Driven Microservices
Cloud-Native Streaming and Event-Driven MicroservicesCloud-Native Streaming and Event-Driven Microservices
Cloud-Native Streaming and Event-Driven Microservices
 
12 Factor, or Cloud Native Apps - What EXACTLY Does that Mean for Spring Deve...
12 Factor, or Cloud Native Apps - What EXACTLY Does that Mean for Spring Deve...12 Factor, or Cloud Native Apps - What EXACTLY Does that Mean for Spring Deve...
12 Factor, or Cloud Native Apps - What EXACTLY Does that Mean for Spring Deve...
 
SDLC for Pivotal Platform powered by Spring Initializr and Concourse
SDLC for Pivotal Platform powered by Spring Initializr and ConcourseSDLC for Pivotal Platform powered by Spring Initializr and Concourse
SDLC for Pivotal Platform powered by Spring Initializr and Concourse
 
Deploying Spring Boot apps on Kubernetes
Deploying Spring Boot apps on KubernetesDeploying Spring Boot apps on Kubernetes
Deploying Spring Boot apps on Kubernetes
 
Spring Cloud in a Nutshell
Spring Cloud in a NutshellSpring Cloud in a Nutshell
Spring Cloud in a Nutshell
 
The Beginner’s Guide To Spring Cloud
The Beginner’s Guide To Spring CloudThe Beginner’s Guide To Spring Cloud
The Beginner’s Guide To Spring Cloud
 
Implementing a highly scalable stock prediction system with R, Geode, SpringX...
Implementing a highly scalable stock prediction system with R, Geode, SpringX...Implementing a highly scalable stock prediction system with R, Geode, SpringX...
Implementing a highly scalable stock prediction system with R, Geode, SpringX...
 
Building Highly Scalable Spring Applications using In-Memory Data Grids
Building Highly Scalable Spring Applications using In-Memory Data GridsBuilding Highly Scalable Spring Applications using In-Memory Data Grids
Building Highly Scalable Spring Applications using In-Memory Data Grids
 
Lattice: A Cloud-Native Platform for Your Spring Applications
Lattice: A Cloud-Native Platform for Your Spring ApplicationsLattice: A Cloud-Native Platform for Your Spring Applications
Lattice: A Cloud-Native Platform for Your Spring Applications
 
It’s a Multi-Cloud World, But What About The Data?
It’s a Multi-Cloud World, But What About The Data?It’s a Multi-Cloud World, But What About The Data?
It’s a Multi-Cloud World, But What About The Data?
 
Kafka Summit NYC 2017 - Cloud Native Data Streaming Microservices with Spring...
Kafka Summit NYC 2017 - Cloud Native Data Streaming Microservices with Spring...Kafka Summit NYC 2017 - Cloud Native Data Streaming Microservices with Spring...
Kafka Summit NYC 2017 - Cloud Native Data Streaming Microservices with Spring...
 
Who Does What? Mapping Cloud Foundry Activities and Entitlements to IT Roles
Who Does What? Mapping Cloud Foundry Activities and Entitlements to IT RolesWho Does What? Mapping Cloud Foundry Activities and Entitlements to IT Roles
Who Does What? Mapping Cloud Foundry Activities and Entitlements to IT Roles
 
Innovating Faster with Continuous Application Security
Innovating Faster with Continuous Application Security Innovating Faster with Continuous Application Security
Innovating Faster with Continuous Application Security
 
Machines Can Learn - a Practical Take on Machine Intelligence Using Spring Cl...
Machines Can Learn - a Practical Take on Machine Intelligence Using Spring Cl...Machines Can Learn - a Practical Take on Machine Intelligence Using Spring Cl...
Machines Can Learn - a Practical Take on Machine Intelligence Using Spring Cl...
 

Recently uploaded

Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 

Recently uploaded (20)

Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 

Cassandra and Grails: Options for Data Access

  • 1. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ SPRINGONE2GX WASHINGTON, DC Cassandra and Grails By Jeff Beck @beckje01
  • 2. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Agenda • whoami • What is Cassandra • Cassandra Terminology • Basic Data Modeling • What is Available for Grails • Cassandra ORM • Cassandra GORM • Astyanax • Java Native Driver • Which to Use • Basic Configuration 2 • Tools to Use • Advanced Data Modeling • TokenStore Example • Cleaning Up Mistakes
  • 3. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ $ whoami Jeff Beck • Engineer at SmartThings • Ratpack Team Member • Organize Minneapolis Cassandra Meetup 3 beckje01
  • 4. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ What is Cassandra • Fast Writing Data Store • Highly-Available, Distributed, Tuned Consistency • Master-less Replication • Redundancy Configurable • Cluster can span Data Centers 4
  • 5. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ When Cassandra • High write throughput needs • Cross datacenter replication required • Mature data access patterns 5
  • 6. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ When Not Cassandra • When you depend on transactions • Not sure how you will access the data • Lack the shared responsibility on the running of Cassandra 6
  • 7. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Cassandra Terminology • Thrift - The old way to interface with Cassandra. Now longer getting enhancements. • CQL / CQL v3 - The new native protocol that replaced Thrift and the new way to model data. • Replication Factor - How many nodes will have a copy of the data. • Consistency Level - When executing a query how many nodes need to agree. • Cluster vs Ring 7
  • 8. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Cassandra - Cluster vs Ring 8
  • 9. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Data Modeling It’s hard you are going to make mistakes. 9
  • 10. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Basic Data Modeling • You need to focus on Fan Out on Write, not the more traditional Fan Out on Read. • With Cassandra you really need to focus on the query not the thing being represented. 10
  • 11. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Basic Data Modeling Hints • Duplicate Data • Natural Key • Careful around adding an index • Get a Second Opinion 11
  • 12. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Data Modeling Example Problem Users have access to a location we want to get the details of a location for a particular user. 12
  • 13. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ SQL Solution 13
  • 14. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ CQL Solution 14 1 CREATE TABLE user_location ( 2 username text, 3 location_id text, 4 shard_id text, 5 name text, 6 background_image text, 7 PRIMARY KEY (username, location_id) 8 ); Notice the fanout on write, given 2 users with access to a location we will write 2 rows. We have to do that on the application side.
  • 15. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Model your interactions as all idempotent upserts if possible. This is the best case for Cassandra. 15 Idempotent Upserts
  • 16. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ What is Available for Grails • ORMs • Cassandra ORM • Cassandra GORM • Direct Cassandra Access • Astyanax Plugin • Java Native Driver 16
  • 17. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ The older of the two ORMs this was modeled after GORM but doesn't fully participate in GORM. Based on top of Astyanax and Thrift. Provides many nice features out of the box that makes getting something woking very quick. 17 Cassandra ORM
  • 18. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Advantages • Counters • Indices • Relations • Expando map 18
  • 19. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Drawbacks • Dealing with bootstrapping • Based on Thrift • Only easy data access is via the application 19
  • 20. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Example Object 20 1 class AppScheduledEventHistory { 2 UUID id 3 String shard 4 String appId 5 Date scheduledTime 6 Long executionTime 7 AppScheduledEventStatus executionStatus 8 9 static cassandraMapping = [ 10 unindexedPrimaryKey: "id", 11 explicitIndexes: [ ["appId"], 12 ["scheduledEventId"], 13 ["timeBucket","shard"], 14 ["timeBucket","shard","executionStatus"] 15 ], 16 counters: [ 17 [groupBy: ["scheduledTime","shard","executionStatus"]] 18 ] 19 ] 20 }
  • 21. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Example Query 21 1 AppScheduledEventHistory.get(params.id.toUUID()) 2 3 AppScheduledEventHistory.findAllByAppId(appId) 4 5 AppScheduledEventHistory.findAllByTimeBucketAndShard(timeBucket, shard)
  • 22. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ More Advanced Query 22 1 AppScheduledEventHistory 2 .findAllByTimeBucketAndShardAndExecutionStatus( 3 params.timeBucket, 4 params.id, 5 params.status, 6 [consistencyLevel: scheduledEventService.consistencyLevel])
  • 23. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Query with Counters 23 1 AppScheduledEventHistory 2 .getCountsGroupByScheduledTimeAndShardAndExecutionStatus( 3 start: start, 4 finish: finish, 5 reversed: true, 6 consistencyLevel: scheduledEventService.consistencyLevel)
  • 24. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Expando Map 24 1 class DeviceData { 2 String deviceId 3 Map data 4 5 static cassandraMapping = [ 6 unindexedPrimaryKey: "deviceId", 7 expandoMap : "data" 8 ] 9 }
  • 25. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Using Expando Map 25 1 def d = new DeviceData() 2 3 d.first = 'Bob' 4 d.last = 'Dole' 5 6 d.save()
  • 26. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Cassandra GORM 26 A true GORM implementation for Cassandra based on Spring Data’s Cassandra work which under the covers uses the Java Native Driver. It is relatively new, so there are rough edges.
  • 27. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Advantages • Participates in GORM • Can auto create the schema • Same GORM syntax 27
  • 28. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Disadvantages • Allows use of Cassandra secondary indices • All or nothing mapping* 28 *Implementation flaw, not an issue with GORM
  • 29. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Example Object 29 1 class Subscription { 2 UUID id 3 URI product 4 Date startDate 5 State state 6 Date endDate 7 8 static mapping = { 9 table "subscription" 10 id generator: 'assigned' 11 version false 12 } 13 14 static constraints = { 15 startDate nullable: false 16 endDate nullable: true 17 state nullable: false 18 product nullable: false 19 20 } 21 }
  • 30. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Example Query 30 1 def subs = Subscription.get(uuid)
  • 31. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ With a Complex Primary Key 31 1 class Person { 2 String lastName 3 String firstName 4 Integer age = 0 5 String location 6 7 static mapping = { 8 id name:"lastName", primaryKey:[ordinal:0, type:"partitioned"], generator:"assigned" 9 firstName index:true, primaryKey:[ordinal:1, type: "clustered"] 10 age primaryKey:[ordinal:2, type: "clustered"] 11 version false 12 } 13 }
  • 32. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Query Example 32 1 //Will work 2 def people = Person.findAllbyLastNameAndFirstName('Beck','Jeff') 3 4 //Will Fail 5 def people = Person.findAllbyFirstName('Jeff')
  • 33. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Astyanax 33 This is a simple Grails plugin wrapping the Netflix Astyanax library. A client for working with Cassandra.
  • 34. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Advantages • More direct access to Cassandra • Works with legacy Thrift tables • Provides features of modern Cassandra clients • Client Side Load Balancing • Token Aware • Node Discovery 34
  • 35. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Drawbacks • A slightly outdated view of Cassandra. • Still supported but not seeing tons of new features. • Lots of configuration needed to get a sensible starting point. 35
  • 36. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Example Interaction 36 1 final SETTINGS_CF = new ColumnFamily("EventSettings", StringSerializer.get(), StringSerializer.get()) 2 3 def m = astyanaxService.keyspace().prepareMutationBatch() 4 m.setConsistencyLevel(consistencyLevel) 5 m.withRow(SETTINGS_CF, "shards").putColumn(shard, DateUtils.timeStamp(date)) 6 m.execute()
  • 37. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Java Native Driver 37 The new Driver put out by DataStax for Cassandra. It doesn't have a plugin or anything yet so you must work with it directly.
  • 38. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Advantages • Supports Asynchronous Calls • Default configuration is a sensible start • Under active development • Performance benefit for CQL prepared statements in C* 2.1+ • Low level 38
  • 39. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Drawbacks • Low level • Have to wire up and manage all your own connections 39
  • 40. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 40 1 class CQLSessionService implements InitializingBean { 2 //... 3 4 @Override 5 void afterPropertiesSet() throws Exception { 6 keyspace = grailsApplication.config.defaultKeyspace 7 def clusterBuilder = new Cluster.Builder() 8 .withRetryPolicy(DowngradingConsistencyRetryPolicy.INSTANCE) 9 .withLoadBalancingPolicy(new TokenAwarePolicy(new DCAwareRoundRobinPolicy())) 10 .withReconnectionPolicy(new ConstantReconnectionPolicy(100L)) 11 .withSocketOptions(new SocketOptions().setKeepAlive(true)) 12 13 def contacts = ["192.168.0.1","192.168.0.3"] 14 contacts.each { String contact -> 15 clusterBuilder.addContactPoint(contact) 16 } 17 18 cluster = clusterBuilder.build() 19 cluster.getConfiguration() 20 session = cluster.connect() 21 } 22 }
  • 41. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 41 1 class LoginAttemptService { 2 def CQLSessionService 3 4 static transactional = false 5 6 private final String tableName = "LoginAttempts" 7 private PreparedStatement login_attempt_insert 8 9 @PostConstruct 10 private void prepareStatements() { 11 def session = CQLSessionService.session 12 def keyspace = CQLSessionService.keyspace 13 14 login_attempt_insert = session.prepare(“"" INSERT INTO ${keyspace}.${tableName} 15 (userName, successful, ipAddress, userAgent, method, dateCreated) VALUES ( ?, ?, ?, ?, ?, ?);""") 16 } 17 }
  • 42. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Which to Use 42
  • 43. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Client Config Options • Seeds • Datacenter Aware • Token Aware • Retries • Speculative Execution • Address Translater 43
  • 44. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Dev Tools • CCM - Local cassandra cluster • DevCenter - Visual query tool • CQL Data Modeler - Helps model CQL3 tables. • Pillar - Migrations 44
  • 45. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Server Tools • OpsCenter - Visual display of clusters and nice dashboards • Log aggregation - Cassandra generates good logs you need to monitor for increased ERROR and WARN rates • Cassandra Reaper - Repair tool 45
  • 46. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Data Modeling Example Problem Store every login and login attempt to the system. We want to find all attempts per user for either successful or unsuccessful sorted by the date it happened. 46
  • 47. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Data Modeling Example Solution 47 1 CREATE TABLE login_attempts ( 2 user_name text, 3 successful boolean, 4 ip_address text, 5 user_agent text, 6 method text, 7 date_created timestamp, 8 9 PRIMARY KEY(user_name, successful, date_created) 10 );
  • 48. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ CQL3 Primary Key • Defined as PRIMARY KEY (last_name, first_name) • Can query parts going left to right but no skipping. 48 One is just short hand for two. This is important because the first parameter is the partition key, the rest is the cluster key. 1 PRIMARY KEY (last_name, first_name) 2 PRIMARY KEY ((last_name), first_name)
  • 49. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ CQL3 Primary Key 49 The first part of the primary key is the partition key, you will always need to provide this part. 1 PRIMARY KEY (last_name, first_name, age) 2 //Not Equal 3 PRIMARY KEY ((last_name, first_name), age)
  • 50. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Implement TokenStore interface from SpringSecurity OAuth. 50 Token Store Example
  • 51. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ It takes four tables to take the place of what is done in two in the JDBC version of the token store. It is an easy process to support this as we have a known interface that defines all our queries and we can look at the SQL statements used to verify the access patterns. 51 Token Store Example
  • 52. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Token Store Example 52 1 CREATE TABLE oauth_access_token_by_client_with_token ( 2 client_id text, 3 client_mod int, 4 user_id text, 5 oauth_token text, 6 access_token text, 7 authentication text, 8 last_modified timestamp, 9 PRIMARY KEY ((client_id, client_mod), user_id, oauth_token) 10 );
  • 53. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Token Store Example 53 1 session.prepare(""" 2 BEGIN BATCH 3 INSERT INTO ${keyspace}.oauth_access_token 4 (oauth_token, access_token, authentication, last_modified) 5 VALUES (?, ?, ?, ?); 6 INSERT INTO ${keyspace}.oauth_access_token_by_refresh 7 (refresh_token, access_token, authentication, last_modified) 8 VALUES (?, ?, ?, ?); 9 INSERT INTO ${keyspace}.oauth_access_token_by_authentication 10 (authentication_id, access_token, authentication, last_modified) 11 VALUES (?, ?, ?, ?); 12 INSERT INTO ${keyspace}.oauth_access_token_by_client 13 (client_id, client_mod, user_id, access_token, authentication, last_modified) 14 VALUES (?, ?, ?, ?, ?, ?); 15 APPLY BATCH; 16 """).setConsistencyLevel(ConsistencyLevel.ONE)
  • 54. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Bucketing 54 1 Hashing.consistentHash( Hashing.murmur3_32().hashString(principal, Charsets.UTF_8), CLIENT_BUCKETS) For some items we want to query on such as Client (ex: iOS, Android) there are too many entries to to depend on a single wide row. So we create buckets, when searching for things by Client we will run a query for each bucket.
  • 55. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Search by client 55 1 Collection<OAuth2AccessToken> findTokensByClientId(String clientId) { 2 def tokens = [] 3 for (int mod = 0; mod < CLIENT_BUCKETS; mod++) { 4 ResultSet rs = session.execute(getAccessTokenByClient.bind(clientId, mod)) 5 for (Row row : rs.all()) { 6 def tokenJson = row.getString("access_token") 7 tokens << objectMapper.readValue(tokenJson, OAuth2AccessToken.class) 8 } 9 } 10 return tokens 11 }
  • 56. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Cleaning Up Mistakes • Write two ways until you can drop old data, pairs well with TTLed data. • Expect new queries to change how you insert the data. • Use an external system to migrate all the data • Spark • The application itself 56
  • 57. Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
 Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 57 Starting with Cassandra make sure you know your queries! Richer Data History with Event Sourcing by Steve Pember Learn More. Stay Connected. @springcentral Spring.io/video