Welcome and Course Context
What is going on guys. Assalamualaikum. Welcome to Amigoscode. In this video, I want to give you the road map that you need in order to be confident when it comes to work with Spring Boot. I think two weeks ago I've done a video on how to master Java. So it was a very similar video, and one of you guys requested me to record a similar video for Spring Boot. So this is it. If you go to my channel, go ahead and subscribe, give me a thumbs up so I can keep on recording these videos. So literally take a second and give me a thumbs up so that I can keep on recording these videos to you guys. A lot of my students have benefited from these videos. Also, a bunch of my students have managed to secure jobs based on these videos and also the courses that I provide on my website. So also, if you know, a part of the private Facebook group and Discord over 300 people combined, and I would love to see you there. Without further ado, let's kick off this video.
Why Spring and Start With Documentation
About two weeks ago, I've recorded the Java road map, and basically this is an extension of it. So right here we have frameworks, and I've mentioned that we have Quarkus, Play, and Spring. Spring is by far the most popular, and it's the one that you should really be focusing on. Now let me go through one by one and then basically dig into these other concepts which are really important. So the first one, which I feel like it's one of the most important ones, is to read the documentation. Sometimes a lot of people say, how do I know all of this stuff? How can I teach Spring Boot so well? And that's because I always read the documentation. So if I'm learning something new, I always like the first place is to check the documentation. Nothing can go wrong with the documentation. And also it's a skill as a software engineer that you need to have because documentation is so important. So just imagine all of these people are building software and they want you to use it. So part of a framework such as Spring Boot, they have to have really good documentation in order for developers like yourself and myself to take advantage of it. So documentation is really important. And this is where you pretty much learn everything about Spring and Spring Boot.
Spring Core: Configuration, MVC, and DI
Then right here we have Spring Core. So inside we have a couple of things. But here, for example, I've mentioned configuration. So this is really important. You understand how configuration works. So setting up your database, for example, or having different configurations based on an environment. So development, testing, pre-prod, prod, staging. On all of that stuff, you should be aware of how to use configuration. And in the Spring world, they call it profiles. Then we have Spring MVC. So this is where you're going to be able to write your RESTful API. So here you have web service. So really just learn one or the other. So I'll say Tomcat or Jetty. Those are really popular web servers that you can use within Spring. And here I've got HTTP. So just understand what GET, POST, PUT, and DELETE are and just have in general the understanding of HTTP, right, and how it works. Then here, so Spring REST Docs. So basically, if you expose or if you are writing APIs, then you should be producing documentation. And this is what this is for. Then here I've got dependency injection. So dependency injection is really important because it will help you to write code that you can easily test. And I've done a video on dependency injection explaining what it is and the benefits, and you should definitely check it out. Then here I've got available annotations. There are many, to be honest; you just need to know the core ones and you will be good to go. Then here we have scheduling. So for example, if you want to execute a piece of code, for example, every five minutes or ten minutes — for example, someone has registered to your system, and then after five minutes you want to send them an email — you could do that with scheduling.
Security and Advanced Courses
Then moving on to security. Right here, security is a big area, which I think almost three years ago I actually launched a course on Spring Security, teaching form authentication, Basic Auth, JWT authentication, and authorization. So there's a course specifically for Spring Security. It's about four hours long, and it will teach you all of this. So still, you guys been requesting me to record it, and I'm actually planning to record a course on Udemy. So just let me know whether you are interested and I'll make it happen as soon as possible. Then right here we have Spring Boot. So basically right here. So this side right here is like the Spring Framework and what it has to offer. So the Spring Framework, and then we have security, which is important for you to secure your applications. Then Spring Boot basically makes it super easy for you to build microservices. Right. So microservices is really what you should be aiming for when working with Spring Boot, and you can learn about microservices, Kubernetes, and all that stuff. I've got a course which I've launched recently on my website, and you can learn about microservices with Kubernetes.
Testing in Spring Boot
But in here, let's first focus on testing. So testing is one of those areas which I feel is really, really important for you to have a full understanding. Right. Because there's no way that you're going to deploy an application to real users without having tests. So understand, for example, the annotations available: @DataJpaTest, @WebMvcTest, for integration tests testing your services, mocking, and basically just have a solid foundation on testing and Spring Boot. They give you a bunch of helper annotations and methods that allow you to easily test your microservices.
Databases: Choosing SQL vs NoSQL and Core Concepts
So then in here, let's basically speak, for example, here. When you write a backend application or a microservice, in this case, you need to pick a database. Now, this is super important because the database is basically the backend. Right. So you need to store data. So in here I would say SQL or NoSQL, you should have an understanding between those. But I would tell you or I would recommend you to choose SQL because that will teach you a bunch of other things. And then once you master SQL, NoSQL will be much easier for you because you have core concepts covered in SQL. So for example, pick a database: Postgres or MySQL — these are really, really popular. For NoSQL, Mongo is by far one of the most popular ones. But within SQL, you've got things such as queries, joins, indexes, transactions, locking. So all of that is important for you to write solid backend applications. Also, database design: you need to know how to model your database or how to model your application relationships: one-to-one, one-to-many, and all of that stuff. Right.
ORMs, Hibernate, and Spring Data Options
Then also in here I've got transactions — actually transactions was a duplicate earlier — so then we have Hibernate. So Hibernate really, it's like an ORM and basically allows you to take your Java classes and map them directly into the database. But I would recommend you to use it mainly for really small microservices. As soon as the application is big and you have a bunch of queries and joins, then don't use it. So I don't recommend it, but still useful for you to know how it works. So again, understand, for example, how transactions work. So you've got a bunch of annotations and relationships: @OneToMany, @OneToOne, @ManyToMany, and more important is the entity lifecycle. So this is really important because then if you want to use Spring Data, which is a bunch of helper classes that allows you to interact with databases, then you have something called Spring Data JPA. Right. So Spring Data JPA basically makes it easier to work with Hibernate, and it's by far what people will use when building microservices or actually small microservices where there isn't too many relationships going on. Right. So I've got a course right here, which I think is one of the most popular courses on my website that teaches you everything about Hibernate-specific, but more in detail about Spring Data JPA. But also I cover the entity lifecycle, which is something that you should know and master. Here you have basically Spring Data JDBC and you have JdbcTemplate right here. So this is when, for example, you want to have full control of the queries. And basically you have something called row mappers. And yeah. So this is when you have full control and you don't have classes with annotations and sometimes can be really complicated. Then we have Spring Data Mongo. So again, this right here is a wrapper that allows you to have your classes as documents, and then from that you have classes as collections, and from collections you can have a bunch of documents, because Mongo is a document store. Then it makes complete sense for you to use Spring Data MongoDB. I also have a course on it. So go and check it out. So as you can see, the backend is really important. And it's actually the database. Right. So how you store information. So it's quite huge this topic. And on my website I've got a free course on SQL and Postgres about four hours long teaching you transactions, indexes, queries, joins, and all of that stuff. And basically all of this is actually covered on my website. So go and check it out. I'll leave a link where you can find all of these courses.
Microservices and Spring Cloud
And finally, right here, there is microservices. So microservices — this is where Spring Boot is really nice because you can build microservices really quick. Now here with microservices, you've got Spring Cloud right here. So Spring Cloud is basically a bunch of small projects that allows you to build microservices. So there are defined patterns available that you can just plug in place. So Spring Cloud right here. So this is like a load balancer that you can basically send traffic to different various microservices. Hystrix right here — this is for fault tolerance. And then you have Sleuth or Zipkin — I don't know if I pronounced that correctly — so this is for distributed tracing. So as you have various different microservices, when you perform an HTTP request and that request flows through all of these different microservices, then it's good basically to know what is happening and where it's actually taking long. So on and so forth. And then you have Cloud Config. So this is mainly for a centralized place where you can store common configuration for your microservices. You can use, for example, GitHub. Yeah. Git as a thing. And then you've got other sources that you can store. And then you have Eureka. So this is for service discovery. You've got the client and you've got the server. And finally have OpenFeign. So this is, for example, how you go and connect to external APIs. The API for OpenFeign is super nice and easy to use. So there we go. So you actually have been requesting me to do a series on all of this. So it's coming very soon. So subscribe and stay tuned.
Containerization, Messaging, Secrets, and Wrap-Up
And then you have Docker and Kubernetes. So this is really important if you want to follow microservices. So again, I've got a course on Docker and Kubernetes teaching you everything. Combined, I think it's almost 20 hours of content. So go check my website where I teach Docker and Kubernetes, and you will see that, for example, the majority of this stuff, like service discovery and such, you probably will not use Eureka client and server when using Kubernetes. Also Spring Cloud; if you are on Amazon Web Services or GCP, you can just use their load balancer, which is like fault tolerance and highly available. So it's because if you have your own or if you are managing your own load balancer, your own server, then you can imagine that if that server goes down, then you have issues. Right. And you also have to configure all the load balancer certificates and stuff, so it can be quite difficult. So you most likely will not use this in production. Finally, you have message queues: SQS — this is mainly AWS-land — and then you have Kafka and then RabbitMQ. So this allows you to basically imagine a scenario where your user makes a request to your backend, and you do the bare minimum to guarantee that the request is either successful or rejected, and then the rest, whatever you can do in the background instead of having the user waiting for all of these different things that have to happen, you can just stick the request in a message queue and that will be done sometime later — asynchronous. Yeah. So I'm actually planning again on doing a course on message queues and stay tuned for this. And to be honest, I think this is it. So one more thing, which I actually forgot in here, is, for example, how to store configuration or secrets. So secrets: there are various different ways that you can do that. But one option, for example, is to use a managed solution. For example, that's usually what some people do. Or you could use Vault, for example. So there is support for Vault. And I will actually include it in this diagram right here. But this is, I think, pretty much it. And you can see this video was actually longer than the other one, because Spring is just the beast. And yeah, lots of you guys enjoy Spring Boot content. It's super famous in the industry. And yeah, you should use it and learn Spring Boot. So on my website, I've got a full stack Spring Boot with React covering all of this, deploying to AWS, CI/CD with GitHub Actions and all of that good stuff. So that's the best-selling course. And I'm going to leave a link where you can actually find the course and check it for yourself. And if you enjoyed this video, give me a thumbs up so I can keep on recording these videos. Let me know what you want to see next. If you're not part of the AmigosCode community, go ahead and join; the community is growing. And yeah, by the way, I'm actually going to leave a link where you can find all of the diagram. And if you have any suggestions, please do let me know. So for now, I'll catch you on the next one. Assalamualaikum.