Illustration Image

Cassandra.Link

The best knowledge base on Apache Cassandra®

Helping platform leaders, architects, engineers, and operators build scalable real time data platforms.

3/19/2020

Reading time:4 min

Cassandra Redis

by Diego Pacheco

Cassandra RedisSlideShare Explore YouSuccessfully reported this slideshow.We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.Cassandra RedisUpcoming SlideShareLoading in …5×1 1 of 61 Like this presentation? Why not share!0 Comments0 LikesStatisticsNotesBe the first to like thisNo DownloadsNo notes for slide1. Cassandra & Redis Diego Pacheco2. Cassandra3. Cassandra ❏ FOSS ❏ NoSQL Database ❏ Low Latency ❏ High Throughput ❏ Battle tested by Netflix, Apple, Facebook. ❏ AP on CAP - Favors availability over consistency. ❏ Multi-region support. ❏ Great software but hard to operate.4. Cassandra ~ Netflix 20135. Cassandra ~ Apple 20166. Cassandra ~ Spotify 20197. Cassandra ~ Data Model8. How to have Success with Cassandra? ❏ Understand system / service / app requirements ❏ Identify your data access patterns ❏ Model around the access patterns ❏ Denormalization is your friend (by* query tables) ❏ Benchmark ❏ Tuneup ❏ Repeat9. Netflix Benchmark: 1M writes/sec10. Cassandra Cluster ❏ Master less ❏ Anti-entropy HH ❏ Consistent Hashing ❏ Murmur3 ❏ Virtual Nodes ❏ Dynamic Scale out11. Cassandra Data Replication12. Cassandra Tunable Consistency ❏ Tunable for Read | Writes ❏ Consistency VS Availability ❏ One, Two, Three, ❏ QUORUM(majority n/2+1), Local_Quorun ❏ Each_Quorun ❏ Local_one ❏ All, Any13. Cassandra Tombstones14. Cassandra: Write Path15. Cassandra: Read Path16. Cassandra: Reads & Index ❏ Partition Key Cache | Row Cache ❏ Off Heap ❏ Configurable ❏ Secondary Index ❏ Filters data on table by non-primary key ❏ Allow Filtering (it can be problematic)17. Cassandra: Compaction ❏ Merge SSTables ❏ Can be trigger by node_tool ❏ Impact Cassandra Performance ❏ Different Strategies for different workloads18. Cassandra: Compaction19. Cassandra: Compaction Strategies20. Cassandra: Repair ❏ Anti-entropy mechanism (expensive, slow) ❏ 100% needed in Multi-region clusters ❏ Other scenarios that you need repairs: ❏ Low consistent reads and writes ❏ Frequent nodes outage ❏ Low reads repair chance ❏ Flaky networks21. Cassandra: Read Repair ❏ Easy and cheap (when reading from multiples replicas) ❏ Hot Data will be repaired a lot22. Cassandra: When to not Repair ❏ Short TTLs ❏ High Consistent read and writes ❏ High Read repair chance23. Cassandra: Repair Pain points - most on scale ❏ Stream timeouts ❏ Tracking / Resume Repairs ❏ CPU Usage ❏ Disk I/O ❏ Latencies / SLA ❏ Wide Partitions24. Cassandra: Poor Usage - Anti-Patterns ❏ Batch usage: Select * from whole table / re-insert periodically ❏ Lack of denormalized tables to support queries (allow filtering) ❏ Queue ❏ Extreme large row sizes ❏ Abuse of Collections Data types(tombstones) ❏ Read Before Writing (or write and read immediately.)25. Running Cassandra: $ bin/cassandra26. Running Cassandra: $ bin/cqlsh27. Running Cassandra: Java Code28. Running Cassandra: Java Code29. Running Cassandra: Java Code30. Running Cassandra: Java Code31. Running Cassandra: Java Code32. Running Cassandra: Java Code Async33. Running Cassandra: Java Code Async34. Running Cassandra: Java Code Async35. Running Cassandra: Java Code Mapper36. Running Cassandra: Java Code Mapper37. Running Cassandra: Java Code Mapper38. Want to join the DevOps side of the Force?39. Redis40. Redis ❏ FOSS ❏ In Memory K/V Store written in C ❏ Create for: Caching, Session Store, Queue, Analytics ❏ Specific Commands per Data Structures: Strings, Hash, sets ❏ Keys TTL ❏ Bring your own Data Structure ❏ Fast, Low Latency, Battle tested everybody. :D ❏ Single Thread :(41. V542. Redis - Data Structures43. Redis >= 4.x ❏ Redis-Modules ❏ It's not Lua Scripting ❏ Built in C ❏ Low Latency | Embedded in Redis ❏ Use cases: Extends Redis / New Capabilities DSs44. Redis >= 5.x45. Redis: make ; src/redis-server https://redis.io/download46. Redis: src/redis-cli https://redis.io/download47. Redis: src/redis-cli https://redis.io/commands/48. Redis & Java: Lettuce49. Redis & Java: Spring Data + Lettuce50. Redis & Java: Spring Data + Lettuce51. Redis & Java: Spring Data + Lettuce52. Redis & Java: Spring Data + Lettuce53. Redis & Java: Spring Data + Lettuce54. Redis & Java: Spring Data + Lettuce : Hash Mapping55. Redis & Java: Spring Data + Lettuce : Hash Mapping56. Redis & Java: Spring Data + Lettuce : Hash Mapping57. Redis & Java: Spring Data + Lettuce : Hash Mapping58. Exercises Constraints You can code this exercises with Java, Scala or Clojure. You can use any framework you like. UI is not required. You need to run Cassandra 3.x and Redis 5.x (nativily, docker, does not matter). 1. Use cassandra and build Movie Catalog Service Where movies should have ID(UUID), name, category, length, linkToYouTubeTrailer. You should be able to query by category, name and ID. 2. Use Redis and Build a Twitter application where you should have tweet(message) and you should be able to follow people and people could follow you. 3. Build a profile Service using Cassandra, you should have a REST interface with the following data: ID(UUID), name, email, dateOfBirth, gender, twitterURL, faceURL. You need store the data in Cassandra and use Redis as a Cache. You need support the following operations: a. List all users by Id b. List all users by Email c. Add / Remove / Update users59. Cassandra & Redis Diego PachecoRecommendedBruce Heavin The Thinkable PresentationOnline Course - LinkedIn LearningEducational Technology for Student SuccessOnline Course - LinkedIn LearningCore Strategies for Teaching in Higher EdOnline Course - LinkedIn LearningMaking sense of streamingDiego PachecoSOA.2020Diego PachecoUnderstand the systemDiego PachecoRedisDiego PachecoDesign Approaches(Simple, KISS, RDD, DBC, SOLID)Diego PachecoA philosophy of software designDiego PachecoClean Code (why not do it)Diego Pacheco×Share Clipboard×LinkPublic clipboards featuring this slideNo public clipboards found for this slideSelect another clipboard×Looks like you’ve clipped this slide to already.Create a clipboardYou just clipped your first slide!Clipping is a handy way to collect important slides you want to go back to later. Now customize the name of a clipboard to store your clips.

Illustration Image
Cassandra Redis

Successfully reported this slideshow.

We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Cassandra Redis
Cassandra & Redis Diego Pacheco
Cassandra
Cassandra ❏ FOSS ❏ NoSQL Database ❏ Low Latency ❏ High Throughput ❏ Battle tested by Netflix, Apple, Facebook. ❏ AP on CAP ...
Cassandra ~ Netflix 2013
Cassandra ~ Apple 2016
Cassandra ~ Spotify 2019
Cassandra ~ Data Model
How to have Success with Cassandra? ❏ Understand system / service / app requirements ❏ Identify your data access patterns ...
Netflix Benchmark: 1M writes/sec
Cassandra Cluster ❏ Master less ❏ Anti-entropy HH ❏ Consistent Hashing ❏ Murmur3 ❏ Virtual Nodes ❏ Dynamic Scale out
Cassandra Data Replication
Cassandra Tunable Consistency ❏ Tunable for Read | Writes ❏ Consistency VS Availability ❏ One, Two, Three, ❏ QUORUM(majori...
Cassandra Tombstones
Cassandra: Write Path
Cassandra: Read Path
Cassandra: Reads & Index ❏ Partition Key Cache | Row Cache ❏ Off Heap ❏ Configurable ❏ Secondary Index ❏ Filters data on tab...
Cassandra: Compaction ❏ Merge SSTables ❏ Can be trigger by node_tool ❏ Impact Cassandra Performance ❏ Different Strategies ...
Cassandra: Compaction
Cassandra: Compaction Strategies
Cassandra: Repair ❏ Anti-entropy mechanism (expensive, slow) ❏ 100% needed in Multi-region clusters ❏ Other scenarios that...
Cassandra: Read Repair ❏ Easy and cheap (when reading from multiples replicas) ❏ Hot Data will be repaired a lot
Cassandra: When to not Repair ❏ Short TTLs ❏ High Consistent read and writes ❏ High Read repair chance
Cassandra: Repair Pain points - most on scale ❏ Stream timeouts ❏ Tracking / Resume Repairs ❏ CPU Usage ❏ Disk I/O ❏ Laten...
Cassandra: Poor Usage - Anti-Patterns ❏ Batch usage: Select * from whole table / re-insert periodically ❏ Lack of denormal...
Running Cassandra: $ bin/cassandra
Running Cassandra: $ bin/cqlsh
Running Cassandra: Java Code
Running Cassandra: Java Code
Running Cassandra: Java Code
Running Cassandra: Java Code
Running Cassandra: Java Code
Running Cassandra: Java Code Async
Running Cassandra: Java Code Async
Running Cassandra: Java Code Async
Running Cassandra: Java Code Mapper
Running Cassandra: Java Code Mapper
Running Cassandra: Java Code Mapper
Want to join the DevOps side of the Force?
Redis
Redis ❏ FOSS ❏ In Memory K/V Store written in C ❏ Create for: Caching, Session Store, Queue, Analytics ❏ Specific Commands ...
V5
Redis - Data Structures
Redis >= 4.x ❏ Redis-Modules ❏ It's not Lua Scripting ❏ Built in C ❏ Low Latency | Embedded in Redis ❏ Use cases: Extends ...
Redis >= 5.x
Redis: make ; src/redis-server https://redis.io/download
Redis: src/redis-cli https://redis.io/download
Redis: src/redis-cli https://redis.io/commands/
Redis & Java: Lettuce
Redis & Java: Spring Data + Lettuce
Redis & Java: Spring Data + Lettuce
Redis & Java: Spring Data + Lettuce
Redis & Java: Spring Data + Lettuce
Redis & Java: Spring Data + Lettuce
Redis & Java: Spring Data + Lettuce : Hash Mapping
Redis & Java: Spring Data + Lettuce : Hash Mapping
Redis & Java: Spring Data + Lettuce : Hash Mapping
Redis & Java: Spring Data + Lettuce : Hash Mapping
Exercises Constraints You can code this exercises with Java, Scala or Clojure. You can use any framework you like. UI is n...
Cassandra & Redis Diego Pacheco
Cassandra Redis
Cassandra Redis

Upcoming SlideShare

Loading in …5

×

image1

Like this presentation? Why not share!

  • Be the first to like this

No Downloads

No notes for slide

  1. 1. Cassandra & Redis Diego Pacheco
  2. 2. Cassandra
  3. 3. Cassandra ❏ FOSS ❏ NoSQL Database ❏ Low Latency ❏ High Throughput ❏ Battle tested by Netflix, Apple, Facebook. ❏ AP on CAP - Favors availability over consistency. ❏ Multi-region support. ❏ Great software but hard to operate.
  4. 4. Cassandra ~ Netflix 2013
  5. 5. Cassandra ~ Apple 2016
  6. 6. Cassandra ~ Spotify 2019
  7. 7. Cassandra ~ Data Model
  8. 8. How to have Success with Cassandra? ❏ Understand system / service / app requirements ❏ Identify your data access patterns ❏ Model around the access patterns ❏ Denormalization is your friend (by* query tables) ❏ Benchmark ❏ Tuneup ❏ Repeat
  9. 9. Netflix Benchmark: 1M writes/sec
  10. 10. Cassandra Cluster ❏ Master less ❏ Anti-entropy HH ❏ Consistent Hashing ❏ Murmur3 ❏ Virtual Nodes ❏ Dynamic Scale out
  11. 11. Cassandra Data Replication
  12. 12. Cassandra Tunable Consistency ❏ Tunable for Read | Writes ❏ Consistency VS Availability ❏ One, Two, Three, ❏ QUORUM(majority n/2+1), Local_Quorun ❏ Each_Quorun ❏ Local_one ❏ All, Any
  13. 13. Cassandra Tombstones
  14. 14. Cassandra: Write Path
  15. 15. Cassandra: Read Path
  16. 16. Cassandra: Reads & Index ❏ Partition Key Cache | Row Cache ❏ Off Heap ❏ Configurable ❏ Secondary Index ❏ Filters data on table by non-primary key ❏ Allow Filtering (it can be problematic)
  17. 17. Cassandra: Compaction ❏ Merge SSTables ❏ Can be trigger by node_tool ❏ Impact Cassandra Performance ❏ Different Strategies for different workloads
  18. 18. Cassandra: Compaction
  19. 19. Cassandra: Compaction Strategies
  20. 20. Cassandra: Repair ❏ Anti-entropy mechanism (expensive, slow) ❏ 100% needed in Multi-region clusters ❏ Other scenarios that you need repairs: ❏ Low consistent reads and writes ❏ Frequent nodes outage ❏ Low reads repair chance ❏ Flaky networks
  21. 21. Cassandra: Read Repair ❏ Easy and cheap (when reading from multiples replicas) ❏ Hot Data will be repaired a lot
  22. 22. Cassandra: When to not Repair ❏ Short TTLs ❏ High Consistent read and writes ❏ High Read repair chance
  23. 23. Cassandra: Repair Pain points - most on scale ❏ Stream timeouts ❏ Tracking / Resume Repairs ❏ CPU Usage ❏ Disk I/O ❏ Latencies / SLA ❏ Wide Partitions
  24. 24. Cassandra: Poor Usage - Anti-Patterns ❏ Batch usage: Select * from whole table / re-insert periodically ❏ Lack of denormalized tables to support queries (allow filtering) ❏ Queue ❏ Extreme large row sizes ❏ Abuse of Collections Data types(tombstones) ❏ Read Before Writing (or write and read immediately.)
  25. 25. Running Cassandra: $ bin/cassandra
  26. 26. Running Cassandra: $ bin/cqlsh
  27. 27. Running Cassandra: Java Code
  28. 28. Running Cassandra: Java Code
  29. 29. Running Cassandra: Java Code
  30. 30. Running Cassandra: Java Code
  31. 31. Running Cassandra: Java Code
  32. 32. Running Cassandra: Java Code Async
  33. 33. Running Cassandra: Java Code Async
  34. 34. Running Cassandra: Java Code Async
  35. 35. Running Cassandra: Java Code Mapper
  36. 36. Running Cassandra: Java Code Mapper
  37. 37. Running Cassandra: Java Code Mapper
  38. 38. Want to join the DevOps side of the Force?
  39. 39. Redis
  40. 40. Redis ❏ FOSS ❏ In Memory K/V Store written in C ❏ Create for: Caching, Session Store, Queue, Analytics ❏ Specific Commands per Data Structures: Strings, Hash, sets ❏ Keys TTL ❏ Bring your own Data Structure ❏ Fast, Low Latency, Battle tested everybody. :D ❏ Single Thread :(
  41. 41. V5
  42. 42. Redis - Data Structures
  43. 43. Redis >= 4.x ❏ Redis-Modules ❏ It's not Lua Scripting ❏ Built in C ❏ Low Latency | Embedded in Redis ❏ Use cases: Extends Redis / New Capabilities DSs
  44. 44. Redis >= 5.x
  45. 45. Redis: make ; src/redis-server https://redis.io/download
  46. 46. Redis: src/redis-cli https://redis.io/download
  47. 47. Redis: src/redis-cli https://redis.io/commands/
  48. 48. Redis & Java: Lettuce
  49. 49. Redis & Java: Spring Data + Lettuce
  50. 50. Redis & Java: Spring Data + Lettuce
  51. 51. Redis & Java: Spring Data + Lettuce
  52. 52. Redis & Java: Spring Data + Lettuce
  53. 53. Redis & Java: Spring Data + Lettuce
  54. 54. Redis & Java: Spring Data + Lettuce : Hash Mapping
  55. 55. Redis & Java: Spring Data + Lettuce : Hash Mapping
  56. 56. Redis & Java: Spring Data + Lettuce : Hash Mapping
  57. 57. Redis & Java: Spring Data + Lettuce : Hash Mapping
  58. 58. Exercises Constraints You can code this exercises with Java, Scala or Clojure. You can use any framework you like. UI is not required. You need to run Cassandra 3.x and Redis 5.x (nativily, docker, does not matter). 1. Use cassandra and build Movie Catalog Service Where movies should have ID(UUID), name, category, length, linkToYouTubeTrailer. You should be able to query by category, name and ID. 2. Use Redis and Build a Twitter application where you should have tweet(message) and you should be able to follow people and people could follow you. 3. Build a profile Service using Cassandra, you should have a REST interface with the following data: ID(UUID), name, email, dateOfBirth, gender, twitterURL, faceURL. You need store the data in Cassandra and use Redis as a Cache. You need support the following operations: a. List all users by Id b. List all users by Email c. Add / Remove / Update users
  59. 59. Cassandra & Redis Diego Pacheco

×

Related Articles

python
java
cassandra

Vald

John Doe

2/11/2024

cassandra
slides

Checkout Planet Cassandra

Claim Your Free Planet Cassandra Contributor T-shirt!

Make your contribution and score a FREE Planet Cassandra Contributor T-Shirt! 
We value our incredible Cassandra community, and we want to express our gratitude by sending an exclusive Planet Cassandra Contributor T-Shirt you can wear with pride.

Join Our Newsletter!

Sign up below to receive email updates and see what's going on with our company

Explore Related Topics

AllKafkaSparkScyllaSStableKubernetesApiGithubGraphQl

Explore Further

cassandra