Cassandra Data Access in Java
eBuddy use of Cassandra
XMS
● User Data Service● User Discovery Service● Persistent Session Store● Message History● Location-based DiscoveryCassandra ...
● Current size of data● 1,4 TiB total (replication of 3x); 467 GiB actual data● 12 million sessions (11 million users plus...
Data Access - Overview
Design Objectives● Data Source Agnostic● Testable● Thread Safe● Strong Typing● Supports “transactions”, i.e. units of work...
Data Access in Layers
“Operations” Layer
Writing● Use Generic Typing● Has Interface(for testability, etc.)● Handles Exceptions
Reading● Use Mappers
Serializers● Constructed with serializers that convert to types neededby data access layer
Reading
Data Access Layer
Data Access Object● Data Access Object (DAO) is singleton● Transforms from data model to domain model● Operations object c...
Next Steps
CQL3DataStax:"We believe that CQL3 is a simpler and overall better API for Cassandrathan the thrift API is. Therefore, new...
Structured Data● Object Mapping Frameworks● Mapped vs. Embedded Objects● Nested Properties ("path" access)
Object Mapping Frameworks● Simple mapper frameworks with (some) JPA support● Hector Object Mapper● Kundera● Firebrand (not...
Hierarchical Properties● Use DynamicComposites to model keys that have avariable number of componentsput(“accounts|msn|x.y...
Questions?XMSUnlimited messaging.Better. Free.Were Hiring!Download XMS now:
Upcoming SlideShare
Loading in...5
×

eBuddy | Cassandra Data Access in Java

1,919

Published on

from Netherlands Cassandra Users Meet Up 28 May 2013

Published in: Technology, Education
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,919
On Slideshare
0
From Embeds
0
Number of Embeds
12
Actions
Shares
0
Downloads
0
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

eBuddy | Cassandra Data Access in Java

  1. 1. Cassandra Data Access in Java
  2. 2. eBuddy use of Cassandra
  3. 3. XMS
  4. 4. ● User Data Service● User Discovery Service● Persistent Session Store● Message History● Location-based DiscoveryCassandra ineBuddy Messaging Platform
  5. 5. ● Current size of data● 1,4 TiB total (replication of 3x); 467 GiB actual data● 12 million sessions (11 million users plus groups)● Almost a billion rows in one column family(inverse social graph)Some Statistics
  6. 6. Data Access - Overview
  7. 7. Design Objectives● Data Source Agnostic● Testable● Thread Safe● Strong Typing● Supports “transactions”, i.e. units of work in batch● Efficient Mapping to Application Domain Model● Follows Familiar Patterns (e.g. Spring JDBC Template)
  8. 8. Data Access in Layers
  9. 9. “Operations” Layer
  10. 10. Writing● Use Generic Typing● Has Interface(for testability, etc.)● Handles Exceptions
  11. 11. Reading● Use Mappers
  12. 12. Serializers● Constructed with serializers that convert to types neededby data access layer
  13. 13. Reading
  14. 14. Data Access Layer
  15. 15. Data Access Object● Data Access Object (DAO) is singleton● Transforms from data model to domain model● Operations object configured with serializers to convertfrom data model to domain model● Defines the mappers for read operations
  16. 16. Next Steps
  17. 17. CQL3DataStax:"We believe that CQL3 is a simpler and overall better API for Cassandrathan the thrift API is. Therefore, new projects/applications are encouragedto use CQL3"At eBuddy, we are still using the Thrift API and the Java Hector library.We are currently looking at CQL3 and whether we want to use it goingforward and whether we will "upgrade" existing code.
  18. 18. Structured Data● Object Mapping Frameworks● Mapped vs. Embedded Objects● Nested Properties ("path" access)
  19. 19. Object Mapping Frameworks● Simple mapper frameworks with (some) JPA support● Hector Object Mapper● Kundera● Firebrand (not JPA)● has most features,e.g supports both embedded and mapped object graphshttps://github.com/impetus-opensource/Kunderahttp://github.com/hector-client/hectorhttp://firebrandocm.org
  20. 20. Hierarchical Properties● Use DynamicComposites to model keys that have avariable number of componentsput(“accounts|msn|x.y.z|sign_in”, “0”);put(“accounts|msn|x.y.z|key”, “value”);get(“accounts”) --> retrieved as a map:{"accounts":{ "msn":{ "x.y.z":{ "sign_in": "0","key": "value" } } } }● Use a slice query to retrieve properties using partial path:
  21. 21. Questions?XMSUnlimited messaging.Better. Free.Were Hiring!Download XMS now:

×