Understanding Transactions In Redis (Getting Started)

Поделиться
HTML-код
  • Опубликовано: 28 дек 2024

Комментарии •

  • @shashamnk2525
    @shashamnk2525 11 месяцев назад

    Thanks a lot for the explanation, I really like your smile.

  • @MAVP5
    @MAVP5 Год назад +1

    Great content! Keep going!

  • @ChrisAthanas
    @ChrisAthanas Год назад

    Useful and fast, very helpful

  • @geiltonxavierbr
    @geiltonxavierbr Год назад

    Thanks for sharing!

  • @vbcodep
    @vbcodep Год назад +9

    Redis does not guarantee consistency. You didn't account for the case that the Redis instances crashes while the commands within the EXEC are running. Since there is no rollback, writes can not be undone and your data will be in an inconsistent state.

    • @galeop
      @galeop Год назад +6

      To be more precise, this is true not only because of instance crashes, but for any error that would arise during EXEC time. So if for instance your transaction includes an LPOP command on a non-list key, this command will generate an error at exec-time. The client will receive an error for that LPOP, and will thus consider the transaction as failed. But the execution of the other commands of the transaction will proceed despite that LPOP error; because there are no roll-backs, the state changes that occurred as part of the transaction will still be there. So it's not really atomic.

    • @nosh3019
      @nosh3019 10 месяцев назад

      nice to know! thanks for sharing!

    • @ggman8216
      @ggman8216 2 месяца назад

      @vbcodep what about redis-check-aof? It comes with redis by default and cleans the AOF file from any corrupted transactions to avoid these possible inconsistencies.

    • @johnisaac7498
      @johnisaac7498 2 месяца назад +1

      @@ggman8216 If the transaction does complete all commands during the EXEC then the change is not recorded in the AOF.

  • @gabrielloureiro3739
    @gabrielloureiro3739 Год назад

    Amazing!

  • @whoamicommand
    @whoamicommand 7 месяцев назад +1

    that forced smile 😆

    • @zz-ox7ud
      @zz-ox7ud 4 месяца назад +2

      Looks like a Canadian speaking from South Park.

    • @RaphaelDeLio
      @RaphaelDeLio  4 месяца назад

      @zz-ox7ud that was a funny one 😂

  • @galeop
    @galeop Год назад +1

    Is there an equivalent to Integrity Constraints, to say that a key (eg _account_ key) cannot be less than 0? I see that you're using WATCH as way to avoid such a problem, so I suppose that there's no such thing as Integrity Constraints in Redis?

    • @marcelamiontakayanagi9672
      @marcelamiontakayanagi9672 Год назад +2

      Great question! That is true. Redis does not have a built-in implementation for integrity constraints.

    • @galeop
      @galeop Год назад

      @@marcelamiontakayanagi9672 thanks!

  • @marcinkeczek4128
    @marcinkeczek4128 Год назад +4

    I think that transactions in redis does not work this way.

  • @user-qi5kb5th7y
    @user-qi5kb5th7y Год назад

    why are you trying to smile all the time?

    • @RaphaelDeLio
      @RaphaelDeLio  Год назад +1

      Because Im a happy person. Thanks for noticing!