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
Upcoming SlideShare
Loading in …5
×
1
Like this presentation? Why not share!
-
Be the first to like this
No Downloads
No notes for slide
- 1. Cassandra & Redis Diego Pacheco
- 2. Cassandra
- 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. Cassandra ~ Netflix 2013
- 5. Cassandra ~ Apple 2016
- 6. Cassandra ~ Spotify 2019
- 7. Cassandra ~ Data Model
- 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. Netflix Benchmark: 1M writes/sec
- 10. Cassandra Cluster ❏ Master less ❏ Anti-entropy HH ❏ Consistent Hashing ❏ Murmur3 ❏ Virtual Nodes ❏ Dynamic Scale out
- 11. Cassandra Data Replication
- 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. Cassandra Tombstones
- 14. Cassandra: Write Path
- 15. Cassandra: Read Path
- 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. Cassandra: Compaction ❏ Merge SSTables ❏ Can be trigger by node_tool ❏ Impact Cassandra Performance ❏ Different Strategies for different workloads
- 18. Cassandra: Compaction
- 19. Cassandra: Compaction Strategies
- 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. Cassandra: Read Repair ❏ Easy and cheap (when reading from multiples replicas) ❏ Hot Data will be repaired a lot
- 22. Cassandra: When to not Repair ❏ Short TTLs ❏ High Consistent read and writes ❏ High Read repair chance
- 23. Cassandra: Repair Pain points - most on scale ❏ Stream timeouts ❏ Tracking / Resume Repairs ❏ CPU Usage ❏ Disk I/O ❏ Latencies / SLA ❏ Wide Partitions
- 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. Running Cassandra: $ bin/cassandra
- 26. Running Cassandra: $ bin/cqlsh
- 27. Running Cassandra: Java Code
- 28. Running Cassandra: Java Code
- 29. Running Cassandra: Java Code
- 30. Running Cassandra: Java Code
- 31. Running Cassandra: Java Code
- 32. Running Cassandra: Java Code Async
- 33. Running Cassandra: Java Code Async
- 34. Running Cassandra: Java Code Async
- 35. Running Cassandra: Java Code Mapper
- 36. Running Cassandra: Java Code Mapper
- 37. Running Cassandra: Java Code Mapper
- 38. Want to join the DevOps side of the Force?
- 39. Redis
- 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. V5
- 42. Redis - Data Structures
- 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. Redis >= 5.x
- 45. Redis: make ; src/redis-server https://redis.io/download
- 46. Redis: src/redis-cli https://redis.io/download
- 47. Redis: src/redis-cli https://redis.io/commands/
- 48. Redis & Java: Lettuce
- 49. Redis & Java: Spring Data + Lettuce
- 50. Redis & Java: Spring Data + Lettuce
- 51. Redis & Java: Spring Data + Lettuce
- 52. Redis & Java: Spring Data + Lettuce
- 53. Redis & Java: Spring Data + Lettuce
- 54. Redis & Java: Spring Data + Lettuce : Hash Mapping
- 55. Redis & Java: Spring Data + Lettuce : Hash Mapping
- 56. Redis & Java: Spring Data + Lettuce : Hash Mapping
- 57. Redis & Java: Spring Data + Lettuce : Hash Mapping
- 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. Cassandra & Redis Diego Pacheco
Public clipboards featuring this slide
No public clipboards found for this slide