NEVER Write This Line Of Code In Production. Seriously

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 ต.ค. 2024
  • In this video I will show how a simple line of code can bring your entire application down and cause Java Heap Space fill up. Yet a lot of beginners do this time and time again.
    SELECT * FROM table - What is wrong with code?
    #java #springboot3 #debugging
    Don't Forget to
    ===========================================
    💯 Subscribe to Amigoscode - bit.ly/2HpF5V8
    💯 Courses Available for free here - amigoscode.com...
    💯 Join Private Facebook Group and Discord - amigoscode.com...
    🙊 Here are the goods for all my videos video 🙊
    ► Recommended Books
    ===========================================
    Clean Code - amzn.to/2UGDPlX
    HTTP: The Definitive Guide - amzn.to/2JDVi8s
    Clean Architecture - amzn.to/2xOBNXW
    ► Computer and Monitor
    ===========================================
    New Apple MacBook Pro - amzn.to/3464Mmn
    Dell 27 INCH Ultrasharp U2719D Monitor - amzn.to/2xM3nW1
    Double Arm Stand Desk Mount - amzn.to/3aYKKfs
    USB C Hub Multiport Adapter - amzn.to/2Jz7NlL
    ► Camera Gear
    =============================================
    Sony ILCE7M3B Full Frame Mirrorless Camera - amzn.to/346QIJn
    Sigma 16 mm F1.4 DC DN - amzn.to/2wbic3Q
    Sigma 33B965 30 mm F1.4 DC DC - amzn.to/39G37Fd
    ► IDE & Tools I use for coding 💻 🎒
    ===========================================
    ITerm
    VsCode
    GoLand
    IntelliJ Ultimate
    Sublime
    P.S
    ===========================================
    💯 Don't forget to subscribe | bit.ly/2HpF5V8
    💯 Join Private Facebook Group and Discord - amigoscode.com...
    💯 Follow me on Instagram | bit.ly/2TSkA9w
    ❤️ Thanks for watching

