MongoDB vs. Apache Cassandra - Who Wins? | Systems Design Interview 0 to 1 with Ex-Google SWE

Sdílet
Vložit
  • čas přidán 26. 07. 2024
  • Cassandra is probably the closest thing I have to a girlfriend at this point (well maybe the second closest)
  • Věda a technologie

Komentáře • 25

  • @bokistotel
    @bokistotel Před 12 minutami

    Can you please explain at 3:06, how are Gossip protocol and Consistent Hashing connected? I understand that in gossip protocol basically we designate the start note and we propagate state updates to the rest of the nodes, but how does consistent hashing come into play?

  • @geekwithabs
    @geekwithabs Před 25 dny +1

    We thank you for having no life and making these videos 🙂. Loved this one too.

  • @niranjhankantharaj6161
    @niranjhankantharaj6161 Před 11 měsíci +4

    Cassandra's data integrity can be made better by configuring quorums.
    However, due to hinted handoff-> it still cannot provide any transactional/strong consistency guarantees

  • @Summer-qs7rq
    @Summer-qs7rq Před 6 měsíci +2

    @7:36 you mentioned btree databases write it to disk first. However with WAL in combination of btress, do DBs still writes go to disk ? I was under impression that with WAL they first write to WAL and then asynchronously they flush from memory to btress on disk. Please correct me if i am wrong.

    • @jordanhasnolife5163
      @jordanhasnolife5163  Před 6 měsíci +1

      I imagine this one is implementation specific but I do think that some B-tree pages get cached in memory so in this case it's certainly possible!

  • @sergiuchiuchiu6692
    @sergiuchiuchiu6692 Před měsícem +2

    @2:20 Your information is wrong there. I think you wanted to say that there are Partition keys (at least one) and Cluster keys (0 or more). Together they form the Primary key. Please review the video as it is misinforming thousands of people.

    • @jordanhasnolife5163
      @jordanhasnolife5163  Před měsícem

      Oops, typo on my part. If this were a bigger deal I'd revise the video, but I don't think anyone is losing their job due to using the wrong terminology on cassandra key names.

  • @AnilYadav-xg5iw
    @AnilYadav-xg5iw Před 3 měsíci +1

    Hey Jordan, let's say we have 5 partitions of Cassandra each storing some data. Is there a way to find out the oldest entry from those partitions , considering there are multiple keys for partition(like senderid, receiver I'd)

    • @jordanhasnolife5163
      @jordanhasnolife5163  Před 3 měsíci

      Unless you want to use something like a version vector, your easiest bet is probably just a timestamp lol

  • @JLJConglomeration
    @JLJConglomeration Před 22 dny +1

    Is there any downside of MongoDB's ACID guarantees on de-normalized data, i.e. are writes slower than MySQL? It seems almost too good to be true, esp. say if a write has many duplicated locations it needs to transactionally update
    Also I knowCassandra's commonly used for chat applications as you mentioned, but I'm having trouble understanding why it's strictly preferential to say a document store. Say you had cluster key = chatID, sortKey = timeStamp, and one more column chatMessage = message contents. Yes the chatMessages have good locality, but many of COS other benefits (encoding compression, dictionary compression) aren't really relevant on content as variable as chat messages

    • @jordanhasnolife5163
      @jordanhasnolife5163  Před 21 dnem +1

      I think you just have a pretty large degree of writes with chat messages due to all of the fan-out, so LSM trees and leaderless replication may be preferred.
      Can't see off the top of my head how mongo writes compare to SQL ones, but I don't think the metrics that you'd find would account for data being especially denormalized - that would just mean you have to do *more* writes

  • @rakeshvarma8091
    @rakeshvarma8091 Před 3 měsíci +1

    Nice video.
    I have a question. I read somewhere that "While transactions in MongoDB can span multiple documents within a shard, they cannot span multiple shards within a sharded cluster.". This limits us in comparing this to traditional SQL isn't it ?

    • @jordanhasnolife5163
      @jordanhasnolife5163  Před 3 měsíci +1

      Interesting - if that's the case then I'd agree, I suppose you could always build two phase commit on top of it yourself though

  • @art4eigen93
    @art4eigen93 Před rokem +1

    Cassandra only used for chat application? or is there any other benefits? Because if read throughput is poor, then historical chat data retrieval would take a hit on overall latency isn't it ?

    • @jordanhasnolife5163
      @jordanhasnolife5163  Před rokem +1

      Read throughput is still good if you only read from one partition and take advantage of the sort key

  • @kushalsheth0212
    @kushalsheth0212 Před 4 měsíci +1

    If Mongodb is providing facilities as MySQL, then why everyone is not using it?

    • @jordanhasnolife5163
      @jordanhasnolife5163  Před 4 měsíci

      Because everyone is used to the relational data model and there's not really any reason to switch.

  • @raymondyang2018
    @raymondyang2018 Před rokem +3

    Unrelated to the video, but I'm surprised that you're still able to consistently make content for youtube. Figured you would actually have no life with the new job.

    • @jordanhasnolife5163
      @jordanhasnolife5163  Před rokem +3

      Ah I basically do lol, to be honest if I was lifting less I'd have a decent amount of free time

  • @AchintoBanerjee
    @AchintoBanerjee Před 11 měsíci +2

    Amazing summary.
    1. Can you do a similar video on dynamo db and compare it to Cassandra or other No sql db .
    Separately what’s the notepad software you are using .

    • @jordanhasnolife5163
      @jordanhasnolife5163  Před 11 měsíci

      Microsoft one note - to be honest DynamoDB is closed source so I don't know the exact design lol

  • @vankram1552
    @vankram1552 Před rokem +2

    Web scale

  • @paulfunigga
    @paulfunigga Před 2 měsíci +1

    Cluster key and sort key are the same thing. You meant to say partition key and clustering key.