Database Connections in Laravel - Beyond the Basics

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

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

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

    Hey @themsaid, will choosing a connection pooling package help in eliminating too many connection issue? recently I am facing this issue and not sure what to do?

  • @JohnnyBigodes
    @JohnnyBigodes 3 года назад +4

    These videos are great... Thank you Mohamed

  • @ulcuber
    @ulcuber 3 месяца назад

    What about transactions within Laravel Octane? How using single connection affects transactions? And what about MySQL nested transactions emulation with savepoints in that case? Will it lead to any problems?

  • @bobbyiliev_
    @bobbyiliev_ 3 года назад +2

    So many great tips in a single video 🤩
    I've used the MySQL replication setup in the past and I was blown away by how simple it was to setup, it is a great fit with the Managed DigitalOcean Databases so you don't have to worry about maintaining the replication yourself which could be very challenging.

    • @themsaid
      @themsaid  3 года назад +1

      Nice! Glad you like the video. I've submitted a PR that might make it even more reliable: github.com/laravel/framework/pull/37567

  • @MarioPalomera
    @MarioPalomera 3 года назад +2

    You guys are on fire! Putting PHP closer to the performance of Java/C# apps

  • @raypanjaitan
    @raypanjaitan 9 месяцев назад

    I am using multiple connections, is this PDO still working in that situation?
    Will they have multiple objects also?
    My concern is that the application should not have to authenticate every time it does a query if the PDO in multiple connections application

  • @shoaibsaqib8951
    @shoaibsaqib8951 2 года назад

    Respected Muhammad Said. Please tell me what theme and color scheme you'r using in phpstorm...

  • @vigneshgurusamy2046
    @vigneshgurusamy2046 2 года назад

    Some apps set whole application in read-only mode during the database maintenance or application rollback scenario due to some bug in new version. How to acheive this in Laravel with a single configuration update?

  • @marcusaaronbaga5473
    @marcusaaronbaga5473 3 года назад

    Symfony\Component\Debug\Exception\FatalThrowableError : Call to undefined method Illuminate\Database\MySqlConnection::forgetRecordModificationState()

    • @themsaid
      @themsaid  3 года назад

      Your Laravel installation is out of date. Upgrade.

  • @richard_keep
    @richard_keep 3 года назад +1

    Would appreciate a link to where we can learn how to replicate a database since you've said you won't cover it in the video.

  • @khairahmanplus
    @khairahmanplus 3 года назад +1

    Thanks for this. Good to know everything about Laravel. It help me a lot during development how to customize this and that. Thanks again.

  • @SGDominicana
    @SGDominicana 3 года назад +1

    Hi, thanks for the informative video. I have a question regarding something you said. You mentioned that opening new DB connections is considered an expensive operation, I wonder why is this?
    Lets say you have an app that has a hundred request per second, and inside every request you are accessing the DB 10 times. That means you are opening 1000 connections every second if you were not to use singleton connections. Would that really affect performance in any significant way?
    The issue with using singleton for connection is that it can cause "Too many connection" issue if you have some lag in some other part of your app, and the question is does it really make any significant difference in performance for most apps out there.
    Would be nice to have some comparison regarding performance, how much difference it really makes, opening 1000 connections per second vs like 100.

    • @themsaid
      @themsaid  3 года назад +1

      Because on each new connection the server hosting the database need to allocate memory and then deallocates it after closing the connection. The more connections opens & closed the more work the server needs to do. That's why it's expensive.
      Keeping the connecting open to run multiple queries (or maybe multiple requests) requires less work from the server.

  • @kevinbatdorf
    @kevinbatdorf 3 года назад +1

    Hey, I think a nice extra large plant in the corner of your room by the router will look pretty nice there.

  • @ahmedhafez9951
    @ahmedhafez9951 2 года назад

    ممتاز... بس لو المقدمة يبقى جانبها رسومات توضيحية يبقى افضل بكتير لايصال المعلومة بشكل أفضل

    • @ahmedhafez9951
      @ahmedhafez9951 2 года назад

      Another point, it would be better if you add laravel version to the video title.

  • @beatnu187
    @beatnu187 3 года назад +2

    Another Golden resource! Thank you for giving all those gems to the community.

    • @themsaid
      @themsaid  3 года назад +1

      Glad you liked it :)

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

    Dude we need more content from you! These videos are great and cover things no one else covers.

  • @amaelftah
    @amaelftah 3 года назад +1

    keep it up mohamed . it's my first time to know about the read,write,sticky configuration options

    • @themsaid
      @themsaid  3 года назад +2

      Happy to help ya Ahmed :)

  • @phonenai5935
    @phonenai5935 3 года назад +1

    Thanks , we always stay tune for your videos

  •  2 года назад

    Hi Mohamed, very good content.
    Do you have any material about use REDIS Cluster scalable at Elasticache as FILE CACHE. We are have throubles with "Moved {IP}" error.

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

    Excellent tips, Thank you Mohamed.

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

    Awesome

  • @MrAvatarvb
    @MrAvatarvb 3 года назад +1

    شكرا جزيلا

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

    would be there any advantages if we have read and write connections available but pointing on the same host?

  • @dela__a
    @dela__a 3 года назад

    Sighs. Always learn something new when listening to you. Allah bless you so much Mohamed 🙏🏽

  • @Vad23M
    @Vad23M 3 года назад +1

    Well Done Mo!

  • @yousefabuanzeh8274
    @yousefabuanzeh8274 3 года назад +1

    جميل 💪😍

  • @arunabraham9382
    @arunabraham9382 2 года назад

    Octane is based on swoole or road runner under the hood. For advanced users, use this for better flexiblity

  • @samuellorette5708
    @samuellorette5708 3 года назад +1

    Thanks! So instructive in a short video!!! 🙏

    • @themsaid
      @themsaid  3 года назад

      Glad it was helpful!

  • @ahmedslink
    @ahmedslink 2 года назад

    You're doing great Mohamed, thanks a lot

  • @tinusg
    @tinusg 5 месяцев назад

    Exactly what I wanted to know, thanks.

  • @mahmudulhasan1360
    @mahmudulhasan1360 3 года назад +1

    Thanks, 💕💕 love you,bro

  • @QaziHamayun
    @QaziHamayun 3 года назад

    Man. You started really amazing video series.
    I learned 2 new things from this video. Keep it up. 👍👍

    • @themsaid
      @themsaid  3 года назад

      Glad you like it! :)

  • @matzehey1526
    @matzehey1526 3 года назад

    Uh, possibility of choosing read/write connection via config is awesome. nice vid.
    ( please look up how "instance" is pronounced, it drives me crazy :D )

    • @themsaid
      @themsaid  3 года назад

      I think I pronounce it correctly? :D What's wrong with it?

  • @mabdullahsari
    @mabdullahsari 3 года назад +1

    These videos are **gold**

    • @themsaid
      @themsaid  3 года назад

      Happy you think so :)

  • @fcorsair
    @fcorsair 3 года назад

    Hi Mohamed, what could be a real world “use-case” for this type of connection?

    • @themsaid
      @themsaid  3 года назад +1

      Distribute the load of reading from DB on multiple instances instead of one.

  • @stormcorexz
    @stormcorexz 2 года назад

    Supercharged video 👍

  • @JigneshJoisar
    @JigneshJoisar 3 года назад +1

    Great explanation about database connections.

    • @themsaid
      @themsaid  3 года назад

      Glad it was helpful!

    • @JigneshJoisar
      @JigneshJoisar 3 года назад

      @@themsaid it will be more helpful if you show how we use in real world with example .

  • @HussamAdil
    @HussamAdil 3 года назад

    Thanks, Mohammed, There is a lot about Laravel we need to learn.it's really a huge

    • @themsaid
      @themsaid  3 года назад

      What else do you need to Learn? Maybe I could help :)

    • @HussamAdil
      @HussamAdil 3 года назад

      @@themsaid how laravel boot I mean the life cycle.. From start to end.

  • @talamah
    @talamah 3 года назад

    thanks a lot you are great

  • @albertmulaki6511
    @albertmulaki6511 3 года назад

    Thank you for this. I really needed this.

    • @themsaid
      @themsaid  3 года назад

      Glad you liked it :)

  • @MohAliii
    @MohAliii 3 года назад

    Thanks to you and the team. Just please make the code font a little bit larger.

    • @themsaid
      @themsaid  3 года назад

      Larger than this? :D

    • @MohAliii
      @MohAliii 3 года назад

      @@themsaid Sometimes when I watch the video on mobile, the font is too small. But if it's only me, then not a big deal. Keep up the so beautiful work :)

  • @TeenaCode
    @TeenaCode 3 года назад

    Thanks Said! ✌🏿

  • @SophySEM
    @SophySEM 3 года назад

    Super useful!

    • @themsaid
      @themsaid  3 года назад +1

      Glad you liked it!