ความคิดเห็น • 93

  • @amigoscode
    @amigoscode  ปีที่แล้ว +5

    Join Waiting List here: waiting-list.amigoscode.com/
    Please dont break the app: www.full-stack-react.amigoscode.dev/

    • @simonfarre4907
      @simonfarre4907 ปีที่แล้ว

      I'm not a Java programmer, I work in other languages;, so my question is, why is your SQL-query string mutable? (`var`) Why not use `val` there?

    • @richard2218188
      @richard2218188 ปีที่แล้ว +1

      Real email at 3:40 ?

    • @thilinamadushanka514
      @thilinamadushanka514 ปีที่แล้ว

      Hi, I got that error when trying to get data to report from a database by jdbc query..I want all these records..Is there any way to handle that case..?

  • @abbad_
    @abbad_ ปีที่แล้ว +56

    Salam aleykoum brother as a backend and DevOps Engineer I love your channel but i specifically loved this video that depicts what we actually do in our day to day job and the entire process from debugging, development, testing and finally deployment.

    • @locluvstkn6878
      @locluvstkn6878 ปีที่แล้ว +2

      Exactly! Thank you for presenting the full journey! This is gold!

    • @nandomax3
      @nandomax3 ปีที่แล้ว +1

      That's amazing. Coding is the first step, the second step and so on is trying to maintain the app work. I have a long list of exceptions to debug on my day to day job

  • @ahmedhosny4910
    @ahmedhosny4910 ปีที่แล้ว +5

    the person who broke the application did great favor for the junior developers like me to learn and write safe queries in production thanks nelson ❤

  • @danielkirsch4351
    @danielkirsch4351 ปีที่แล้ว +4

    Love this, perfect opportunity to show full dev cycle with debugging, code commits and ci/cd pipeline to deployment.

  • @houssemmhamdi1137
    @houssemmhamdi1137 ปีที่แล้ว

    Salam bro,
    Ramadhan mubarek! as an SDET we always face these kinds of issue when running load tests or automations scripts! thanks for the video and eid mubarek soon inshallah

  • @azimutjava
    @azimutjava ปีที่แล้ว

    I writing own study spring project as a course as well. And definitely saying - you did a grate job. And this is a just a bug in production. Critical, but solved. Nothing more. Thank you for you work!

  • @Ryudith
    @Ryudith ปีที่แล้ว +1

    lol, you remind me when I was a Superman - design, build and manage server all by myself. It was stressful if something happen and hope boss didn't find it, because so hassle to handle office politics with other. I wonder why you not limit list in first place and don't forget to auto backup database which I often forget and it become really mess when I accidentally clean table record because client said the server is testing but actually production. Btw, welcome to online world. 😀

  • @CryptoKosh
    @CryptoKosh ปีที่แล้ว

    How you decide the page size… what if the page meta data grows horizontally? Will again need to reduce the page size?

  • @bulogging
    @bulogging ปีที่แล้ว +7

    I think you might’ve done it as a mistake, but I think it would be good to censor-out the user data, especially their emails, age, and gender - love the contents and keep it up! 🙂

    • @megabain
      @megabain ปีที่แล้ว +2

      The emails look really fake and randomly generated. So I think its okay. But nice catch!

  • @ferahnuma
    @ferahnuma ปีที่แล้ว +2

    Salam Bro. Thanks for your inspiring tutorials. I have a question about the platform where your application is deployed? Which service are you using? I just saw Elastic Bean Stalk. Does it also have a sandbox environment? What platform would you recommend to play around with the whole pipeline from development till deployment using container technologies like docker. Thanks in advance.

  • @znacly1184
    @znacly1184 ปีที่แล้ว

    I love this. Thanks for sharing a live issue! Might be a good reason to discuss bloom filters or web application firewalls to mitigate these issues beforehand? *e.g., you’ve stopped the crash, but you’re still paying for all of that bad data to be stored by Amazon! Again, thank you for your videos! They’ve been extremely helpful in my journey to learning S.E.

  • @lts8683
    @lts8683 ปีที่แล้ว +1

    We need more like this recommendation for the production

  • @AleksandarT10
    @AleksandarT10 ปีที่แล้ว +1

    Great video! Important topic to keep in mind for all developers. Anyway do you have a video where you show Elasticbeanstalk Deployments with Docker image? Thanks a lot

  • @BabbarOP
    @BabbarOP ปีที่แล้ว +1

    I've one question! Earlier we were getting OOM exception because we were creating 120K objects in heap. But what if 1000 users now access your application so everytime 1000 objects will be created. How will heap handle it?

  • @elvisdorkenoo
    @elvisdorkenoo ปีที่แล้ว +2

    Nelson, please could you add a Gradle(in place of maven) implementation to your course ?

  • @timmelis4872
    @timmelis4872 ปีที่แล้ว

    Very nice video. Very useful. ... Do you have a course on building a Spring Boot app and deploying it to AWS ?

  • @Jumanji_Dev
    @Jumanji_Dev ปีที่แล้ว +1

    Loved it maan... Thanks👌

  • @travellershouse6480
    @travellershouse6480 ปีที่แล้ว

    We did have some kinds of this issues in production because some colleague have Add a lot of FETCH in HQL method

  • @crimsOn0011
    @crimsOn0011 ปีที่แล้ว

    I did not expect a lesson with a slice of the software engineer life. (Jokes aside, nice, humorous video!)

  • @xenia5033
    @xenia5033 ปีที่แล้ว

    This video is just in time! Thank you!

  • @WalkWithM3
    @WalkWithM3 ปีที่แล้ว +2

    Selamin Aleykum, Hi brother, I think it is also worth to mention that browser has also limited capacity to display.
    Other solutions to that can be pagination and ajax call with bulk append. What donyou think?

  • @andyvandenberghe6364
    @andyvandenberghe6364 ปีที่แล้ว

    oeps i think you missed the where/limit conditions. that will cause a heap space exception for sure. i've seen this aswell. Data engineering is often a missed skillset for pure java devs.

  • @petarvjakovski2003
    @petarvjakovski2003 ปีที่แล้ว

    Hi Nelson. Could you please tell me which theme are you using for IntelliJ?

  • @fahadgaliwango4502
    @fahadgaliwango4502 ปีที่แล้ว

    wonderful resource , but what recommendations Incase I to generate a report from large dataset from database.

  • @sofiyan_ifren
    @sofiyan_ifren ปีที่แล้ว

    Yeah, lot of these kind of problems are really occurring in tech companies... 🙄

  • @thabo5799
    @thabo5799 ปีที่แล้ว

    In my junior year I once pushed select * records with no limit. My PR wasn’t reviewed properly and no tests were implemented. You can guess what happened next 😅😂

  • @Zeroazcar
    @Zeroazcar ปีที่แล้ว

    Do you have a CI/CD course? That what you show was very interesting.

  • @devdadph
    @devdadph ปีที่แล้ว

    I think I'm a mind reader already 🤣
    P.S. this comment is a Fan(friendly) comment
    N*son inner voice: I will ruin your production by loading huge amounts of records that your code is not ready to handle
    N*son: ohh, great plan! I can create content showing the real-world issues encountered by these companies deploying codes without big data testing
    N*son inner voice: YES! right on point!
    N*son: YEAH! then I will also blame you for what happened...
    N*son inner voice: yeah, let's do it!..... Eh wait what? 😕😶‍🌫😶‍🌫

  • @AdityoPratama
    @AdityoPratama ปีที่แล้ว

    hey, thats very cool unit test animation there

  • @fazilmes
    @fazilmes ปีที่แล้ว +1

    How about implementing Lazy Loading using Spring.

  • @arane16815
    @arane16815 ปีที่แล้ว

    와 네이버로 보고 들어왔네 오우 깜놀ㅋ기 thank you good video!!

  • @taiwoobadare
    @taiwoobadare ปีที่แล้ว

    It looks like they really are fake accounts because the real ones have profile images but the fakes have no profile image, perhaps you could delete the fakes if verified.

  • @agungdonga2401
    @agungdonga2401 ปีที่แล้ว

    Hi, I've a question,
    it's it good idea, when I getAll data from my db which is almost 1M data, and at the view page i use a datatables which is have a paging feature?

  • @millionsharbeclassroom-db3fg
    @millionsharbeclassroom-db3fg ปีที่แล้ว

    I encountered this when I was building a music application with javafx the program reads all music files from the computer and convert it to my custom song class then it writes to text file with printwriter for later use and when it tries to load my custom song files from a text file it throws java heap space error

  • @sansmoraxz
    @sansmoraxz ปีที่แล้ว

    Hommie you can do the same shit but way better with jpa rather than jdbc. Also if you use paginate you can stream it as much as you want without facing mem related crashes.

  • @svalyavasvalyava9867
    @svalyavasvalyava9867 ปีที่แล้ว

    thank you for sharing knowledge and experience 😊

  • @muurimc
    @muurimc ปีที่แล้ว

    Great video and you definetely have a point

  • @djoleezcool
    @djoleezcool ปีที่แล้ว

    Hey hey Giorgi's here! 🙌

  • @artetl
    @artetl ปีที่แล้ว

    This problem completely obvious for any SQL developer so that means - learn database before!

  • @saturnteatree
    @saturnteatree ปีที่แล้ว

    I have the same issue on my site just a bunch of random generated users and contacts i need to add a captca and 2-factor id

  • @Mr.RaviTeja
    @Mr.RaviTeja ปีที่แล้ว

    where exactly heap memory error is coming out, unable to debug. can you tell me in gcp how to debug heap memory of particular server.

  • @Im_not_scareddd
    @Im_not_scareddd ปีที่แล้ว

    Salaam alaikum bro please create a video on how to draw the the application stracture and architecture using intellij

  • @netmarvintube
    @netmarvintube ปีที่แล้ว

    Hahaha..... Amigooo!!!! It was not my fault!!!! Lets go!!!!

  • @MrMoonplus
    @MrMoonplus ปีที่แล้ว

    @amigoscode what if we want to export 1 lacs data into file i.e json file . (Using api)

  • @IvanRandomDude
    @IvanRandomDude ปีที่แล้ว +3

    9:58 Damn, I almost forgot how slow build is in Java.

    • @jesper2455
      @jesper2455 ปีที่แล้ว +1

      That has nothing to do with Maven builds, what is taking so long is running the tests. And it seems he's not only running basic unit tests but also integration tests which usually takes more time.

  • @shogant
    @shogant ปีที่แล้ว

    Should the test expect results

  • @kevinlang5873
    @kevinlang5873 ปีที่แล้ว

    From what video is this project on?

  • @caffeinejavacode1475
    @caffeinejavacode1475 ปีที่แล้ว

    I would be nice create new topic (tips) and playlist with advices like this

  • @staywidz9998
    @staywidz9998 ปีที่แล้ว

    119k is a rookie number, but i guess some servers can't handle shit

  • @lmax0001
    @lmax0001 ปีที่แล้ว

    Come on man, you can't miss that. :)

  • @jimishukurow2286
    @jimishukurow2286 ปีที่แล้ว +1

    that is DDOS attack ...

  • @Talish1986
    @Talish1986 ปีที่แล้ว

    Salam Aleykom. If I want to fetch all. What should I do then?)

  • @pedrobastos4342
    @pedrobastos4342 ปีที่แล้ว

    What if 10, 100 or 1000 people wants to list the page at the same time what will happen? 1000 * 1000 = 1.000.000 of objects

    • @simopr09
      @simopr09 ปีที่แล้ว

      You can try it yourself and see what happens. just write a skipt that calls the endoind 1000 times

  • @devrub623
    @devrub623 ปีที่แล้ว

    What about using cache ?

  • @ЧеченецЧеченский-ч7з
    @ЧеченецЧеченский-ч7з ปีที่แล้ว

    Now it’s interesting to find another issue that will break your app brother😂

  • @CamembertDave
    @CamembertDave ปีที่แล้ว +1

    3:05 Should you really be showing this?
    3:10 Oh I see, lol

  • @jamesraphael8473
    @jamesraphael8473 ปีที่แล้ว

    When will i get to the stage of understanding all these😒😒😒😒😒

  • @matusseidl
    @matusseidl ปีที่แล้ว

    you did nothing just add a limit how what if you need 1001 or items from 1000 to 1100, it could be fine to show how to use pagination and offset as well

  • @papafall9726
    @papafall9726 ปีที่แล้ว

    🤷‍♂️ Walahi wasn’t me…. Nothing to do with me I swear. Masha’Allah

  • @sailingbytes4399
    @sailingbytes4399 ปีที่แล้ว

    I really hope that the customer data shown, is created randomly and that you're not showing the original database here? ;)

    • @glennmerrill88ify
      @glennmerrill88ify ปีที่แล้ว

      He explains that those are fake accounts. If you look at the emails for each you can obviously tell.

    • @sailingbytes4399
      @sailingbytes4399 ปีที่แล้ว

      @@glennmerrill88ify My bad, I think I missed the part where he said, that it's fakedata. That's good, 'cause otherwise I would be really conserned about the integrity of his database :)

  • @rajab1365
    @rajab1365 ปีที่แล้ว

    bro math is important when it comes to software engineering
    🤔

  • @jpbastyr
    @jpbastyr ปีที่แล้ว

    definitely random, you can see that none of the emails match their names lol

  • @lebdesmath2510
    @lebdesmath2510 ปีที่แล้ว

    why put music ??? )::::

  • @thechosenone8523
    @thechosenone8523 ปีที่แล้ว

    I did this.

  • @youssefbouchara1179
    @youssefbouchara1179 ปีที่แล้ว +1

    That's why I use tests with real components instead of Mockito :D

    • @andresnator
      @andresnator ปีที่แล้ว +1

      Integration test

    • @youssefbouchara1179
      @youssefbouchara1179 ปีที่แล้ว

      @@andresnator right, i test my method with real comps and h2 so I guess its considered integration instead of unit

  • @jopadjr
    @jopadjr ปีที่แล้ว

    988th...Thanks

  • @babagrilo
    @babagrilo ปีที่แล้ว

    أحبك في الله أخي

  • @programmingwithnurulhuda
    @programmingwithnurulhuda ปีที่แล้ว

    Whoever is reading this, never give up. God is with you.

  • @josedegracia5246
    @josedegracia5246 ปีที่แล้ว

    Hi

  • @lovetheentertainment9949
    @lovetheentertainment9949 ปีที่แล้ว +1

    Need video on java 8 Date and Time

    • @wilfriedklaebe
      @wilfriedklaebe ปีที่แล้ว +2

      Really? Java 8? Switch to something newer. Java 17 is LTS.

  • @scopes2512
    @scopes2512 ปีที่แล้ว

    Assalamu Alaykum amigoscode
    I love the content. I wanted to notify you as you are muslim that at 11:48 you said fingers crossed multiple times and we ass muslim are forbidden from ever saying that as it is what the christians do (referring to their belief of jesus) and is shirk. I love you for the sake of Allah and wanted to notify you. Again love the content!

    • @Johnnydhee
      @Johnnydhee ปีที่แล้ว

      Your hate has no place in this video. Disgusting.

  • @feloniousmonkey
    @feloniousmonkey ปีที่แล้ว

    Jesus...use spring data and proper pagination...

  • @ADVENTUREVLOG6722
    @ADVENTUREVLOG6722 ปีที่แล้ว

    Third here

  • @prateekgupta2567
    @prateekgupta2567 ปีที่แล้ว

    First here

  • @kicknotes
    @kicknotes ปีที่แล้ว

    "I didn't expect..." Always expect. Proactive is always better than reactive.