{"id":89211,"date":"2025-07-12T21:48:10","date_gmt":"2025-07-12T14:48:10","guid":{"rendered":"https:\/\/itviec.com\/blog\/?p=89211"},"modified":"2025-07-12T21:48:13","modified_gmt":"2025-07-12T14:48:13","slug":"lo-trinh-hoc-spring-boot-roadmap","status":"publish","type":"post","link":"https:\/\/itviec.com\/blog\/lo-trinh-hoc-spring-boot-roadmap\/","title":{"rendered":"Spring Boot Roadmap: L\u1ed9 tr\u00ecnh h\u1ecdc Spring Boot chi ti\u1ebft"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">N\u1ed9i dung b\u00e0i vi\u1ebft<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/itviec.com\/blog\/lo-trinh-hoc-spring-boot-roadmap\/#Tong_quan_Spring_boot_Roadmap\" >T\u1ed5ng quan Spring boot Roadmap&nbsp;<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/itviec.com\/blog\/lo-trinh-hoc-spring-boot-roadmap\/#Giai_doan_1_Kien_thuc_nen_tang\" >Giai \u0111o\u1ea1n 1: Ki\u1ebfn th\u1ee9c n\u1ec1n t\u1ea3ng<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/itviec.com\/blog\/lo-trinh-hoc-spring-boot-roadmap\/#Giai_doan_2_Tim_hieu_Spring_Boot_Core\" >Giai \u0111o\u1ea1n 2: T\u00ecm hi\u1ec3u Spring Boot Core<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/itviec.com\/blog\/lo-trinh-hoc-spring-boot-roadmap\/#Giai_doan_3_Tuong_tac_voi_Co_so_du_lieu_va_bao_mat\" >Giai \u0111o\u1ea1n 3: T\u01b0\u01a1ng t\u00e1c v\u1edbi C\u01a1 s\u1edf d\u1eef li\u1ec7u v\u00e0 b\u1ea3o m\u1eadt<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/itviec.com\/blog\/lo-trinh-hoc-spring-boot-roadmap\/#Giai_doan_4_Cac_chu_de_nang_cao\" >Giai \u0111o\u1ea1n 4: C\u00e1c ch\u1ee7 \u0111\u1ec1 n\u00e2ng cao&nbsp;<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/itviec.com\/blog\/lo-trinh-hoc-spring-boot-roadmap\/#Cac_cau_hoi_thuong_gap_ve_Spring_boot_roadmap\" >C\u00e1c c\u00e2u h\u1ecfi th\u01b0\u1eddng g\u1eb7p&nbsp;v\u1ec1 Spring boot roadmap<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/itviec.com\/blog\/lo-trinh-hoc-spring-boot-roadmap\/#Tong_ket_ve_Spring_boot_roadmap\" >T\u1ed5ng k\u1ebft v\u1ec1 Spring boot roadmap<\/a><\/li><\/ul><\/nav><\/div>\n\n<p><strong><em>Spring Boot \u0111\u01b0\u1ee3c xem nh\u01b0 m\u1ed9t gi\u1ea3i ph\u00e1p c\u1ee9u c\u00e1nh, gi\u00fap b\u1ea1n kh\u1edfi t\u1ea1o d\u1ef1 \u00e1n Java ch\u1ec9 trong v\u00e0i ph\u00fat. D\u00f9 b\u1ea1n l\u00e0 m\u1ed9t l\u1eadp tr\u00ecnh vi\u00ean Java mu\u1ed1n hi\u1ec7n \u0111\u1ea1i h\u00f3a k\u1ef9 n\u0103ng, m\u1ed9t sinh vi\u00ean IT \u0111ang t\u00ecm h\u01b0\u1edbng \u0111i, hay b\u1ea5t k\u1ef3 ai mu\u1ed1n x\u00e2y d\u1ef1ng RESTful API v\u00e0 microservices nhanh ch\u00f3ng, b\u00e0i vi\u1ebft n\u00e0y s\u1ebd cung c\u1ea5p m\u1ed9t l\u1ed9 tr\u00ecnh h\u1ecdc t\u1eadp r\u00f5 r\u00e0ng, t\u1eebng b\u01b0\u1edbc gi\u00fap b\u1ea1n t\u1ef1 tin chinh ph\u1ee5c Spring Boot.&nbsp;<\/em><\/strong><\/p>\n\n\n\n<p>V\u1edbi tri\u1ebft l\u00fd &#8220;\u01af\u1edbc l\u1ec7 h\u01a1n c\u1ea5u h\u00ecnh&#8221;, Spring Boot t\u1ef1 \u0111\u1ed9ng h\u00f3a h\u1ea7u h\u1ebft c\u00e1c thi\u1ebft l\u1eadp ban \u0111\u1ea7u, t\u00edch h\u1ee3p s\u1eb5n server v\u00e0 qu\u1ea3n l\u00fd c\u00e1c th\u01b0 vi\u1ec7n ph\u1ee5 thu\u1ed9c m\u1ed9t c\u00e1ch th\u00f4ng minh qua c\u00e1c &#8220;starters&#8221;. \u0110i\u1ec1u n\u00e0y cho ph\u00e9p b\u1ea1n x\u00e2y d\u1ef1ng m\u1ed9t \u1ee9ng d\u1ee5ng s\u1eb5n s\u00e0ng ho\u1ea1t \u0111\u1ed9ng m\u00e0 kh\u00f4ng c\u1ea7n lo v\u1ec1 s\u1ef1 ph\u1ee9c t\u1ea1p b\u00ean d\u01b0\u1edbi.<\/p>\n\n\n\n<p>\u0110\u1ecdc b\u00e0i vi\u1ebft n\u00e0y \u0111\u1ec3 hi\u1ec3u r\u00f5 c\u00e1c giai \u0111o\u1ea1n h\u1ecdc Spring Boot sau:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Giai \u0111o\u1ea1n 1: Chu\u1ea9n b\u1ecb h\u00e0nh trang (Ki\u1ebfn th\u1ee9c n\u1ec1n t\u1ea3ng)&nbsp;&nbsp;<\/li>\n\n\n\n<li>Giai \u0111o\u1ea1n 2: X\u00e2y d\u1ef1ng v\u1edbi Spring Boot Core<\/li>\n\n\n\n<li>Giai \u0111o\u1ea1n 3: T\u01b0\u01a1ng t\u00e1c v\u1edbi c\u01a1 s\u1edf d\u1eef li\u1ec7u v\u00e0 b\u1ea3o m\u1eadt<\/li>\n\n\n\n<li>Giai \u0111o\u1ea1n 4: T\u00ecm hi\u1ec3u th\u00eam v\u1ec1 c\u00e1c ch\u1ee7 \u0111\u1ec1 n\u00e2ng cao&nbsp;<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-t\u1ed5ng-quan-spring-boot-roadmap-nbsp\"><span class=\"ez-toc-section\" id=\"Tong_quan_Spring_boot_Roadmap\"><\/span><strong>T\u1ed5ng quan Spring boot Roadmap&nbsp;<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>M\u1ed9t Spring boot roadmap to\u00e0n di\u1ec7n, v\u1edbi c\u00e1c b\u01b0\u1edbc h\u1ecdc t\u1eadp \u0111\u01b0\u1ee3c thi\u1ebft k\u1ebf theo tr\u00ecnh t\u1ef1 h\u1ee3p l\u00fd, ph\u00f9 h\u1ee3p v\u1edbi c\u1ea3 ng\u01b0\u1eddi m\u1edbi b\u1eaft \u0111\u1ea7u th\u01b0\u1eddng bao g\u1ed3m c\u00e1c ki\u1ebfn th\u1ee9c nh\u01b0 sau:<\/p>\n\n\n\n<p><strong>1. B\u1eaft \u0111\u1ea7u v\u1edbi ki\u1ebfn th\u1ee9c Java Fundamentals<\/strong> (Java 17\/21, OOP, Lambda, Stream) v\u00e0 l\u00e0m quen v\u1edbi <strong>c\u00f4ng c\u1ee5 build<\/strong> nh\u01b0 Maven ho\u1eb7c Gradle.<\/p>\n\n\n\n<p><strong>2. N\u1eafm v\u1eefng c\u00e1c kh\u00e1i ni\u1ec7m tr\u1ecdng t\u00e2m c\u1ee7a Spring Core<\/strong> (IoC\/DI, Bean) v\u00e0 c\u00e1c t\u00ednh n\u0103ng ch\u00ednh c\u1ee7a Spring Boot (Auto-configuration, Starters, Actuator).<\/p>\n\n\n\n<p><strong>3. X\u00e2y d\u1ef1ng \u1ee9ng d\u1ee5ng th\u1ef1c t\u1ebf:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Persistence &amp; Databases:<\/strong> H\u1ecdc c\u00e1ch l\u00e0m vi\u1ec7c v\u1edbi c\u01a1 s\u1edf d\u1eef li\u1ec7u b\u1eb1ng Spring Data JPA, \u0111\u1ecbnh ngh\u0129a Entities, Repositories v\u00e0 c\u00e1c m\u1ed1i quan h\u1ec7.<\/li>\n\n\n\n<li><strong>Building REST APIs:<\/strong> X\u00e2y d\u1ef1ng c\u00e1c API endpoint b\u1eb1ng Controller, x\u1eed l\u00fd DTOs, validation v\u00e0 exception.<\/li>\n<\/ul>\n\n\n\n<p><strong>4. \u0110\u1ea3m b\u1ea3o ch\u1ea5t l\u01b0\u1ee3ng v\u00e0 b\u1ea3o m\u1eadt:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>API Security:<\/strong> T\u00edch h\u1ee3p Spring Security \u0111\u1ec3 x\u00e1c th\u1ef1c v\u00e0 ph\u00e2n quy\u1ec1n, \u0111\u1eb7c bi\u1ec7t v\u1edbi JWT.<\/li>\n\n\n\n<li><strong>Testing:<\/strong> Vi\u1ebft ki\u1ec3m th\u1eed cho c\u00e1c t\u1ea7ng c\u1ee7a \u1ee9ng d\u1ee5ng v\u1edbi JUnit, Mockito v\u00e0 Testcontainers.<\/li>\n<\/ul>\n\n\n\n<p><strong>5. T\u00ecm hi\u1ec3u c\u00e1c ch\u1ee7 \u0111\u1ec1 n\u00e2ng cao v\u00e0 tri\u1ec3n khai:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>T\u00ecm hi\u1ec3u v\u1ec1 l\u1eadp tr\u00ecnh b\u1ea5t \u0111\u1ed3ng b\u1ed9 (Reactive), h\u00e0ng \u0111\u1ee3i tin nh\u1eafn (RabbitMQ\/Kafka), v\u00e0 ki\u1ebfn tr\u00fac Microservices.<\/li>\n\n\n\n<li><strong>DevOps &amp; Cloud:<\/strong> H\u1ecdc c\u00e1ch \u0111\u00f3ng g\u00f3i \u1ee9ng d\u1ee5ng v\u1edbi Docker, thi\u1ebft l\u1eadp CI\/CD v\u00e0 tri\u1ec3n khai l\u00ean c\u00e1c n\u1ec1n t\u1ea3ng \u0111\u00e1m m\u00e2y (AWS, GCP) ho\u1eb7c Kubernetes.<\/li>\n<\/ul>\n\n\n\n<p>&nbsp;T\u1eeb 5 n\u1ed9i dung ch\u00ednh tr\u00ean ta c\u00f3 4 giai \u0111o\u1ea1n chi ti\u1ebft nh\u01b0 sau:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-giai-do\u1ea1n-1-ki\u1ebfn-th\u1ee9c-n\u1ec1n-t\u1ea3ng\"><span class=\"ez-toc-section\" id=\"Giai_doan_1_Kien_thuc_nen_tang\"><\/span><strong>Giai \u0111o\u1ea1n 1: Ki\u1ebfn th\u1ee9c n\u1ec1n t\u1ea3ng<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Gi\u1ed1ng nh\u01b0 x\u00e2y m\u1ed9t ng\u00f4i nh\u00e0, n\u1ec1n m\u00f3ng v\u1eefng ch\u1eafc l\u00e0 y\u1ebfu t\u1ed1 quy\u1ebft \u0111\u1ecbnh t\u1ea5t c\u1ea3. Tr\u01b0\u1edbc khi vi\u1ebft nh\u1eefng d\u00f2ng code Spring Boot \u0111\u1ea7u ti\u00ean, b\u1ea1n c\u1ea7n \u0111\u1ea3m b\u1ea3o m\u00ecnh \u0111\u00e3 trang b\u1ecb \u0111\u1ea7y \u0111\u1ee7 nh\u1eefng ki\u1ebfn th\u1ee9c n\u1ec1n t\u1ea3ng d\u01b0\u1edbi \u0111\u00e2y. \u0110\u1eebng b\u1ecf qua, v\u00ec vi\u1ec7c n\u1eafm v\u1eefng ch\u00fang s\u1ebd gi\u00fap h\u00e0nh tr\u00ecnh sau n\u00e0y c\u1ee7a b\u1ea1n tr\u1edf n\u00ean m\u01b0\u1ee3t m\u00e0 v\u00e0 hi\u1ec7u qu\u1ea3 h\u01a1n r\u1ea5t nhi\u1ec1u.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-java-core-n\u1ec1n-mong-b\u1ea5t-di\u1ec7t\"><strong>Java Core &#8211; n\u1ec1n m\u00f3ng b\u1ea5t di\u1ec7t<\/strong><\/h3>\n\n\n\n<p>Spring Boot \u0111\u01b0\u1ee3c x\u00e2y d\u1ef1ng tr\u00ean Java, v\u00ec v\u1eady b\u1ea1n ph\u1ea3i c\u00f3 ki\u1ebfn th\u1ee9c v\u1ec1 Java. Spring Boot t\u1eadn d\u1ee5ng r\u1ea5t nhi\u1ec1u t\u00ednh n\u0103ng m\u1ea1nh m\u1ebd c\u1ee7a Java hi\u1ec7n \u0111\u1ea1i \u0111\u1ec3 mang l\u1ea1i s\u1ef1 k\u1ef3 di\u1ec7u c\u1ee7a n\u00f3. B\u1ea1n n\u00ean c\u00f3 ki\u1ebfn th\u1ee9c c\u01a1 b\u1ea3n v\u1ec1:&nbsp;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-java-8\"><strong>Java 8+<\/strong><\/h4>\n\n\n\n<p>\u0110\u00e2y l\u00e0 y\u00eau c\u1ea7u g\u1ea7n nh\u01b0 b\u1eaft bu\u1ed9c. Spring Boot v\u00e0 c\u1ed9ng \u0111\u1ed3ng \u0111\u00e3 chuy\u1ec3n sang s\u1eed d\u1ee5ng c\u00e1c t\u00ednh n\u0103ng c\u1ee7a Java 8 tr\u1edf l\u00ean. H\u00e3y t\u1eadp trung \u0111\u1eb7c bi\u1ec7t v\u00e0o:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Lambda Expressions:<\/strong> Gi\u00fap b\u1ea1n vi\u1ebft code x\u1eed l\u00fd s\u1ef1 ki\u1ec7n v\u00e0 logic nghi\u1ec7p v\u1ee5 m\u1ed9t c\u00e1ch ng\u1eafn g\u1ecdn, s\u00fac t\u00edch, \u0111\u1eb7c bi\u1ec7t khi l\u00e0m vi\u1ec7c v\u1edbi c\u00e1c functional interface. \u0110\u1ec3 hi\u1ec3u th\u00eam v\u1ec1 Lambda Expressions, b\u1ea1n c\u00f3 th\u1ec3 tham kh\u1ea3o <a href=\"https:\/\/www.w3schools.com\/java\/java_lambda.asp\" target=\"_blank\" rel=\"noreferrer noopener\">t\u00e0i li\u1ec7u t\u1eeb W3Schools<\/a>.<\/li>\n\n\n\n<li><strong>Stream API:<\/strong> M\u1ed9t c\u00f4ng c\u1ee5 c\u1ef1c k\u1ef3 m\u1ea1nh m\u1ebd \u0111\u1ec3 x\u1eed l\u00fd c\u00e1c t\u1eadp h\u1ee3p d\u1eef li\u1ec7u (collections). N\u1eafm v\u1eefng Stream API s\u1ebd gi\u00fap b\u1ea1n thao t\u00e1c d\u1eef li\u1ec7u m\u1ed9t c\u00e1ch hi\u1ec7u qu\u1ea3 v\u00e0 d\u1ec5 \u0111\u1ecdc h\u01a1n r\u1ea5t nhi\u1ec1u so v\u1edbi c\u00e1c v\u00f2ng l\u1eb7p for truy\u1ec1n th\u1ed1ng.<\/li>\n<\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><em>\u0110\u1ecdc chi ti\u1ebft: <a href=\"https:\/\/itviec.com\/blog\/java-la-gi\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Java l\u00e0 g\u00ec? T\u1ea5t c\u1ea3 nh\u1eefng \u0111i\u1ec1u b\u1ea1n c\u1ea7n bi\u1ebft v\u1ec1 ng\u00f4n ng\u1eef Java<\/strong><\/a><\/em><\/p>\n<\/blockquote>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-cac-khai-ni\u1ec7m-c\u1ed1t-loi-c\u1ee7a-l\u1eadp-trinh-h\u01b0\u1edbng-d\u1ed1i-t\u01b0\u1ee3ng-oop\"><strong>C\u00e1c kh\u00e1i ni\u1ec7m c\u1ed1t l\u00f5i c\u1ee7a L\u1eadp tr\u00ecnh H\u01b0\u1edbng \u0111\u1ed1i t\u01b0\u1ee3ng (OOP)<\/strong><\/h4>\n\n\n\n<p>T\u00ednh \u0111\u00f3ng g\u00f3i, K\u1ebf th\u1eeba, \u0110a h\u00ecnh v\u00e0 Tr\u1eebu t\u01b0\u1ee3ng l\u00e0 nh\u1eefng kh\u00e1i ni\u1ec7m b\u1ea1n ph\u1ea3i &#8220;\u0103n s\u00e2u v\u00e0o m\u00e1u&#8221;. Spring Framework s\u1eed d\u1ee5ng ch\u00fang \u1edf kh\u1eafp m\u1ecdi n\u01a1i.<\/p>\n\n\n\n<p>\u0110\u1ecdc chi ti\u1ebft v\u1ec1 OOP t\u1ea1i <a href=\"https:\/\/itviec.com\/blog\/oop-la-gi\/\" target=\"_blank\" rel=\"noreferrer noopener\">OOP l\u00e0 g\u00ec? 4 \u0111\u1eb7c t\u00ednh c\u01a1 b\u1ea3n c\u1ee7a OOP<\/a>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-java-collections-framework\"><strong>Java Collections Framework<\/strong><\/h4>\n\n\n\n<p>List, Set, Map v\u00e0 c\u00e1c tri\u1ec3n khai c\u1ee7a ch\u00fang (ArrayList, HashSet, HashMap) l\u00e0 nh\u1eefng c\u00f4ng c\u1ee5 b\u1ea1n s\u1ebd s\u1eed d\u1ee5ng h\u00e0ng ng\u00e0y \u0111\u1ec3 l\u01b0u tr\u1eef v\u00e0 qu\u1ea3n l\u00fd d\u1eef li\u1ec7u.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-x\u1eed-ly-ngo\u1ea1i-l\u1ec7-exception-handling\"><strong>X\u1eed l\u00fd ngo\u1ea1i l\u1ec7 (Exception Handling)<\/strong><\/h4>\n\n\n\n<p>Hi\u1ec3u r\u00f5 c\u00e1ch ho\u1ea1t \u0111\u1ed9ng c\u1ee7a try-catch-finally, checked vs unchecked exceptions \u0111\u1ec3 x\u00e2y d\u1ef1ng nh\u1eefng \u1ee9ng d\u1ee5ng \u1ed5n \u0111\u1ecbnh v\u00e0 d\u1ec5 d\u00e0ng g\u1ee1 l\u1ed7i.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-cong-c\u1ee5-build-build-tools-maven-va-gradle\"><strong>C\u00f4ng c\u1ee5 Build (Build Tools): Maven v\u00e0 Gradle<\/strong><\/h3>\n\n\n\n<p>Khi d\u1ef1 \u00e1n c\u1ee7a b\u1ea1n l\u1edbn d\u1ea7n, vi\u1ec7c qu\u1ea3n l\u00fd c\u00e1c th\u01b0 vi\u1ec7n (dependencies) v\u00e0 \u0111\u00f3ng g\u00f3i \u1ee9ng d\u1ee5ng theo c\u00e1ch th\u1ee7 c\u00f4ng l\u00e0 b\u1ea5t kh\u1ea3 thi. \u0110\u00e2y l\u00e0 l\u00fac c\u00e1c c\u00f4ng c\u1ee5 build ph\u00e1t huy t\u00e1c d\u1ee5ng. Ch\u00fang t\u1ef1 \u0111\u1ed9ng h\u00f3a qu\u00e1 tr\u00ecnh t\u1ea3i th\u01b0 vi\u1ec7n, bi\u00ean d\u1ecbch m\u00e3 ngu\u1ed3n v\u00e0 t\u1ea1o ra s\u1ea3n ph\u1ea9m cu\u1ed1i c\u00f9ng (t\u1ec7p .jar ho\u1eb7c .war).<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/maven.apache.org\/download.cgi\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Maven<\/strong><\/a><strong>:<\/strong> L\u00e0 c\u00f4ng c\u1ee5 build ph\u1ed5 bi\u1ebfn nh\u1ea5t trong h\u1ec7 sinh th\u00e1i Java. N\u00f3 s\u1eed d\u1ee5ng m\u1ed9t t\u1ec7p pom.xml \u0111\u1ec3 khai b\u00e1o th\u00f4ng tin d\u1ef1 \u00e1n v\u00e0 c\u00e1c th\u01b0 vi\u1ec7n c\u1ea7n thi\u1ebft.<\/li>\n\n\n\n<li><a href=\"https:\/\/gradle.org\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Gradle<\/strong><\/a><strong>:<\/strong> L\u00e0 m\u1ed9t c\u00f4ng c\u1ee5 hi\u1ec7n \u0111\u1ea1i h\u01a1n, s\u1eed d\u1ee5ng c\u00fa ph\u00e1p linh ho\u1ea1t c\u1ee7a Groovy ho\u1eb7c Kotlin \u0111\u1ec3 vi\u1ebft k\u1ecbch b\u1ea3n build, th\u01b0\u1eddng cho hi\u1ec7u n\u0103ng t\u1ed1t h\u01a1n v\u00e0 d\u1ec5 t\u00f9y bi\u1ebfn h\u01a1n.<\/li>\n<\/ul>\n\n\n\n<p><strong>L\u1eddi khuy\u00ean:<\/strong> N\u1ebfu b\u1ea1n l\u00e0 ng\u01b0\u1eddi m\u1edbi b\u1eaft \u0111\u1ea7u, <strong>h\u00e3y b\u1eaft \u0111\u1ea7u v\u1edbi <\/strong><a href=\"https:\/\/maven.apache.org\/download.cgi\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Maven<\/strong><\/a>. L\u00fd do l\u00e0 h\u1ea7u h\u1ebft c\u00e1c t\u00e0i li\u1ec7u, h\u01b0\u1edbng d\u1eabn v\u00e0 c\u00e1c d\u1ef1 \u00e1n m\u00e3 ngu\u1ed3n m\u1edf tr\u00ean m\u1ea1ng \u0111\u1ec1u s\u1eed d\u1ee5ng Maven. Vi\u1ec7c n\u00e0y gi\u00fap b\u1ea1n d\u1ec5 d\u00e0ng t\u00ecm ki\u1ebfm s\u1ef1 gi\u00fap \u0111\u1ee1 v\u00e0 l\u00e0m theo c\u00e1c v\u00ed d\u1ee5 h\u01a1n. Khi \u0111\u00e3 th\u00e0nh th\u1ea1o, vi\u1ec7c chuy\u1ec3n qua Gradle s\u1ebd kh\u00f4ng qu\u00e1 kh\u00f3 kh\u0103n.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-ki\u1ebfn-th\u1ee9c-web-c\u01a1-b\u1ea3n-ngon-ng\u1eef-chung-c\u1ee7a-internet\"><strong>Ki\u1ebfn th\u1ee9c Web c\u01a1 b\u1ea3n: Ng\u00f4n ng\u1eef chung c\u1ee7a Internet<\/strong><\/h3>\n\n\n\n<p>V\u00ec Spring Boot \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng ch\u1ee7 y\u1ebfu \u0111\u1ec3 x\u00e2y d\u1ef1ng \u1ee9ng d\u1ee5ng web v\u00e0 API, b\u1ea1n kh\u00f4ng th\u1ec3 kh\u00f4ng bi\u1ebft nh\u1eefng kh\u00e1i ni\u1ec7m n\u1ec1n t\u1ea3ng c\u1ee7a web:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Giao th\u1ee9c HTTP:<\/strong> Hi\u1ec3u r\u00f5 b\u1ea3n ch\u1ea5t c\u1ee7a giao th\u1ee9c client-server n\u00e0y. Quan tr\u1ecdng nh\u1ea5t l\u00e0 n\u1eafm \u0111\u01b0\u1ee3c \u00fd ngh\u0129a v\u00e0 c\u00e1ch s\u1eed d\u1ee5ng c\u1ee7a c\u00e1c ph\u01b0\u01a1ng th\u1ee9c (HTTP Methods) ph\u1ed5 bi\u1ebfn:\n<ul class=\"wp-block-list\">\n<li>GET: Y\u00eau c\u1ea7u l\u1ea5y d\u1eef li\u1ec7u.<\/li>\n\n\n\n<li>POST: G\u1eedi d\u1eef li\u1ec7u \u0111\u1ec3 t\u1ea1o m\u1edbi m\u1ed9t t\u00e0i nguy\u00ean.<\/li>\n\n\n\n<li>PUT: G\u1eedi d\u1eef li\u1ec7u \u0111\u1ec3 c\u1eadp nh\u1eadt\/thay th\u1ebf to\u00e0n b\u1ed9 m\u1ed9t t\u00e0i nguy\u00ean.<\/li>\n\n\n\n<li>DELETE: Y\u00eau c\u1ea7u x\u00f3a m\u1ed9t t\u00e0i nguy\u00ean.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>JSON (JavaScript Object Notation):<\/strong> \u0110\u00e2y l\u00e0 \u0111\u1ecbnh d\u1ea1ng trao \u0111\u1ed5i d\u1eef li\u1ec7u ph\u1ed5 bi\u1ebfn nh\u1ea5t hi\u1ec7n nay, thay th\u1ebf ph\u1ea7n l\u1edbn cho XML trong c\u00e1c \u1ee9ng d\u1ee5ng web hi\u1ec7n \u0111\u1ea1i. H\u00e3y h\u1ecdc c\u00e1ch \u0111\u1ecdc, hi\u1ec3u v\u00e0 t\u1ea1o ra c\u1ea5u tr\u00fac d\u1eef li\u1ec7u d\u1ea1ng JSON.<\/li>\n\n\n\n<li><strong>Kh\u00e1i ni\u1ec7m v\u1ec1 RESTful APIs:<\/strong> REST (Representational State Transfer) l\u00e0 m\u1ed9t ki\u1ec3u ki\u1ebfn tr\u00fac \u0111\u1ec3 thi\u1ebft k\u1ebf c\u00e1c API. Hi\u1ec3u \u0111\u01b0\u1ee3c c\u00e1c nguy\u00ean t\u1eafc c\u1ee7a RESTful s\u1ebd gi\u00fap b\u1ea1n thi\u1ebft k\u1ebf c\u00e1c API s\u1ea1ch s\u1ebd, logic v\u00e0 d\u1ec5 hi\u1ec3u, \u0111i\u1ec1u m\u00e0 b\u1ea1n s\u1ebd l\u00e0m r\u1ea5t th\u01b0\u1eddng xuy\u00ean v\u1edbi Spring Boot.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-qu\u1ea3n-ly-ma-ngu\u1ed3n-v\u1edbi-git\"><strong>Qu\u1ea3n l\u00fd m\u00e3 ngu\u1ed3n v\u1edbi Git<\/strong><\/h3>\n\n\n\n<p>Trong th\u1ebf gi\u1edbi l\u1eadp tr\u00ecnh chuy\u00ean nghi\u1ec7p, Git kh\u00f4ng ph\u1ea3i l\u00e0 m\u1ed9t l\u1ef1a ch\u1ecdn, m\u00e0 l\u00e0 <strong>b\u1eaft bu\u1ed9c<\/strong>. \u0110\u00e2y l\u00e0 h\u1ec7 th\u1ed1ng qu\u1ea3n l\u00fd phi\u00ean b\u1ea3n ph\u00e2n t\u00e1n gi\u00fap b\u1ea1n:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Theo d\u00f5i m\u1ecdi thay \u0111\u1ed5i trong m\u00e3 ngu\u1ed3n.<\/li>\n\n\n\n<li>Quay l\u1ea1i c\u00e1c phi\u00ean b\u1ea3n c\u0169 m\u1ed9t c\u00e1ch an to\u00e0n khi c\u00f3 l\u1ed7i.<\/li>\n\n\n\n<li>L\u00e0m vi\u1ec7c nh\u00f3m m\u1ed9t c\u00e1ch hi\u1ec7u qu\u1ea3 th\u00f4ng qua c\u00e1c nh\u00e1nh (branch).<\/li>\n\n\n\n<li>L\u01b0u tr\u1eef code c\u1ee7a b\u1ea1n tr\u00ean c\u00e1c n\u1ec1n t\u1ea3ng nh\u01b0 GitHub, GitLab.<\/li>\n<\/ul>\n\n\n\n<p>B\u1ea1n n\u00ean hi\u1ec3u v\u00e0 d\u00f9ng \u0111\u01b0\u1ee3c th\u00e0nh th\u1ea1o c\u00e1c l\u1ec7nh c\u01a1 b\u1ea3n nh\u01b0 git clone, git add, git commit, git push, <a href=\"https:\/\/itviec.com\/blog\/git-pull-la-gi\/\" target=\"_blank\" rel=\"noreferrer noopener\">git pull<\/a>, <a href=\"https:\/\/itviec.com\/blog\/git-rebase-la-gi\/\" target=\"_blank\" rel=\"noreferrer noopener\">git rebase<\/a> v\u00e0 hi\u1ec3u c\u00e1ch l\u00e0m vi\u1ec7c v\u1edbi c\u00e1c nh\u00e1nh.&nbsp;<\/p>\n\n\n\n<p>T\u00e0i li\u1ec7u tham kh\u1ea3o v\u1ec1 Git tr\u00ean ITviec:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/itviec.com\/blog\/cac-lenh-git-co-ban\/\" target=\"_blank\" rel=\"noreferrer noopener\">T\u1ed5ng h\u1ee3p 20+ c\u00e1c l\u1ec7nh Git c\u01a1 b\u1ea3n c\u1ea7n bi\u1ebft<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/itviec.com\/blog\/ky-thuat-git-nang-cao\/\" target=\"_blank\" rel=\"noreferrer noopener\">Top 10+ k\u1ef9 thu\u1eadt Git n\u00e2ng cao<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/itviec.com\/blog\/lo-trinh-hoc-git\/\" target=\"_blank\" rel=\"noreferrer noopener\">L\u1ed9 tr\u00ecnh h\u1ecdc Git chi ti\u1ebft t\u1eeb C\u01a1 b\u1ea3n \u0111\u1ebfn N\u00e2ng cao<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/itviec.com\/blog\/cau-hoi-phong-van-git\/\" target=\"_blank\" rel=\"noreferrer noopener\">Top 30+ c\u00e2u h\u1ecfi ph\u1ecfng v\u1ea5n Git t\u1eeb c\u01a1 b\u1ea3n \u0111\u1ebfn n\u00e2ng cao<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-giai-do\u1ea1n-2-tim-hi\u1ec3u-spring-boot-core\"><span class=\"ez-toc-section\" id=\"Giai_doan_2_Tim_hieu_Spring_Boot_Core\"><\/span><strong>Giai \u0111o\u1ea1n 2: T\u00ecm hi\u1ec3u Spring Boot Core<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u0110\u00e2y l\u00e0 l\u00fac ch\u00fang ta th\u1ef1c s\u1ef1 b\u01b0\u1edbc v\u00e0o th\u1ebf gi\u1edbi c\u1ee7a Spring. \u1ede giai \u0111o\u1ea1n n\u00e0y, m\u1ee5c ti\u00eau kh\u00f4ng ph\u1ea3i l\u00e0 x\u00e2y d\u1ef1ng m\u1ed9t \u1ee9ng d\u1ee5ng ph\u1ee9c t\u1ea1p, m\u00e0 l\u00e0 \u0111\u1ec3 hi\u1ec3u r\u00f5 b\u1ea3n ch\u1ea5t v\u00e0 c\u00e1c c\u01a1 ch\u1ebf c\u1ed1t l\u00f5i gi\u00fap Spring Boot tr\u1edf n\u00ean m\u1ea1nh m\u1ebd v\u00e0 ti\u1ec7n l\u1ee3i.<\/p>\n\n\n\n<p>\u0110\u00e2y l\u00e0 giai \u0111o\u1ea1n quan tr\u1ecdng nh\u1ea5t, quy\u1ebft \u0111\u1ecbnh vi\u1ec7c b\u1ea1n s\u1ebd s\u1eed d\u1ee5ng Spring Boot nh\u01b0 m\u1ed9t &#8220;ph\u00e1p s\u01b0&#8221; hay ch\u1ec9 l\u00e0 m\u1ed9t ng\u01b0\u1eddi &#8220;d\u00f9ng tool&#8221; \u0111\u01a1n thu\u1ea7n.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><em>\u0110\u1ecdc chi ti\u1ebft: <a href=\"https:\/\/itviec.com\/blog\/spring-boot-la-gi\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Spring Boot l\u00e0 g\u00ec: Chi ti\u1ebft c\u00e1ch x\u00e2y d\u1ef1ng \u1ee9ng d\u1ee5ng v\u1edbi Spring Boot<\/strong><\/a><\/em><\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-ioc-va-dependency-injection-hai-khai-ni\u1ec7m-r\u1ea5t-quan-tr\u1ecdng-c\u1ee7a-spring\"><strong>IoC v\u00e0 Dependency Injection &#8211; Hai kh\u00e1i ni\u1ec7m r\u1ea5t quan tr\u1ecdng c\u1ee7a Spring<\/strong><\/h3>\n\n\n\n<p>Tr\u01b0\u1edbc khi c\u00f3 Spring Boot, ch\u00fang ta c\u00f3 Spring Framework. V\u00e0 hai kh\u00e1i ni\u1ec7m \u0111\u00e3 l\u00e0m n\u00ean cu\u1ed9c c\u00e1ch m\u1ea1ng c\u1ee7a Spring ch\u00ednh l\u00e0 Inversion of Control (IoC) v\u00e0 Dependency Injection (DI):<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Inversion of Control (IoC) :<\/strong> H\u00e3y t\u01b0\u1edfng t\u01b0\u1ee3ng theo c\u00e1ch truy\u1ec1n th\u1ed1ng, khi m\u1ed9t \u0111\u1ed1i t\u01b0\u1ee3ng A c\u1ea7n m\u1ed9t \u0111\u1ed1i t\u01b0\u1ee3ng B, ch\u00ednh A s\u1ebd ph\u1ea3i t\u1ef1 t\u1ea1o ra B (v\u00ed d\u1ee5: B b = new B();). Trong m\u00f4 h\u00ecnh n\u00e0y, A ki\u1ec3m so\u00e1t v\u00f2ng \u0111\u1eddi c\u1ee7a B. IoC \u0111\u00e3 \u0111\u1ea3o ng\u01b0\u1ee3c l\u1ea1i quy tr\u00ecnh n\u00e0y. Thay v\u00ec b\u1ea1n t\u1ef1 t\u1ea1o v\u00e0 qu\u1ea3n l\u00fd c\u00e1c \u0111\u1ed1i t\u01b0\u1ee3ng, b\u1ea1n giao l\u1ea1i quy\u1ec1n \u0111\u00f3 cho m\u1ed9t b\u00ean th\u1ee9 ba &#8211; ch\u00ednh l\u00e0 Spring Container. B\u1ea1n ch\u1ec9 c\u1ea7n khai b\u00e1o &#8220;t\u00f4i c\u1ea7n c\u00e1i n\u00e0y&#8221;, v\u00e0 Spring s\u1ebd t\u1ea1o ra v\u00e0 cung c\u1ea5p n\u00f3 cho b\u1ea1n. \u0110i\u1ec1u n\u00e0y gi\u00fap c\u00e1c th\u00e0nh ph\u1ea7n trong \u1ee9ng d\u1ee5ng tr\u1edf n\u00ean \u0111\u1ed9c l\u1eadp v\u00e0 \u00edt b\u1ecb r\u00e0ng bu\u1ed9c v\u1edbi nhau (loose coupling).<\/li>\n\n\n\n<li><strong>Dependency Injection (DI):<\/strong> DI ch\u00ednh l\u00e0 k\u1ef9 thu\u1eadt c\u1ee5 th\u1ec3 \u0111\u1ec3 th\u1ef1c hi\u1ec7n IoC. N\u00f3 l\u00e0 h\u00e0nh \u0111\u1ed9ng m\u00e0 Spring Container &#8220;ti\u00eam&#8221; (inject) c\u00e1c \u0111\u1ed1i t\u01b0\u1ee3ng ph\u1ee5 thu\u1ed9c (dependencies) v\u00e0o m\u1ed9t \u0111\u1ed1i t\u01b0\u1ee3ng kh\u00e1c. V\u00ed d\u1ee5, thay v\u00ec l\u1edbp OrderService t\u1ef1 t\u1ea1o ra PaymentRepository, Spring Container s\u1ebd t\u1ea1o m\u1ed9t instance c\u1ee7a PaymentRepository v\u00e0 &#8220;ti\u00eam&#8221; n\u00f3 v\u00e0o OrderService th\u00f4ng qua constructor, setter, ho\u1eb7c field. Annotation @Autowired ch\u00ednh l\u00e0 m\u1ed9t c\u00e1ch ph\u1ed5 bi\u1ebfn \u0111\u1ec3 y\u00eau c\u1ea7u Spring th\u1ef1c hi\u1ec7n vi\u1ec7c &#8220;ti\u00eam&#8221; n\u00e0y.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-spring-ioc-container-trung-tam-x\u1eed-ly-c\u1ee7a-m\u1ecdi-\u1ee9ng-d\u1ee5ng-spring\"><strong>Spring IoC Container &#8211; Trung t\u00e2m x\u1eed l\u00fd c\u1ee7a m\u1ecdi \u1ee9ng d\u1ee5ng Spring<\/strong><\/h3>\n\n\n\n<p>IoC Container l\u00e0 m\u1ed9t &#8220;nh\u00e0 m\u00e1y&#8221; ch\u1ecbu tr\u00e1ch nhi\u1ec7m t\u1ea1o ra c\u00e1c \u0111\u1ed1i t\u01b0\u1ee3ng, g\u1eafn k\u1ebft ch\u00fang l\u1ea1i v\u1edbi nhau, c\u1ea5u h\u00ecnh v\u00e0 qu\u1ea3n l\u00fd to\u00e0n b\u1ed9 v\u00f2ng \u0111\u1eddi c\u1ee7a ch\u00fang. C\u00e1c \u0111\u1ed1i t\u01b0\u1ee3ng \u0111\u01b0\u1ee3c qu\u1ea3n l\u00fd b\u1edfi Container \u0111\u01b0\u1ee3c g\u1ecdi l\u00e0 <strong>Spring Beans<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"640\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/07\/image-33.png\" alt=\"\" class=\"wp-image-89348\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/07\/image-33.png 800w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/07\/image-33-300x240.png 300w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/07\/image-33-640x512.png 640w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/07\/image-33-200x160.png 200w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/07\/image-33-768x614.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>BeanFactory<\/strong>: L\u00e0 giao di\u1ec7n IoC Container c\u01a1 b\u1ea3n nh\u1ea5t, cung c\u1ea5p c\u00e1c ch\u1ee9c n\u0103ng c\u1ed1t l\u00f5i c\u1ee7a vi\u1ec7c qu\u1ea3n l\u00fd bean.<\/li>\n\n\n\n<li><strong>ApplicationContext<\/strong>: L\u00e0 m\u1ed9t giao di\u1ec7n k\u1ebf th\u1eeba t\u1eeb BeanFactory, cung c\u1ea5p nhi\u1ec1u t\u00ednh n\u0103ng n\u00e2ng cao h\u01a1n nh\u01b0 t\u00edch h\u1ee3p v\u1edbi c\u00e1c t\u00ednh n\u0103ng AOP c\u1ee7a Spring, x\u1eed l\u00fd s\u1ef1 ki\u1ec7n, qu\u1ea3n l\u00fd resource&#8230; Trong h\u1ea7u h\u1ebft c\u00e1c \u1ee9ng d\u1ee5ng Spring Boot, b\u1ea1n s\u1ebd l\u00e0m vi\u1ec7c v\u1edbi ApplicationContext.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-cac-ch\u1ee7-d\u1ec1-spring-boot-c\u01a1-b\u1ea3n\"><strong>C\u00e1c ch\u1ee7 \u0111\u1ec1 Spring Boot c\u01a1 b\u1ea3n<\/strong><\/h3>\n\n\n\n<p>Spring Boot k\u1ebf th\u1eeba to\u00e0n b\u1ed9 s\u1ee9c m\u1ea1nh c\u1ee7a Spring Framework, nh\u01b0ng \u0111\u00e3 lo\u1ea1i b\u1ecf ph\u1ea7n l\u1edbn s\u1ef1 ph\u1ee9c t\u1ea1p trong vi\u1ec7c c\u1ea5u h\u00ecnh v\u00e0 thi\u1ebft l\u1eadp ban \u0111\u1ea7u. Thay v\u00ec b\u1eaft b\u1ea1n ph\u1ea3i c\u1ea5u h\u00ecnh m\u1ecdi th\u1ee9, n\u00f3 \u0111\u01b0a ra c\u00e1c c\u01a1 ch\u1ebf t\u1ef1 \u0111\u1ed9ng th\u00f4ng minh \u0111\u1ec3 b\u1ea1n c\u00f3 th\u1ec3 b\u1eaft \u0111\u1ea7u m\u1ed9t d\u1ef1 \u00e1n ch\u1ec9 trong v\u00e0i ph\u00fat.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><em>\u0110\u1ecdc chi ti\u1ebft: <a href=\"https:\/\/itviec.com\/blog\/huong-dan-spring-boot-tutorial\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Spring Boot tutorial chi ti\u1ebft t\u1eeb A-Z cho l\u1eadp tr\u00ecnh vi\u00ean Java<\/strong><\/a><\/em><\/p>\n<\/blockquote>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-c\u1ea5u-truc-d\u1ef1-an-spring-boot\"><strong>C\u1ea5u tr\u00fac d\u1ef1 \u00e1n Spring Boot<\/strong><\/h4>\n\n\n\n<p>M\u1ed9t d\u1ef1 \u00e1n Spring Boot \u0111i\u1ec3n h\u00ecnh (s\u1eed d\u1ee5ng Maven) c\u00f3 c\u1ea5u tr\u00fac th\u01b0 m\u1ee5c chu\u1ea9n nh\u01b0 sau:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>src\/main\/java<\/strong> cho m\u00e3 ngu\u1ed3n Java&nbsp;<\/li>\n\n\n\n<li><strong>src\/main\/resources <\/strong>cho c\u00e1c t\u1ec7p c\u1ea5u h\u00ecnh (application.properties) v\u00e0 t\u00e0i nguy\u00ean kh\u00e1c<\/li>\n\n\n\n<li><strong>T\u1ec7p <\/strong><strong>pom.xml<\/strong> l\u00e0 n\u01a1i b\u1ea1n \u0111\u1ecbnh ngh\u0129a c\u00e1c &#8220;starter&#8221; c\u1ee7a m\u00ecnh.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-t\u1ef1-d\u1ed9ng-c\u1ea5u-hinh-auto-configuration-va-starter-dependencies\"><strong>T\u1ef1 \u0111\u1ed9ng c\u1ea5u h\u00ecnh (Auto-configuration) v\u00e0 Starter Dependencies<\/strong><\/h4>\n\n\n\n<p>Spring Boot cung c\u1ea5p hai t\u00ednh n\u0103ng c\u1ed1t l\u00f5i gi\u00fap \u0111\u01a1n gi\u1ea3n h\u00f3a qu\u00e1 tr\u00ecnh ph\u00e1t tri\u1ec3n:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Starter Dependencies:<\/strong> Thay v\u00ec ph\u1ea3i li\u1ec7t k\u00ea h\u00e0ng ch\u1ee5c th\u01b0 vi\u1ec7n c\u1ea7n thi\u1ebft cho m\u1ed9t t\u00ednh n\u0103ng, b\u1ea1n ch\u1ec9 c\u1ea7n khai b\u00e1o m\u1ed9t &#8220;starter&#8221;. V\u00ed d\u1ee5, ch\u1ec9 c\u1ea7n th\u00eam spring-boot-starter-web, b\u1ea1n \u0111\u00e3 c\u00f3 \u0111\u1ee7 m\u1ecdi th\u1ee9 cho vi\u1ec7c x\u00e2y d\u1ef1ng \u1ee9ng d\u1ee5ng web: Spring MVC, m\u1ed9t server Tomcat nh\u00fang, th\u01b0 vi\u1ec7n x\u1eed l\u00fd JSON (Jackson)&#8230;<\/li>\n\n\n\n<li><strong>Auto-configuration:<\/strong> D\u1ef1a v\u00e0o c\u00e1c &#8220;starter&#8221; m\u00e0 b\u1ea1n \u0111\u00e3 th\u00eam v\u00e0o classpath, Spring Boot s\u1ebd t\u1ef1 \u0111\u1ed9ng &#8220;\u0111o\u00e1n&#8221; v\u00e0 c\u1ea5u h\u00ecnh \u1ee9ng d\u1ee5ng cho b\u1ea1n. N\u1ebfu n\u00f3 th\u1ea5y starter-web, n\u00f3 s\u1ebd t\u1ef1 \u0111\u1ed9ng c\u1ea5u h\u00ecnh Tomcat v\u00e0 DispatcherServlet. N\u1ebfu th\u1ea5y starter-data-jpa v\u00e0 m\u1ed9t th\u01b0 vi\u1ec7n database nh\u01b0 H2, n\u00f3 s\u1ebd t\u1ef1 \u0111\u1ed9ng c\u1ea5u h\u00ecnh m\u1ed9t DataSource.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-annotations\"><strong>Annotations<\/strong><\/h4>\n\n\n\n<p>Annotations l\u00e0 c\u00e1ch ch\u00ednh \u0111\u1ec3 b\u1ea1n giao ti\u1ebfp v\u00e0 ra l\u1ec7nh cho Spring Boot. M\u1ed9t s\u1ed1 annotation quan tr\u1ecdng trong Spring Boot:<\/p>\n\n\n\n<p><strong>1. @SpringBootApplication: <\/strong>\u0110\u00e2y l\u00e0 annotation quan tr\u1ecdng nh\u1ea5t, \u0111\u1eb7t \u1edf class ch\u00ednh, n\u00f3 b\u00e1o hi\u1ec7u \u0111\u00e2y l\u00e0 m\u1ed9t \u1ee9ng d\u1ee5ng Spring Boot v\u00e0 k\u00edch ho\u1ea1t c\u01a1 ch\u1ebf t\u1ef1 \u0111\u1ed9ng c\u1ea5u h\u00ecnh. N\u00f3 l\u00e0 s\u1ef1 k\u1ebft h\u1ee3p c\u1ee7a @Configuration, @EnableAutoConfiguration v\u00e0 @ComponentScan.<\/p>\n\n\n\n<p><strong>2. Stereotype Annotations &#8211; <\/strong>D\u00f9ng \u0111\u1ec3 \u0111\u00e1nh d\u1ea5u vai tr\u00f2 c\u1ee7a m\u1ed9t l\u1edbp v\u00e0 bi\u1ebfn n\u00f3 th\u00e0nh m\u1ed9t Spring Bean:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>@Component: Annotation g\u1ed1c, \u0111\u00e1nh d\u1ea5u m\u1ed9t l\u1edbp l\u00e0 bean.<\/li>\n\n\n\n<li>@Controller \/ @RestController: \u0110\u00e1nh d\u1ea5u l\u1edbp \u1edf t\u1ea7ng web, ch\u1ecbu tr\u00e1ch nhi\u1ec7m x\u1eed l\u00fd request.<\/li>\n\n\n\n<li>@Service: \u0110\u00e1nh d\u1ea5u l\u1edbp \u1edf t\u1ea7ng business logic.<\/li>\n\n\n\n<li>@Repository: \u0110\u00e1nh d\u1ea5u l\u1edbp \u1edf t\u1ea7ng truy c\u1eadp d\u1eef li\u1ec7u (Data Access Layer).<\/li>\n<\/ul>\n\n\n\n<p><strong>3. Injection Annotations:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>@Autowired: Y\u00eau c\u1ea7u Spring t\u1ef1 \u0111\u1ed9ng ti\u00eam m\u1ed9t dependency.<\/li>\n\n\n\n<li>@Qualifier: D\u00f9ng k\u1ebft h\u1ee3p v\u1edbi @Autowired \u0111\u1ec3 ch\u1ec9 \u0111\u1ecbnh r\u00f5 bean n\u00e0o c\u1ea7n ti\u00eam khi c\u00f3 nhi\u1ec1u bean c\u00f9ng ki\u1ec3u.<\/li>\n\n\n\n<li>@Value: Ti\u00eam gi\u00e1 tr\u1ecb t\u1eeb file c\u1ea5u h\u00ecnh (v\u00ed d\u1ee5: application.properties).<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-profile\"><strong>Profile<\/strong><\/h4>\n\n\n\n<p>M\u1ed9t t\u00ednh n\u0103ng c\u1ef1c k\u1ef3 h\u1eefu \u00edch cho ph\u00e9p b\u1ea1n \u0111\u1ecbnh ngh\u0129a c\u00e1c c\u1ea5u h\u00ecnh kh\u00e1c nhau cho c\u00e1c m\u00f4i tr\u01b0\u1eddng kh\u00e1c nhau (development, testing, production). B\u1ea1n c\u00f3 th\u1ec3 t\u1ea1o c\u00e1c file application-dev.properties, application-prod.properties v\u00e0 k\u00edch ho\u1ea1t profile t\u01b0\u01a1ng \u1ee9ng khi ch\u1ea1y \u1ee9ng d\u1ee5ng.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-logging-slf4j-logback\"><strong>Logging (SLF4J, Logback)<\/strong><\/h4>\n\n\n\n<p>Spring Boot m\u1eb7c \u0111\u1ecbnh s\u1eed d\u1ee5ng Logback (th\u00f4ng qua giao di\u1ec7n SLF4J) \u0111\u1ec3 ghi log. Vi\u1ec7c ghi log m\u1ed9t c\u00e1ch c\u00f3 h\u1ec7 th\u1ed1ng l\u00e0 k\u1ef9 n\u0103ng t\u1ed1i quan tr\u1ecdng \u0111\u1ec3 theo d\u00f5i ho\u1ea1t \u0111\u1ed9ng c\u1ee7a \u1ee9ng d\u1ee5ng v\u00e0 t\u00ecm l\u1ed7i khi s\u1ef1 c\u1ed1 x\u1ea3y ra.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-command-line-runner-va-application-runner\"><strong>Command Line Runner v\u00e0 Application Runner<\/strong><\/h4>\n\n\n\n<p>L\u00e0 c\u00e1c interface cho ph\u00e9p b\u1ea1n th\u1ef1c thi m\u1ed9t \u0111o\u1ea1n m\u00e3 ngay sau khi \u1ee9ng d\u1ee5ng Spring Boot \u0111\u00e3 kh\u1edfi \u0111\u1ed9ng xong ho\u00e0n to\u00e0n. R\u1ea5t h\u1eefu \u00edch cho c\u00e1c t\u00e1c v\u1ee5 kh\u1edfi t\u1ea1o d\u1eef li\u1ec7u ban \u0111\u1ea7u.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-ki\u1ebfn-th\u1ee9c-restful-api\"><strong>Ki\u1ebfn th\u1ee9c RESTful API<\/strong><\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-nguyen-t\u1eafc-rest-va-http-methods\"><strong>Nguy\u00ean t\u1eafc REST v\u00e0 HTTP Methods<\/strong><\/h4>\n\n\n\n<p>Giai \u0111o\u1ea1n n\u00e0y c\u1ee7ng c\u1ed1 l\u1ea1i ki\u1ebfn th\u1ee9c t\u1eeb giai \u0111o\u1ea1n 1. REST l\u00e0 m\u1ed9t ki\u1ec3u ki\u1ebfn tr\u00fac, kh\u00f4ng ph\u1ea3i l\u00e0 m\u1ed9t ti\u00eau chu\u1ea9n c\u1ee9ng nh\u1eafc. N\u00f3 d\u1ef1a tr\u00ean vi\u1ec7c s\u1eed d\u1ee5ng c\u00e1c ph\u01b0\u01a1ng th\u1ee9c HTTP (<code>GET<\/code>, <code>POST<\/code>, <code>PUT<\/code>, <code>DELETE<\/code>) m\u1ed9t c\u00e1ch \u0111\u00fang v\u1edbi ng\u1eef ngh\u0129a c\u1ee7a ch\u00fang \u0111\u1ec3 thao t\u00e1c tr\u00ean c\u00e1c &#8220;t\u00e0i nguy\u00ean&#8221; (resources).<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-xay-d\u1ef1ng-controller-va-x\u1eed-ly-request-response\"><strong>X\u00e2y d\u1ef1ng Controller v\u00e0 x\u1eed l\u00fd request\/response<\/strong><\/h4>\n\n\n\n<p>V\u1ec1 m\u1eb7t l\u00fd thuy\u1ebft, m\u1ed9t @RestController trong Spring Boot l\u00e0 m\u1ed9t l\u1edbp chuy\u00ean l\u1eafng nghe c\u00e1c HTTP request. C\u00e1c ph\u01b0\u01a1ng th\u1ee9c b\u00ean trong n\u00f3 \u0111\u01b0\u1ee3c \u00e1nh x\u1ea1 v\u1edbi c\u00e1c URL v\u00e0 HTTP method c\u1ee5 th\u1ec3 (v\u00ed d\u1ee5 <code>@GetMapping(\"\/users\")<\/code>). Khi m\u1ed9t request t\u1edbi, Spring s\u1ebd g\u1ecdi ph\u01b0\u01a1ng th\u1ee9c t\u01b0\u01a1ng \u1ee9ng.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-json-serialization-deserialization-jackson\"><strong>JSON Serialization\/Deserialization (Jackson)<\/strong><\/h4>\n\n\n\n<p>Khi m\u1ed9t ph\u01b0\u01a1ng th\u1ee9c trong RestController tr\u1ea3 v\u1ec1 m\u1ed9t \u0111\u1ed1i t\u01b0\u1ee3ng Java (POJO), Spring Boot s\u1ebd t\u1ef1 \u0111\u1ed9ng d\u00f9ng th\u01b0 vi\u1ec7n Jackson \u0111\u1ec3 chuy\u1ec3n \u0111\u1ed5i (serialize) \u0111\u1ed1i t\u01b0\u1ee3ng \u0111\u00f3 th\u00e0nh m\u1ed9t chu\u1ed7i JSON v\u00e0 g\u1eedi v\u1ec1 cho client.<\/p>\n\n\n\n<p>Ng\u01b0\u1ee3c l\u1ea1i, khi client g\u1eedi m\u1ed9t body ch\u1ee9a JSON trong request (v\u00ed d\u1ee5 v\u1edbi <code>POST<\/code>), Jackson s\u1ebd t\u1ef1 \u0111\u1ed9ng chuy\u1ec3n \u0111\u1ed5i (deserialize) chu\u1ed7i JSON \u0111\u00f3 th\u00e0nh m\u1ed9t \u0111\u1ed1i t\u01b0\u1ee3ng Java \u0111\u1ec3 ph\u01b0\u01a1ng th\u1ee9c c\u1ee7a b\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng. Qu\u00e1 tr\u00ecnh n\u00e0y di\u1ec5n ra g\u1ea7n nh\u01b0 trong su\u1ed1t, gi\u00fap b\u1ea1n t\u1eadp trung ho\u00e0n to\u00e0n v\u00e0o logic nghi\u1ec7p v\u1ee5.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-giai-do\u1ea1n-3-t\u01b0\u01a1ng-tac-v\u1edbi-c\u01a1-s\u1edf-d\u1eef-li\u1ec7u-va-b\u1ea3o-m\u1eadt\"><span class=\"ez-toc-section\" id=\"Giai_doan_3_Tuong_tac_voi_Co_so_du_lieu_va_bao_mat\"><\/span><strong>Giai \u0111o\u1ea1n 3: T\u01b0\u01a1ng t\u00e1c v\u1edbi C\u01a1 s\u1edf d\u1eef li\u1ec7u v\u00e0 b\u1ea3o m\u1eadt<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Khi \u1ee9ng d\u1ee5ng c\u1ee7a b\u1ea1n c\u1ea7n l\u01b0u tr\u1eef d\u1eef li\u1ec7u l\u00e2u d\u00e0i v\u00e0 ki\u1ec3m so\u00e1t quy\u1ec1n truy c\u1eadp, \u0111\u00e2y l\u00e0 l\u00fac b\u1ea1n ph\u1ea3i l\u00e0m vi\u1ec7c v\u1edbi c\u01a1 s\u1edf d\u1eef li\u1ec7u v\u00e0 c\u00e1c c\u01a1 ch\u1ebf b\u1ea3o m\u1eadt. Giai \u0111o\u1ea1n n\u00e0y s\u1ebd trang b\u1ecb cho b\u1ea1n nh\u1eefng k\u1ef9 n\u0103ng c\u1ed1t l\u00f5i \u0111\u1ec3 x\u00e2y d\u1ef1ng c\u00e1c \u1ee9ng d\u1ee5ng c\u00f3 kh\u1ea3 n\u0103ng l\u01b0u tr\u1eef v\u00e0 an to\u00e0n.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-truy-c\u1eadp-d\u1eef-li\u1ec7u-data-access-giao-ti\u1ebfp-v\u1edbi-b\u1ed9-nao-c\u1ee7a-\u1ee9ng-d\u1ee5ng\"><strong>Truy c\u1eadp d\u1eef li\u1ec7u (Data access): Giao ti\u1ebfp v\u1edbi &#8220;b\u1ed9 n\u00e3o&#8221; c\u1ee7a \u1ee9ng d\u1ee5ng<\/strong><\/h3>\n\n\n\n<p>D\u1eef li\u1ec7u l\u00e0 \u201clinh h\u1ed3n\u201d c\u1ee7a h\u1ea7u h\u1ebft c\u00e1c \u1ee9ng d\u1ee5ng. Spring Boot cung c\u1ea5p nhi\u1ec1u c\u00e1ch m\u1ea1nh m\u1ebd v\u00e0 ti\u1ec7n l\u1ee3i \u0111\u1ec3 t\u01b0\u01a1ng t\u00e1c v\u1edbi c\u01a1 s\u1edf d\u1eef li\u1ec7u.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-jdbc-template\"><a href=\"https:\/\/www.baeldung.com\/spring-jdbc-jdbctemplate\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>JDBC Template<\/strong><\/a><\/h4>\n\n\n\n<p>Tr\u01b0\u1edbc khi c\u00f3 c\u00e1c c\u00f4ng c\u1ee5 ORM hi\u1ec7n \u0111\u1ea1i, l\u1eadp tr\u00ecnh vi\u00ean ph\u1ea3i l\u00e0m vi\u1ec7c v\u1edbi JDBC (Java Database Connectivity) kh\u00e1 v\u1ea5t v\u1ea3. Spring cung c\u1ea5p JdbcTemplate, m\u1ed9t l\u1edbp bao (wrapper) gi\u00fap \u0111\u01a1n gi\u1ea3n h\u00f3a vi\u1ec7c s\u1eed d\u1ee5ng JDBC b\u1eb1ng c\u00e1ch t\u1ef1 \u0111\u1ed9ng qu\u1ea3n l\u00fd vi\u1ec7c m\u1edf\/\u0111\u00f3ng k\u1ebft n\u1ed1i v\u00e0 x\u1eed l\u00fd c\u00e1c exception.<\/p>\n\n\n\n<p>B\u1ea1n ch\u1ec9 c\u1ea7n t\u1eadp trung v\u00e0o vi\u1ec7c vi\u1ebft c\u00e2u l\u1ec7nh SQL v\u00e0 x\u1eed l\u00fd k\u1ebft qu\u1ea3. D\u00f9 kh\u00f4ng c\u00f2n l\u00e0 l\u1ef1a ch\u1ecdn h\u00e0ng \u0111\u1ea7u cho c\u00e1c \u1ee9ng d\u1ee5ng CRUD th\u00f4ng th\u01b0\u1eddng, vi\u1ec7c bi\u1ebft v\u1ec1 JdbcTemplate v\u1eabn h\u1eefu \u00edch khi b\u1ea1n c\u1ea7n th\u1ef1c thi c\u00e1c c\u00e2u l\u1ec7nh SQL ph\u1ee9c t\u1ea1p ho\u1eb7c t\u1ed1i \u01b0u hi\u1ec7u n\u0103ng \u1edf m\u1ee9c th\u1ea5p.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-spring-data-jpa\"><a href=\"https:\/\/spring.io\/projects\/spring-data-jpa\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Spring Data JPA<\/strong><\/a><\/h4>\n\n\n\n<p>\u0110\u00e2y l\u00e0 ph\u01b0\u01a1ng ph\u00e1p \u0111\u01b0\u1ee3c khuy\u1ebfn kh\u00edch v\u00e0 s\u1eed d\u1ee5ng r\u1ed9ng r\u00e3i nh\u1ea5t hi\u1ec7n nay. Spring Data JPA l\u00e0m cho vi\u1ec7c truy c\u1eadp d\u1eef li\u1ec7u tr\u1edf n\u00ean \u0111\u01a1n gi\u1ea3n m\u1ed9t c\u00e1ch k\u1ef3 di\u1ec7u.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-khai-ni\u1ec7m-orm-va-jpa\"><strong>Kh\u00e1i ni\u1ec7m ORM v\u00e0 JPA<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>ORM (Object-Relational Mapping &#8211; \u00c1nh x\u1ea1 \u0110\u1ed1i t\u01b0\u1ee3ng-Quan h\u1ec7):<\/strong>&nbsp;<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXdtzYftTCrlogRZMcHfXRk5wP5aJMkXeyL-vlWqRbiRXAmP3uswr7ZLaDzSKYfd5-ElzkEynyWQLxVjaLMGhnKc6VNGIlW0Qv50oIDLEJPfSTDY1lGzHqT77gh2UleWBqW1jqGaDA?key=JG4oPA9AqLxhCy3Z-t8Keg\" alt=\"\"\/><\/figure>\n\n\n\n<p>L\u00e0 m\u1ed9t k\u1ef9 thu\u1eadt l\u1eadp tr\u00ecnh gi\u00fap &#8220;d\u1ecbch&#8221; gi\u1eefa th\u1ebf gi\u1edbi l\u1eadp tr\u00ecnh h\u01b0\u1edbng \u0111\u1ed1i t\u01b0\u1ee3ng (c\u00e1c class, object trong Java) v\u00e0 th\u1ebf gi\u1edbi c\u01a1 s\u1edf d\u1eef li\u1ec7u quan h\u1ec7 (c\u00e1c b\u1ea3ng, h\u00e0ng, c\u1ed9t). Thay v\u00ec ph\u1ea3i vi\u1ebft c\u00e1c c\u00e2u l\u1ec7nh SQL \u0111\u1ec3 l\u01b0u m\u1ed9t \u0111\u1ed1i t\u01b0\u1ee3ng User v\u00e0o b\u1ea3ng users, b\u1ea1n ch\u1ec9 c\u1ea7n g\u1ecdi m\u1ed9t ph\u01b0\u01a1ng th\u1ee9c nh\u01b0 userRepository.save(user). Hibernate l\u00e0 ORM framework ph\u1ed5 bi\u1ebfn nh\u1ea5t hi\u1ec7n nay.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>JPA (Java Persistence API):<\/strong>&nbsp;<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXf8uZtYplgsDuKKVy14nhNdJR1WkEWqlyHUXayQoMlzDI4MuLGEwPK-UcP9u6m1JMT5b93u8b4i8gcplI8gOkZTGbggtTEMmypOLyxEhYLEvoYDdcO_8qwJplKKyqG3MtGBkhzPAA?key=JG4oPA9AqLxhCy3Z-t8Keg\" alt=\"\"\/><\/figure>\n\n\n\n<p>L\u00e0 m\u1ed9t b\u1ed9 \u0111\u1eb7c t\u1ea3 (specification) c\u1ee7a Java, \u0111\u01b0a ra c\u00e1c quy t\u1eafc v\u00e0 giao di\u1ec7n chu\u1ea9n cho c\u00e1c framework ORM. JPA \u0111\u1ecbnh ngh\u0129a lu\u1eadt ch\u01a1i, c\u00f2n Hibernate l\u00e0 m\u1ed9t &#8220;ng\u01b0\u1eddi ch\u01a1i&#8221; tu\u00e2n th\u1ee7 lu\u1eadt \u0111\u00f3. Spring Data JPA n\u1eb1m \u1edf t\u1ea7ng cao h\u01a1n n\u1eefa, gi\u00fap vi\u1ec7c s\u1eed d\u1ee5ng JPA (v\u00e0 Hibernate) tr\u1edf n\u00ean d\u1ec5 d\u00e0ng h\u01a1n bao gi\u1edd h\u1ebft.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-entities-repositories-va-relationships\"><strong>Entities, Repositories, v\u00e0 Relationships<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Entities:<\/strong> L\u00e0 c\u00e1c l\u1edbp Java th\u00f4ng th\u01b0\u1eddng (POJO) \u0111\u01b0\u1ee3c \u00e1nh x\u1ea1 v\u1edbi m\u1ed9t b\u1ea3ng trong c\u01a1 s\u1edf d\u1eef li\u1ec7u b\u1eb1ng annotation @Entity. M\u1ed7i thu\u1ed9c t\u00ednh c\u1ee7a l\u1edbp c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c \u00e1nh x\u1ea1 v\u1edbi m\u1ed9t c\u1ed9t c\u1ee7a b\u1ea3ng.<\/li>\n\n\n\n<li><strong>Repositories:<\/strong> \u0110\u00e2y l\u00e0 &#8220;ph\u00e9p thu\u1eadt&#8221; ch\u00ednh c\u1ee7a Spring Data JPA. B\u1ea1n ch\u1ec9 c\u1ea7n t\u1ea1o m\u1ed9t interface v\u00e0 k\u1ebf th\u1eeba t\u1eeb JpaRepository. Ngay l\u1eadp t\u1ee9c, b\u1ea1n s\u1ebd c\u00f3 s\u1eb5n t\u1ea5t c\u1ea3 c\u00e1c ph\u01b0\u01a1ng th\u1ee9c CRUD (Create, Read, Update, Delete) c\u01a1 b\u1ea3n m\u00e0 kh\u00f4ng c\u1ea7n vi\u1ebft m\u1ed9t d\u00f2ng code tri\u1ec3n khai n\u00e0o.<\/li>\n\n\n\n<li><strong>Relationships:<\/strong> D\u1ec5 d\u00e0ng \u0111\u1ecbnh ngh\u0129a c\u00e1c m\u1ed1i quan h\u1ec7 gi\u1eefa c\u00e1c b\u1ea3ng (OneToOne, OneToMany, ManyToOne, ManyToMany) ngay trong c\u00e1c l\u1edbp Entity b\u1eb1ng c\u00e1c annotation t\u01b0\u01a1ng \u1ee9ng.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-hql-jpql-va-custom-queries\"><strong>HQL\/JPQL v\u00e0 Custom Queries<\/strong><\/h4>\n\n\n\n<p>Khi c\u00e1c ph\u01b0\u01a1ng th\u1ee9c c\u00f3 s\u1eb5n kh\u00f4ng \u0111\u1ee7, b\u1ea1n c\u00f3 th\u1ec3 t\u1ef1 vi\u1ebft c\u00e1c c\u00e2u truy v\u1ea5n b\u1eb1ng <strong>JPQL (JPA Query Language)<\/strong> &#8211; m\u1ed9t ng\u00f4n ng\u1eef truy v\u1ea5n h\u01b0\u1edbng \u0111\u1ed1i t\u01b0\u1ee3ng ho\u1ea1t \u0111\u1ed9ng tr\u00ean c\u00e1c Entity, ho\u1eb7c vi\u1ebft SQL thu\u1ea7n b\u1eb1ng c\u00e1ch s\u1eed d\u1ee5ng annotation @Query ngay tr\u00ean ph\u01b0\u01a1ng th\u1ee9c trong interface Repository.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-tich-h\u1ee3p-v\u1edbi-cac-lo\u1ea1i-database\"><strong>T\u00edch h\u1ee3p v\u1edbi c\u00e1c lo\u1ea1i Database<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><a href=\"https:\/\/itviec.com\/blog\/sql-la-gi\/\" target=\"_blank\" rel=\"noreferrer noopener\">SQL<\/a>:<\/strong> Spring Boot gi\u00fap vi\u1ec7c k\u1ebft n\u1ed1i t\u1edbi c\u00e1c CSDL quan h\u1ec7 nh\u01b0 <strong><a href=\"https:\/\/itviec.com\/blog\/mysql-la-gi\/\" target=\"_blank\" rel=\"noreferrer noopener\">MySQL<\/a><\/strong>, <strong>PostgreSQL<\/strong> tr\u1edf n\u00ean c\u1ef1c k\u1ef3 \u0111\u01a1n gi\u1ea3n. Ch\u1ec9 c\u1ea7n th\u00eam driver v\u00e0 khai b\u00e1o th\u00f4ng tin k\u1ebft n\u1ed1i trong file application.properties. \u0110\u1eb7c bi\u1ec7t, <strong>H2<\/strong> l\u00e0 m\u1ed9t CSDL trong b\u1ed9 nh\u1edb (in-memory database), r\u1ea5t tuy\u1ec7t v\u1eddi cho vi\u1ec7c testing v\u00e0 ph\u00e1t tri\u1ec3n nhanh m\u00e0 kh\u00f4ng c\u1ea7n c\u00e0i \u0111\u1eb7t.<\/li>\n\n\n\n<li><strong><a href=\"https:\/\/itviec.com\/blog\/nosql-la-gi\/\" target=\"_blank\" rel=\"noreferrer noopener\">NoSQL<\/a>:<\/strong> Spring Data c\u0169ng h\u1ed7 tr\u1ee3 m\u1ea1nh m\u1ebd c\u00e1c c\u01a1 s\u1edf d\u1eef li\u1ec7u NoSQL. B\u1ea1n c\u00f3 th\u1ec3 d\u1ec5 d\u00e0ng t\u00edch h\u1ee3p v\u1edbi <strong><a href=\"https:\/\/itviec.com\/blog\/mongodb-la-gi\/\" target=\"_blank\" rel=\"noreferrer noopener\">MongoDB<\/a><\/strong> (CSDL d\u1ea1ng t\u00e0i li\u1ec7u) hay <strong><a href=\"https:\/\/itviec.com\/blog\/redis-la-gi\/\" target=\"_blank\" rel=\"noreferrer noopener\">Redis<\/a><\/strong> (CSDL key-value, th\u01b0\u1eddng d\u00f9ng cho caching) th\u00f4ng qua c\u00e1c starter t\u01b0\u01a1ng \u1ee9ng.<\/li>\n<\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><em>\u0110\u1ecdc chi ti\u1ebft: <strong><a href=\"https:\/\/itviec.com\/blog\/sql-vs-nosql\/\" target=\"_blank\" rel=\"noreferrer noopener\">SQL vs NoSQL: C\u00e1ch ch\u1ecdn h\u1ec7 qu\u1ea3n tr\u1ecb c\u01a1 s\u1edf d\u1eef li\u1ec7u ph\u00f9 h\u1ee3p<\/a><\/strong><\/em><\/p>\n<\/blockquote>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-qu\u1ea3n-ly-transaction-transactional\"><strong>Qu\u1ea3n l\u00fd Transaction (@Transactional)<\/strong><\/h4>\n\n\n\n<p>\u0110\u1ec3 \u0111\u1ea3m b\u1ea3o t\u00ednh to\u00e0n v\u1eb9n d\u1eef li\u1ec7u (v\u00ed d\u1ee5: thao t\u00e1c chuy\u1ec3n ti\u1ec1n ph\u1ea3i tr\u1eeb ti\u1ec1n \u1edf t\u00e0i kho\u1ea3n A v\u00e0 c\u1ed9ng ti\u1ec1n v\u00e0o t\u00e0i kho\u1ea3n B, c\u1ea3 hai ph\u1ea3i c\u00f9ng th\u00e0nh c\u00f4ng ho\u1eb7c c\u00f9ng th\u1ea5t b\u1ea1i), Spring cung c\u1ea5p annotation @Transactional.<\/p>\n\n\n\n<p>Ch\u1ec9 c\u1ea7n th\u00eam annotation n\u00e0y v\u00e0o m\u1ed9t ph\u01b0\u01a1ng th\u1ee9c trong t\u1ea7ng Service, Spring s\u1ebd t\u1ef1 \u0111\u1ed9ng qu\u1ea3n l\u00fd transaction cho t\u1ea5t c\u1ea3 c\u00e1c thao t\u00e1c CSDL b\u00ean trong ph\u01b0\u01a1ng th\u1ee9c \u0111\u00f3.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-b\u1ea3o-m\u1eadt-security-xay-d\u1ef1ng-l\u1edbp-khien-v\u1eefng-ch\u1eafc\"><strong>B\u1ea3o m\u1eadt (Security): X\u00e2y d\u1ef1ng &#8220;l\u1edbp khi\u00ean&#8221; v\u1eefng ch\u1eafc<\/strong><\/h4>\n\n\n\n<p>B\u1ea3o m\u1eadt kh\u00f4ng ph\u1ea3i l\u00e0 m\u1ed9t t\u00ednh n\u0103ng, m\u00e0 l\u00e0 m\u1ed9t y\u00eau c\u1ea7u b\u1eaft bu\u1ed9c. <strong>Spring Security<\/strong> l\u00e0 m\u1ed9t framework m\u1ea1nh m\u1ebd v\u00e0 linh ho\u1ea1t, \u0111\u01b0\u1ee3c coi l\u00e0 ti\u00eau chu\u1ea9n \u0111\u1ec3 b\u1ea3o m\u1eadt c\u00e1c \u1ee9ng d\u1ee5ng Spring.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-cac-khai-ni\u1ec7m-c\u01a1-b\u1ea3n\"><strong>C\u00e1c kh\u00e1i ni\u1ec7m c\u01a1 b\u1ea3n<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Authentication (X\u00e1c th\u1ef1c):<\/strong> Tr\u1ea3 l\u1eddi c\u00e2u h\u1ecfi &#8220;B\u1ea1n l\u00e0 ai?&#8221;. \u0110\u00e2y l\u00e0 qu\u00e1 tr\u00ecnh ki\u1ec3m tra danh t\u00ednh c\u1ee7a ng\u01b0\u1eddi d\u00f9ng, th\u01b0\u1eddng th\u00f4ng qua username v\u00e0 password.<\/li>\n\n\n\n<li><strong>Authorization (Ph\u00e2n quy\u1ec1n):<\/strong> Tr\u1ea3 l\u1eddi c\u00e2u h\u1ecfi &#8220;B\u1ea1n \u0111\u01b0\u1ee3c l\u00e0m g\u00ec?&#8221;. Sau khi \u0111\u00e3 x\u00e1c th\u1ef1c, \u0111\u00e2y l\u00e0 qu\u00e1 tr\u00ecnh quy\u1ebft \u0111\u1ecbnh xem ng\u01b0\u1eddi d\u00f9ng \u0111\u00f3 c\u00f3 quy\u1ec1n truy c\u1eadp v\u00e0o m\u1ed9t t\u00e0i nguy\u00ean hay th\u1ef1c hi\u1ec7n m\u1ed9t h\u00e0nh \u0111\u1ed9ng c\u1ee5 th\u1ec3 hay kh\u00f4ng (v\u00ed d\u1ee5: ch\u1ec9 admin m\u1edbi \u0111\u01b0\u1ee3c v\u00e0o trang qu\u1ea3n tr\u1ecb).<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-ki\u1ebfn-truc-spring-security\"><strong>Ki\u1ebfn tr\u00fac Spring Security<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Filters v\u00e0 Security Chain:<\/strong> Spring Security ho\u1ea1t \u0111\u1ed9ng d\u1ef1a tr\u00ean m\u1ed9t chu\u1ed7i c\u00e1c b\u1ed9 l\u1ecdc (filter chain). M\u1ed7i HTTP request \u0111\u1ebfn s\u1ebd ph\u1ea3i \u0111i qua chu\u1ed7i l\u1ecdc n\u00e0y. M\u1ed7i filter c\u00f3 m\u1ed9t nhi\u1ec7m v\u1ee5 ri\u00eang, v\u00ed d\u1ee5: filter x\u1eed l\u00fd \u0111\u0103ng nh\u1eadp, filter ki\u1ec3m tra quy\u1ec1n truy c\u1eadp, filter b\u1ea3o v\u1ec7 kh\u1ecfi t\u1ea5n c\u00f4ng CSRF&#8230;<\/li>\n\n\n\n<li><strong>UserDetailsService v\u00e0 PasswordEncoder:<\/strong>\n<ul class=\"wp-block-list\">\n<li>UserDetailsService: L\u00e0 m\u1ed9t interface b\u1ea1n c\u1ea7n tri\u1ec3n khai \u0111\u1ec3 ch\u1ec9 cho Spring Security c\u00e1ch t\u00ecm th\u00f4ng tin ng\u01b0\u1eddi d\u00f9ng (th\u01b0\u1eddng l\u00e0 t\u1eeb CSDL) d\u1ef1a tr\u00ean username.<\/li>\n\n\n\n<li>PasswordEncoder: M\u1eadt kh\u1ea9u kh\u00f4ng bao gi\u1edd \u0111\u01b0\u1ee3c l\u01b0u d\u01b0\u1edbi d\u1ea1ng v\u0103n b\u1ea3n thu\u1ea7n. Interface n\u00e0y v\u00e0 c\u00e1c tri\u1ec3n khai c\u1ee7a n\u00f3 (nh\u01b0 BCryptPasswordEncoder) cung c\u1ea5p c\u01a1 ch\u1ebf \u0111\u1ec3 m\u00e3 h\u00f3a m\u1eadt kh\u1ea9u m\u1ed9t c\u00e1ch an to\u00e0n.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-cac-ph\u01b0\u01a1ng-phap-xac-th\u1ef1c-ph\u1ed5-bi\u1ebfn\"><strong>C\u00e1c ph\u01b0\u01a1ng ph\u00e1p x\u00e1c th\u1ef1c ph\u1ed5 bi\u1ebfn<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Form Login:<\/strong> Ph\u01b0\u01a1ng ph\u00e1p truy\u1ec1n th\u1ed1ng cho c\u00e1c \u1ee9ng d\u1ee5ng web c\u00f3 giao di\u1ec7n ng\u01b0\u1eddi d\u00f9ng. Spring Security s\u1ebd t\u1ef1 \u0111\u1ed9ng t\u1ea1o m\u1ed9t trang \u0111\u0103ng nh\u1eadp v\u00e0 x\u1eed l\u00fd qu\u00e1 tr\u00ecnh x\u00e1c th\u1ef1c.<\/li>\n\n\n\n<li><strong>Basic Authentication:<\/strong> M\u1ed9t ph\u01b0\u01a1ng th\u1ee9c x\u00e1c th\u1ef1c \u0111\u01a1n gi\u1ea3n c\u1ee7a HTTP, g\u1eedi username v\u00e0 password tr\u00ean header c\u1ee7a m\u1ed7i request. Th\u00edch h\u1ee3p cho c\u00e1c API \u0111\u01a1n gi\u1ea3n ho\u1eb7c c\u00e1c c\u00f4ng c\u1ee5 n\u1ed9i b\u1ed9.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-jwt-json-web-tokens-cho-rest-api\"><strong>JWT (JSON Web Tokens) cho REST API<\/strong><\/h4>\n\n\n\n<p>\u0110\u1ed1i v\u1edbi c\u00e1c REST API kh\u00f4ng tr\u1ea1ng th\u00e1i (stateless), ph\u01b0\u01a1ng ph\u00e1p x\u00e1c th\u1ef1c d\u1ef1a tr\u00ean session nh\u01b0 Form Login kh\u00f4ng c\u00f2n ph\u00f9 h\u1ee3p. <strong><a href=\"https:\/\/itviec.com\/blog\/json-web-token-la-gi\/\" target=\"_blank\" rel=\"noreferrer noopener\">JSON Web Token<\/a><\/strong> (JWT) ch\u00ednh l\u00e0 gi\u1ea3i ph\u00e1p hi\u1ec7n \u0111\u1ea1i.<\/p>\n\n\n\n<p>JWT l\u00e0 m\u1ed9t chu\u1ed7i k\u00fd t\u1ef1 \u0111\u01b0\u1ee3c m\u00e3 h\u00f3a, ch\u1ee9a c\u00e1c th\u00f4ng tin (claims) v\u1ec1 ng\u01b0\u1eddi d\u00f9ng (nh\u01b0 username, quy\u1ec1n h\u1ea1n). Chu\u1ed7i n\u00e0y \u0111\u01b0\u1ee3c k\u00fd \u0111i\u1ec7n t\u1eed (digitally signed) b\u1edfi server.<\/p>\n\n\n\n<p><strong>Lu\u1ed3ng ho\u1ea1t \u0111\u1ed9ng:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>User \u0111\u0103ng nh\u1eadp b\u1eb1ng username\/password.<\/li>\n\n\n\n<li>Server x\u00e1c th\u1ef1c v\u00e0 t\u1ea1o ra m\u1ed9t JWT, sau \u0111\u00f3 g\u1eedi v\u1ec1 cho client.<\/li>\n\n\n\n<li>Client l\u01b0u JWT n\u00e0y l\u1ea1i v\u00e0 \u0111\u00ednh k\u00e8m n\u00f3 v\u00e0o Authorization header c\u1ee7a m\u1ed7i request sau \u0111\u00f3.<\/li>\n\n\n\n<li>Tr\u00ean server, m\u1ed9t filter c\u1ee7a Spring Security s\u1ebd ki\u1ec3m tra t\u00ednh h\u1ee3p l\u1ec7 c\u1ee7a JWT trong m\u1ed7i request \u0111\u1ec3 x\u00e1c th\u1ef1c ng\u01b0\u1eddi d\u00f9ng m\u00e0 kh\u00f4ng c\u1ea7n truy v\u1ea5n l\u1ea1i CSDL.<\/li>\n<\/ul>\n\n\n\n<p>B\u1ea1n c\u00f3 th\u1ec3 t\u1ea1o v\u00ed d\u1ee5 v\u1ec1 JWT qua \u0111\u01b0\u1eddng d\u1eabn sau: <a href=\"https:\/\/jwt.io\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/jwt.io\/<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-giai-do\u1ea1n-4-cac-ch\u1ee7-d\u1ec1-nang-cao-nbsp\"><span class=\"ez-toc-section\" id=\"Giai_doan_4_Cac_chu_de_nang_cao\"><\/span><strong>Giai \u0111o\u1ea1n 4: C\u00e1c ch\u1ee7 \u0111\u1ec1 n\u00e2ng cao&nbsp;<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Khi \u0111\u00e3 n\u1eafm v\u1eefng c\u00e1c ki\u1ebfn th\u1ee9c c\u1ed1t l\u00f5i, \u0111\u00e2y l\u00e0 l\u00fac b\u1ea1n m\u00e0i gi\u0169a k\u1ef9 n\u0103ng c\u1ee7a m\u00ecnh v\u00e0 h\u1ecdc th\u00eam nh\u1eefng c\u00f4ng c\u1ee5 chuy\u00ean bi\u1ec7t. Vi\u1ec7c th\u00e0nh th\u1ea1o c\u00e1c ch\u1ee7 \u0111\u1ec1 n\u00e2ng cao n\u00e0y s\u1ebd gi\u00fap b\u1ea1n x\u00e2y d\u1ef1ng nh\u1eefng \u1ee9ng d\u1ee5ng kh\u00f4ng ch\u1ec9 ch\u1ea1y \u0111\u01b0\u1ee3c, m\u00e0 c\u00f2n th\u1ef1c s\u1ef1 m\u1ea1nh m\u1ebd, d\u1ec5 b\u1ea3o tr\u00ec, c\u00f3 kh\u1ea3 n\u0103ng m\u1edf r\u1ed9ng v\u00e0 s\u1eb5n s\u00e0ng cho m\u00f4i tr\u01b0\u1eddng production.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-spring-aop-aspect-oriented-programming-l\u1eadp-trinh-h\u01b0\u1edbng-khia-c\u1ea1nh\"><strong>Spring AOP (Aspect-Oriented Programming &#8211; L\u1eadp tr\u00ecnh h\u01b0\u1edbng kh\u00eda c\u1ea1nh)<\/strong><\/h3>\n\n\n\n<p>Trong \u1ee9ng d\u1ee5ng, c\u00f3 nh\u1eefng ch\u1ee9c n\u0103ng kh\u00f4ng thu\u1ed9c v\u1ec1 logic nghi\u1ec7p v\u1ee5 ch\u00ednh nh\u01b0ng l\u1ea1i xu\u1ea5t hi\u1ec7n \u1edf kh\u1eafp n\u01a1i, v\u00ed d\u1ee5 nh\u01b0 ghi log (logging), ki\u1ec3m tra quy\u1ec1n, qu\u1ea3n l\u00fd transaction. Ch\u00fang \u0111\u01b0\u1ee3c g\u1ecdi l\u00e0 c\u00e1c m\u1ed1i quan t\u00e2m xuy\u00ean su\u1ed1t (cross-cutting concerns).<\/p>\n\n\n\n<p>L\u1eadp tr\u00ecnh h\u01b0\u1edbng kh\u00eda c\u1ea1nh (AOP) l\u00e0 m\u1ed9t k\u1ef9 thu\u1eadt gi\u00fap b\u1ea1n t\u00e1ch bi\u1ec7t c\u00e1c m\u1ed1i quan t\u00e2m n\u00e0y ra kh\u1ecfi logic nghi\u1ec7p v\u1ee5, \u0111\u00f3ng g\u00f3i ch\u00fang v\u00e0o c\u00e1c module ri\u00eang bi\u1ec7t g\u1ecdi l\u00e0 &#8220;Aspect&#8221;. \u0110i\u1ec1u n\u00e0y gi\u00fap code nghi\u1ec7p v\u1ee5 c\u1ee7a b\u1ea1n tr\u1edf n\u00ean s\u1ea1ch s\u1ebd, t\u1eadp trung v\u00e0 d\u1ec5 b\u1ea3o tr\u00ec h\u01a1n r\u1ea5t nhi\u1ec1u.<\/p>\n\n\n\n<p><strong>C\u00e1c th\u00e0nh ph\u1ea7n ch\u00ednh c\u1ee7a AOP:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Aspect:<\/strong> L\u00e0 m\u1ed9t module (m\u1ed9t class) ch\u1ee9a logic c\u1ee7a m\u1ed9t m\u1ed1i quan t\u00e2m xuy\u00ean su\u1ed1t (v\u00ed d\u1ee5: LoggingAspect).<\/li>\n\n\n\n<li><strong>Join Point:<\/strong> M\u1ed9t \u0111i\u1ec3m c\u1ee5 th\u1ec3 trong qu\u00e1 tr\u00ecnh th\u1ef1c thi ch\u01b0\u01a1ng tr\u00ecnh, v\u00ed d\u1ee5 nh\u01b0 m\u1ed9t l\u1eddi g\u1ecdi ph\u01b0\u01a1ng th\u1ee9c. Trong Spring AOP, \u0111\u00e2y h\u1ea7u nh\u01b0 lu\u00f4n l\u00e0 vi\u1ec7c th\u1ef1c thi m\u1ed9t ph\u01b0\u01a1ng th\u1ee9c.<\/li>\n\n\n\n<li><strong>Pointcut:<\/strong> L\u00e0 m\u1ed9t bi\u1ec3u th\u1ee9c \u0111\u1ec3 x\u00e1c \u0111\u1ecbnh t\u1eadp h\u1ee3p c\u00e1c Join Point m\u00e0 Aspect s\u1ebd \u0111\u01b0\u1ee3c \u00e1p d\u1ee5ng. N\u00f3 gi\u1ed1ng nh\u01b0 m\u1ed9t c\u00e2u l\u1ec7nh truy v\u1ea5n \u0111\u1ec3 ch\u1ecdn ra c\u00e1c ph\u01b0\u01a1ng th\u1ee9c c\u1ea7n can thi\u1ec7p (v\u00ed d\u1ee5: &#8220;t\u1ea5t c\u1ea3 c\u00e1c ph\u01b0\u01a1ng th\u1ee9c trong t\u1ea7ng Service&#8221;).<\/li>\n\n\n\n<li><strong>Advice:<\/strong> L\u00e0 h\u00e0nh \u0111\u1ed9ng c\u1ee5 th\u1ec3 m\u00e0 Aspect s\u1ebd th\u1ef1c hi\u1ec7n t\u1ea1i c\u00e1c Join Point \u0111\u00e3 \u0111\u01b0\u1ee3c ch\u1ecdn. C\u00f3 c\u00e1c lo\u1ea1i Advice ch\u00ednh: @Before, @After, @Around\u2026<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-spring-boot-actuator\"><strong>Spring Boot Actuator<\/strong><\/h3>\n\n\n\n<p>Spring Boot Actuator r\u1ea5t h\u1eefu \u00edch v\u1edbi c\u00e1c l\u1eadp tr\u00ecnh vi\u00ean DevOps v\u00e0 h\u1ec7 th\u1ed1ng. N\u00f3 cung c\u1ea5p \u0111a d\u1ea1ng c\u00e1c endpoint HTTP s\u1eb5n s\u00e0ng cho m\u00f4i tr\u01b0\u1eddng production \u0111\u1ec3 b\u1ea1n c\u00f3 th\u1ec3 gi\u00e1m s\u00e1t v\u00e0 qu\u1ea3n l\u00fd \u1ee9ng d\u1ee5ng c\u1ee7a m\u00ecnh m\u1ed9t c\u00e1ch d\u1ec5 d\u00e0ng.<\/p>\n\n\n\n<p><strong>C\u00e1c endpoint ph\u1ed5 bi\u1ebfn:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\/actuator\/health: Ki\u1ec3m tra &#8220;s\u1ee9c kh\u1ecfe&#8221; t\u1ed5ng quan c\u1ee7a \u1ee9ng d\u1ee5ng, bao g\u1ed3m tr\u1ea1ng th\u00e1i k\u1ebft n\u1ed1i t\u1edbi c\u01a1 s\u1edf d\u1eef li\u1ec7u, dung l\u01b0\u1ee3ng \u1ed5 \u0111\u0129a&#8230;<\/li>\n\n\n\n<li>\/actuator\/metrics: Cung c\u1ea5p c\u00e1c s\u1ed1 li\u1ec7u chi ti\u1ebft v\u1ec1 hi\u1ec7u su\u1ea5t nh\u01b0 m\u1ee9c s\u1eed d\u1ee5ng b\u1ed9 nh\u1edb, CPU, s\u1ed1 l\u01b0\u1ee3ng request HTTP&#8230;<\/li>\n\n\n\n<li>\/actuator\/info: Hi\u1ec3n th\u1ecb c\u00e1c th\u00f4ng tin chung v\u1ec1 \u1ee9ng d\u1ee5ng do b\u1ea1n t\u1ef1 \u0111\u1ecbnh ngh\u0129a.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-x\u1eed-ly-b\u1ea5t-d\u1ed3ng-b\u1ed9-asynchronous-processing\"><strong>X\u1eed l\u00fd b\u1ea5t \u0111\u1ed3ng b\u1ed9 (Asynchronous Processing)<\/strong><\/h3>\n\n\n\n<p>Kh\u00f4ng ph\u1ea3i t\u00e1c v\u1ee5 n\u00e0o c\u0169ng c\u1ea7n \u0111\u01b0\u1ee3c x\u1eed l\u00fd ngay l\u1eadp t\u1ee9c. C\u00e1c t\u00e1c v\u1ee5 t\u1ed1n th\u1eddi gian nh\u01b0 g\u1eedi email, x\u1eed l\u00fd file l\u1edbn, hay g\u1ecdi m\u1ed9t API b\u00ean ngo\u00e0i n\u00ean \u0111\u01b0\u1ee3c th\u1ef1c hi\u1ec7n b\u1ea5t \u0111\u1ed3ng b\u1ed9 \u0111\u1ec3 kh\u00f4ng l\u00e0m block lu\u1ed3ng ch\u00ednh, gi\u00fap \u1ee9ng d\u1ee5ng lu\u00f4n ph\u1ea3n h\u1ed3i nhanh ch\u00f3ng.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>@Async Annotation:<\/strong> C\u00e1ch \u0111\u01a1n gi\u1ea3n nh\u1ea5t \u0111\u1ec3 bi\u1ebfn m\u1ed9t ph\u01b0\u01a1ng th\u1ee9c th\u00e0nh b\u1ea5t \u0111\u1ed3ng b\u1ed9. Ch\u1ec9 c\u1ea7n th\u00eam annotation n\u00e0y v\u00e0o ph\u01b0\u01a1ng th\u1ee9c v\u00e0 k\u00edch ho\u1ea1t n\u00f3 b\u1eb1ng @EnableAsync, Spring s\u1ebd t\u1ef1 \u0111\u1ed9ng ch\u1ea1y ph\u01b0\u01a1ng th\u1ee9c \u0111\u00f3 trong m\u1ed9t lu\u1ed3ng (thread) ri\u00eang.<\/li>\n\n\n\n<li><strong>CompletableFuture:<\/strong> M\u1ed9t c\u00f4ng c\u1ee5 m\u1ea1nh m\u1ebd c\u1ee7a Java 8, cho ph\u00e9p b\u1ea1n x\u1eed l\u00fd c\u00e1c lu\u1ed3ng c\u00f4ng vi\u1ec7c b\u1ea5t \u0111\u1ed3ng b\u1ed9 ph\u1ee9c t\u1ea1p, k\u1ebft h\u1ee3p k\u1ebft qu\u1ea3 t\u1eeb nhi\u1ec1u t\u00e1c v\u1ee5 v\u00e0 x\u1eed l\u00fd l\u1ed7i m\u1ed9t c\u00e1ch linh ho\u1ea1t.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-testing-trong-spring-boot\"><strong>Testing trong Spring Boot<\/strong><\/h3>\n\n\n\n<p>Vi\u1ebft code m\u00e0 kh\u00f4ng c\u00f3 test gi\u1ed1ng nh\u01b0 x\u00e2y nh\u00e0 kh\u00f4ng c\u00f3 m\u00f3ng. Testing l\u00e0 m\u1ed9t ph\u1ea7n kh\u00f4ng th\u1ec3 thi\u1ebfu \u0111\u1ec3 \u0111\u1ea3m b\u1ea3o ch\u1ea5t l\u01b0\u1ee3ng ph\u1ea7n m\u1ec1m.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>JUnit 5:<\/strong> Framework ti\u00eau chu\u1ea9n \u0111\u1ec3 vi\u1ebft v\u00e0 ch\u1ea1y c\u00e1c b\u00e0i ki\u1ec3m th\u1eed \u0111\u01a1n v\u1ecb (unit test) trong Java.<\/li>\n\n\n\n<li><strong>Mockito:<\/strong> M\u1ed9t th\u01b0 vi\u1ec7n c\u1ef1c k\u1ef3 h\u1eefu \u00edch \u0111\u1ec3 t\u1ea1o ra c\u00e1c \u0111\u1ed1i t\u01b0\u1ee3ng gi\u1ea3 (mock objects). Khi b\u1ea1n mu\u1ed1n ki\u1ec3m th\u1eed l\u1edbp Service, b\u1ea1n kh\u00f4ng mu\u1ed1n n\u00f3 k\u1ebft n\u1ed1i th\u1eadt t\u1edbi CSDL. Thay v\u00e0o \u0111\u00f3, b\u1ea1n &#8220;mock&#8221; l\u1edbp Repository \u0111\u1ec3 gi\u1ea3 l\u1eadp c\u00e1c h\u00e0nh vi c\u1ee7a n\u00f3, gi\u00fap b\u1ea1n c\u00f4 l\u1eadp v\u00e0 ch\u1ec9 t\u1eadp trung ki\u1ec3m th\u1eed logic c\u1ee7a Service.<\/li>\n\n\n\n<li><strong>Spring Boot Test:<\/strong> Spring Boot cung c\u1ea5p c\u00e1c annotation h\u1ed7 tr\u1ee3 testing m\u1ea1nh m\u1ebd nh\u01b0 @SpringBootTest, @WebMvcTest, @DataJpaTest, cho ph\u00e9p b\u1ea1n n\u1ea1p m\u1ed9t ph\u1ea7n ho\u1eb7c to\u00e0n b\u1ed9 ng\u1eef c\u1ea3nh \u1ee9ng d\u1ee5ng \u0111\u1ec3 th\u1ef1c hi\u1ec7n c\u00e1c b\u00e0i ki\u1ec3m th\u1eed t\u00edch h\u1ee3p (integration test) m\u1ed9t c\u00e1ch ch\u00e2n th\u1ef1c.<\/li>\n\n\n\n<li><strong>Ki\u1ec3m th\u1eed t\u1eebng t\u1ea7ng:<\/strong>\n<ul class=\"wp-block-list\">\n<li><strong>Controller:<\/strong> D\u00f9ng @WebMvcTest \u0111\u1ec3 ki\u1ec3m th\u1eed vi\u1ec7c x\u1eed l\u00fd request, response m\u00e0 kh\u00f4ng c\u1ea7n kh\u1edfi \u0111\u1ed9ng c\u1ea3 server.<\/li>\n\n\n\n<li><strong>Service:<\/strong> D\u00f9ng @SpringBootTest v\u00e0 Mockito \u0111\u1ec3 ki\u1ec3m th\u1eed logic nghi\u1ec7p v\u1ee5.<\/li>\n\n\n\n<li><strong>Repository:<\/strong> D\u00f9ng @DataJpaTest \u0111\u1ec3 ki\u1ec3m th\u1eed t\u1ea7ng truy c\u1eadp d\u1eef li\u1ec7u v\u1edbi m\u1ed9t CSDL trong b\u1ed9 nh\u1edb nh\u01b0 H2.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-tri\u1ec3n-khai-\u1ee9ng-d\u1ee5ng-deployment\"><strong>Tri\u1ec3n khai \u1ee9ng d\u1ee5ng (Deployment)<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Docker (Containerization):<\/strong>&nbsp;<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXfFPza7Jhy-Yoa_PV_h2LeT7w-f-E6iSTAq32dbLlU4WzLr0DMciYvCkifrS6lIgQEM7NEHLKs1-gQjSVrk-ovMTwgUIZRe2jgCA2NWUNSigFT1BK6ty1jMi_shMsqcVmj1auRReQ?key=JG4oPA9AqLxhCy3Z-t8Keg\" alt=\"\"\/><\/figure>\n\n\n\n<p>Docker l\u00e0 c\u00f4ng ngh\u1ec7 cho ph\u00e9p b\u1ea1n &#8220;\u0111\u00f3ng g\u00f3i&#8221; \u1ee9ng d\u1ee5ng Spring Boot c\u00f9ng v\u1edbi t\u1ea5t c\u1ea3 c\u00e1c ph\u1ee5 thu\u1ed9c c\u1ee7a n\u00f3 (nh\u01b0 JRE) v\u00e0o m\u1ed9t \u0111\u01a1n v\u1ecb ti\u00eau chu\u1ea9n g\u1ecdi l\u00e0 &#8220;container&#8221;. \u0110i\u1ec1u n\u00e0y gi\u1ea3i quy\u1ebft tri\u1ec7t \u0111\u1ec3 v\u1ea5n \u0111\u1ec1 &#8220;code ch\u1ea1y tr\u00ean m\u00e1y t\u00f4i nh\u01b0ng kh\u00f4ng ch\u1ea1y tr\u00ean m\u00e1y kh\u00e1c&#8221; v\u00e0 gi\u00fap vi\u1ec7c tri\u1ec3n khai tr\u1edf n\u00ean nh\u1ea5t qu\u00e1n \u1edf m\u1ecdi m\u00f4i tr\u01b0\u1eddng.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><em>\u0110\u1ecdc chi ti\u1ebft: <a href=\"https:\/\/itviec.com\/blog\/docker-la-gi\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Docker l\u00e0 g\u00ec? H\u00e3y \u0111\u1ec3 Senior DevOps Engineer tr\u1ea3 l\u1eddi cho b\u1ea1n!<\/strong><\/a><\/em><\/p>\n<\/blockquote>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Tri\u1ec3n khai l\u00ean Cloud:<\/strong>&nbsp;<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXcr0ZNLCzoIJDOqkYwb-iiBSyRxqoMHUuOyoSV353D15ZTFyh835Oppk0aNmcl-0oLZzO_mV5qA6MrK8KAVboUN3mRxy_6MOExw53w7Dug1C64ofmvOxe3m9XzHJ6_t8MlscC-7Ew?key=JG4oPA9AqLxhCy3Z-t8Keg\" alt=\"\"\/><\/figure>\n\n\n\n<p>Ng\u00e0y nay, c\u00e1c \u1ee9ng d\u1ee5ng th\u01b0\u1eddng \u0111\u01b0\u1ee3c tri\u1ec3n khai tr\u00ean c\u00e1c n\u1ec1n t\u1ea3ng \u0111\u00e1m m\u00e2y. C\u00e1c nh\u00e0 cung c\u1ea5p l\u1edbn nh\u01b0 <strong>AWS (Amazon Web Services)<\/strong>, <strong>GCP (Google Cloud Platform)<\/strong>, v\u00e0 <strong>Microsoft Azure<\/strong> cung c\u1ea5p c\u00e1c d\u1ecbch v\u1ee5 \u0111\u01b0\u1ee3c thi\u1ebft k\u1ebf ri\u00eang \u0111\u1ec3 ch\u1ea1y c\u00e1c container, gi\u00fap b\u1ea1n d\u1ec5 d\u00e0ng tri\u1ec3n khai, qu\u1ea3n l\u00fd v\u00e0 m\u1edf r\u1ed9ng quy m\u00f4 \u1ee9ng d\u1ee5ng c\u1ee7a m\u00ecnh.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-cac-cong-c\u1ee5-ph\u1ed5-bi\u1ebfn-khac\"><strong>C\u00e1c c\u00f4ng c\u1ee5 ph\u1ed5 bi\u1ebfn kh\u00e1c<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.baeldung.com\/intro-to-project-lombok\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Lombok<\/strong><\/a><strong>:<\/strong> M\u1ed9t th\u01b0 vi\u1ec7n gi\u00fap gi\u1ea3m thi\u1ec3u \u0111\u00e1ng k\u1ec3 code so\u1ea1n s\u1eb5n (boilerplate code). Ch\u1ec9 c\u1ea7n d\u00f9ng c\u00e1c annotation nh\u01b0 @Data, @Getter, @Setter, Lombok s\u1ebd t\u1ef1 \u0111\u1ed9ng t\u1ea1o ra c\u00e1c ph\u01b0\u01a1ng th\u1ee9c t\u01b0\u01a1ng \u1ee9ng l\u00fac bi\u00ean d\u1ecbch, gi\u00fap code c\u1ee7a b\u1ea1n g\u1ecdn g\u00e0ng h\u01a1n r\u1ea5t nhi\u1ec1u.<\/li>\n\n\n\n<li><a href=\"https:\/\/swagger.io\/specification\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Swagger\/OpenAPI<\/strong><\/a><strong>:<\/strong> T\u1ef1 \u0111\u1ed9ng t\u1ea1o ra t\u00e0i li\u1ec7u API (API documentation) t\u01b0\u01a1ng t\u00e1c tr\u1ef1c quan ngay t\u1eeb code Controller c\u1ee7a b\u1ea1n. \u0110\u00e2y l\u00e0 c\u00f4ng c\u1ee5 kh\u00f4ng th\u1ec3 thi\u1ebfu khi l\u00e0m vi\u1ec7c nh\u00f3m ho\u1eb7c cung c\u1ea5p API cho b\u00ean th\u1ee9 ba.<\/li>\n\n\n\n<li><a href=\"https:\/\/spring.io\/projects\/spring-data-redis\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Redis<\/strong><\/a><strong>:<\/strong> M\u1ed9t kho l\u01b0u tr\u1eef d\u1eef li\u1ec7u key-value trong b\u1ed9 nh\u1edb c\u1ef1c nhanh, th\u01b0\u1eddng \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng l\u00e0m b\u1ed9 \u0111\u1ec7m (cache) \u0111\u1ec3 gi\u1ea3m t\u1ea3i cho CSDL ch\u00ednh v\u00e0 t\u0103ng t\u1ed1c \u0111\u1ed9 ph\u1ea3n h\u1ed3i c\u1ee7a \u1ee9ng d\u1ee5ng.<\/li>\n\n\n\n<li><a href=\"https:\/\/www.confluent.io\/cloud-kafka\/?utm_medium=sem&amp;utm_source=google&amp;utm_campaign=ch.sem_br.nonbrand_tp.prs_tgt.kafka_mt.mbm_rgn.apac_sbrgn.tier2_lng.eng_dv.all_con.kafka-cloud_term.kafka-cloud&amp;utm_term=kafka%20cloud&amp;creative=&amp;device=c&amp;placement=&amp;gad_source=1&amp;gad_campaignid=22120624242&amp;gbraid=0AAAAADRv2c1XyqTzpufyYzA5gdVn3LcGu&amp;gclid=CjwKCAjwvO7CBhAqEiwA9q2YJVF8WnEWcSB3Kznm6GnogQWnVAjtaOlL0iTXnaMKx6egB571bzlVIBoC2qYQAvD_BwE\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>RabbitMQ\/Kafka (Message Queues)<\/strong><\/a><strong>:<\/strong> L\u00e0 c\u00e1c h\u1ec7 th\u1ed1ng h\u00e0ng \u0111\u1ee3i tin nh\u1eafn, \u0111\u00f3ng vai tr\u00f2 trung gian trong vi\u1ec7c giao ti\u1ebfp gi\u1eefa c\u00e1c d\u1ecbch v\u1ee5 trong ki\u1ebfn tr\u00fac microservices. Ch\u00fang gi\u00fap x\u00e2y d\u1ef1ng c\u00e1c h\u1ec7 th\u1ed1ng b\u1ea5t \u0111\u1ed3ng b\u1ed9, linh ho\u1ea1t v\u00e0 c\u00f3 kh\u1ea3 n\u0103ng ch\u1ecbu l\u1ed7i cao.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-cac-cau-h\u1ecfi-th\u01b0\u1eddng-g\u1eb7p-v\u1ec1-spring-boot-roadmap\"><span class=\"ez-toc-section\" id=\"Cac_cau_hoi_thuong_gap_ve_Spring_boot_roadmap\"><\/span><strong>C\u00e1c c\u00e2u h\u1ecfi th\u01b0\u1eddng g\u1eb7p&nbsp;v\u1ec1 Spring boot roadmap<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-sau-khi-hoan-thanh-l\u1ed9-trinh-spring-boot-roadmap-toi-nen-h\u1ecdc-gi-ti\u1ebfp-theo\"><strong>Sau khi ho\u00e0n th\u00e0nh l\u1ed9 tr\u00ecnh Spring boot roadmap, t\u00f4i n\u00ean h\u1ecdc g\u00ec ti\u1ebfp theo?<\/strong><\/h3>\n\n\n\n<p>H\u01b0\u1edbng \u0111i h\u1ee3p l\u00fd nh\u1ea5t ti\u1ebfp theo ch\u00ednh l\u00e0 <strong>Ki\u1ebfn tr\u00fac Microservices<\/strong>. H\u00e3y b\u1eaft \u0111\u1ea7u t\u00ecm hi\u1ec3u c\u00e1c kh\u00e1i ni\u1ec7m v\u00e0 c\u00f4ng c\u1ee5 trong h\u1ec7 sinh th\u00e1i Spring Cloud:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>API Gateway:<\/strong> Spring Cloud Gateway<\/li>\n\n\n\n<li><strong>Service Discovery:<\/strong> Eureka, Consul<\/li>\n\n\n\n<li><strong>Centralized Configuration:<\/strong> Spring Cloud Config<\/li>\n\n\n\n<li><strong>Resilience Patterns:<\/strong> Resilience4j (Circuit Breaker)<\/li>\n<\/ul>\n\n\n\n<p>Ngo\u00e0i ra, vi\u1ec7c \u0111\u00e0o s\u00e2u v\u00e0o <strong>Docker v\u00e0 Kubernetes<\/strong> \u0111\u1ec3 \u0111\u00f3ng g\u00f3i v\u00e0 \u0111i\u1ec1u ph\u1ed1i \u1ee9ng d\u1ee5ng c\u0169ng l\u00e0 m\u1ed9t k\u1ef9 n\u0103ng c\u1ef1c k\u1ef3 gi\u00e1 tr\u1ecb tr\u00ean th\u1ecb tr\u01b0\u1eddng hi\u1ec7n nay, gi\u00fap b\u1ea1n th\u00e0nh c\u00f4ng tr\u00ean con \u0111\u01b0\u1eddng tr\u1edf th\u00e0nh m\u1ed9t l\u1eadp tr\u00ecnh vi\u00ean Spring Boot chuy\u00ean nghi\u1ec7p<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-khi-nao-dung-restcontroller-va-khi-nao-dung-controller\"><strong>Khi n\u00e0o d\u00f9ng <\/strong><strong>@RestController<\/strong><strong> v\u00e0 khi n\u00e0o d\u00f9ng <\/strong><strong>@Controller<\/strong><strong>?<\/strong><\/h3>\n\n\n\n<p>\u0110\u00e2y l\u00e0 m\u1ed9t \u0111i\u1ec3m r\u1ea5t d\u1ec5 nh\u1ea7m l\u1eabn cho ng\u01b0\u1eddi m\u1edbi.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>@Controller<\/strong><strong>:<\/strong> D\u00f9ng cho c\u00e1c \u1ee9ng d\u1ee5ng web truy\u1ec1n th\u1ed1ng. Ph\u01b0\u01a1ng th\u1ee9c trong controller th\u01b0\u1eddng tr\u1ea3 v\u1ec1 m\u1ed9t String l\u00e0 <strong>t\u00ean c\u1ee7a m\u1ed9t view<\/strong> (v\u00ed d\u1ee5: m\u1ed9t file HTML c\u1ee7a Thymeleaf) \u0111\u1ec3 Spring render ra giao di\u1ec7n ng\u01b0\u1eddi d\u00f9ng.<\/li>\n\n\n\n<li><strong>@RestController<\/strong><strong>:<\/strong> L\u00e0 s\u1ef1 k\u1ebft h\u1ee3p c\u1ee7a @Controller v\u00e0 @ResponseBody. N\u00f3 \u0111\u01b0\u1ee3c thi\u1ebft k\u1ebf ri\u00eang \u0111\u1ec3 x\u00e2y d\u1ef1ng <strong>REST API<\/strong>. M\u1ecdi th\u1ee9 b\u1ea1n tr\u1ea3 v\u1ec1 t\u1eeb ph\u01b0\u01a1ng th\u1ee9c (v\u00ed d\u1ee5 m\u1ed9t \u0111\u1ed1i t\u01b0\u1ee3ng User) s\u1ebd \u0111\u01b0\u1ee3c Spring t\u1ef1 \u0111\u1ed9ng chuy\u1ec3n th\u00e0nh JSON v\u00e0 ghi v\u00e0o body c\u1ee7a HTTP response.<\/li>\n<\/ul>\n\n\n\n<p><strong>Quy t\u1eafc v\u00e0ng:<\/strong> N\u1ebfu x\u00e2y d\u1ef1ng REST API cho c\u00e1c client (frontend, mobile app) ti\u00eau th\u1ee5, <strong>lu\u00f4n d\u00f9ng <\/strong><strong>@RestController<\/strong>. N\u1ebfu x\u00e2y d\u1ef1ng m\u1ed9t \u1ee9ng d\u1ee5ng web tr\u1ea3 v\u1ec1 c\u00e1c trang HTML, h\u00e3y d\u00f9ng @Controller.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-cach-t\u1ed1t-nh\u1ea5t-d\u1ec3-x\u1eed-ly-ngo\u1ea1i-l\u1ec7-exceptions-trong-rest-api-la-gi\"><strong>C\u00e1ch t\u1ed1t nh\u1ea5t \u0111\u1ec3 x\u1eed l\u00fd ngo\u1ea1i l\u1ec7 (Exceptions) trong REST API l\u00e0 g\u00ec?<\/strong><\/h3>\n\n\n\n<p>Thay v\u00ec r\u1ea3i c\u00e1c kh\u1ed1i try-catch kh\u1eafp n\u01a1i trong c\u00e1c Controller, c\u00e1ch ti\u1ebfp c\u1eadn t\u1ed1t nh\u1ea5t l\u00e0 x\u1eed l\u00fd t\u1eadp trung. H\u00e3y t\u1ea1o m\u1ed9t class v\u00e0 \u0111\u00e1nh d\u1ea5u n\u00f3 v\u1edbi annotation @ControllerAdvice. B\u00ean trong class n\u00e0y, b\u1ea1n vi\u1ebft c\u00e1c ph\u01b0\u01a1ng th\u1ee9c \u0111\u01b0\u1ee3c \u0111\u00e1nh d\u1ea5u v\u1edbi @ExceptionHandler({LoaiException.class}). Khi b\u1ea5t k\u1ef3 m\u1ed9t Controller n\u00e0o n\u00e9m ra LoaiException, Spring s\u1ebd t\u1ef1 \u0111\u1ed9ng b\u1eaft l\u1ea5y n\u00f3 v\u00e0 chuy\u1ec3n cho ph\u01b0\u01a1ng th\u1ee9c t\u01b0\u01a1ng \u1ee9ng trong class @ControllerAdvice x\u1eed l\u00fd. T\u1ea1i \u0111\u00e2y, b\u1ea1n c\u00f3 th\u1ec3 t\u1ea1o m\u1ed9t response l\u1ed7i JSON chu\u1ea9n h\u00f3a v\u00e0 tr\u1ea3 v\u1ec1 cho client. C\u00e1ch l\u00e0m n\u00e0y gi\u00fap logic trong Controller lu\u00f4n s\u1ea1ch s\u1ebd v\u00e0 nh\u1ea5t qu\u00e1n trong vi\u1ec7c x\u1eed l\u00fd l\u1ed7i.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-component-service-repository-controller-khac-gi-nhau-sao-khong-dung-component-cho-t\u1ea5t-c\u1ea3\"><strong>@Component<\/strong><strong>, <\/strong><strong>@Service<\/strong><strong>, <\/strong><strong>@Repository<\/strong><strong>, <\/strong><strong>@Controller<\/strong><strong> kh\u00e1c g\u00ec nhau? Sao kh\u00f4ng d\u00f9ng <\/strong><strong>@Component<\/strong><strong> cho t\u1ea5t c\u1ea3?<\/strong><\/h3>\n\n\n\n<p>V\u1ec1 c\u01a1 b\u1ea3n, t\u1ea5t c\u1ea3 c\u00e1c annotation n\u00e0y \u0111\u1ec1u \u0111\u00e1nh d\u1ea5u m\u1ed9t class l\u00e0 Spring Bean \u0111\u1ec3 Spring Container qu\u1ea3n l\u00fd. Tuy nhi\u00ean, vi\u1ec7c s\u1eed d\u1ee5ng c\u00e1c annotation c\u1ee5 th\u1ec3 h\u01a1n mang l\u1ea1i <strong>\u00fd ngh\u0129a ng\u1eef ngh\u0129a (semantic meaning)<\/strong> v\u00e0 m\u1ed9t v\u00e0i <strong>l\u1ee3i \u00edch k\u1ef9 thu\u1eadt<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>@Repository<\/strong><strong>:<\/strong> D\u00f9ng cho t\u1ea7ng truy c\u1eadp d\u1eef li\u1ec7u (Data Access Layer). Ngo\u00e0i vi\u1ec7c \u0111\u00e1nh d\u1ea5u bean, n\u00f3 c\u00f2n gi\u00fap Spring t\u1ef1 \u0111\u1ed9ng chuy\u1ec3n \u0111\u1ed5i c\u00e1c ngo\u1ea1i l\u1ec7 (exception) \u0111\u1eb7c th\u00f9 c\u1ee7a CSDL (nh\u01b0 SQLException) th\u00e0nh c\u00e1c ngo\u1ea1i l\u1ec7 nh\u1ea5t qu\u00e1n c\u1ee7a Spring (DataAccessException), gi\u00fap code c\u1ee7a b\u1ea1n s\u1ea1ch s\u1ebd h\u01a1n.<\/li>\n\n\n\n<li><strong>@Service<\/strong><strong>:<\/strong> D\u00f9ng cho t\u1ea7ng logic nghi\u1ec7p v\u1ee5 (Business Logic Layer). Ch\u1ee7 y\u1ebfu mang \u00fd ngh\u0129a ng\u1eef ngh\u0129a \u0111\u1ec3 ph\u00e2n bi\u1ec7t vai tr\u00f2 c\u1ee7a c\u00e1c l\u1edbp.<\/li>\n\n\n\n<li><strong>@Controller<\/strong><strong> \/ <\/strong><strong>@RestController<\/strong><strong>:<\/strong> D\u00f9ng cho t\u1ea7ng tr\u00ecnh b\u00e0y (Presentation Layer), x\u1eed l\u00fd c\u00e1c HTTP request.<\/li>\n<\/ul>\n\n\n\n<p>T\u00f3m l\u1ea1i, vi\u1ec7c d\u00f9ng annotation c\u1ee5 th\u1ec3 gi\u00fap code c\u1ee7a b\u1ea1n t\u1ef1 minh b\u1ea1ch (self-documenting), d\u1ec5 hi\u1ec3u h\u01a1n cho ng\u01b0\u1eddi kh\u00e1c v\u00e0 cho ph\u00e9p Spring Framework \u00e1p d\u1ee5ng c\u00e1c x\u1eed l\u00fd \u0111\u1eb7c bi\u1ec7t cho t\u1eebng lo\u1ea1i. \u0110\u00e2y l\u00e0 m\u1ed9t th\u00f3i quen t\u1ed1t n\u00ean tu\u00e2n th\u1ee7.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-t\u1ed5ng-k\u1ebft-v\u1ec1-spring-boot-roadmap\"><span class=\"ez-toc-section\" id=\"Tong_ket_ve_Spring_boot_roadmap\"><\/span><strong>T\u1ed5ng k\u1ebft v\u1ec1 Spring boot roadmap<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Spring Boot l\u00e0 m\u1ed9t c\u00f4ng c\u1ee5 m\u1ea1nh m\u1ebd gi\u00fap \u0111\u01a1n gi\u1ea3n h\u00f3a vi\u1ec7c ph\u00e1t tri\u1ec3n \u1ee9ng d\u1ee5ng Java, v\u00e0 gi\u1edd b\u1ea1n \u0111\u00e3 c\u00f3 trong tay t\u1ea5m b\u1ea3n \u0111\u1ed3 \u0111\u1ec3 l\u00e0m ch\u1ee7 n\u00f3 t\u1eeb nh\u1eefng kh\u00e1i ni\u1ec7m n\u1ec1n t\u1ea3ng \u0111\u1ebfn c\u00e1c k\u1ef9 thu\u1eadt n\u00e2ng cao.&nbsp;<\/p>\n\n\n\n<p>Tuy nhi\u00ean, ki\u1ebfn th\u1ee9c s\u1ebd ch\u1ec9 th\u1ef1c s\u1ef1 l\u00e0 c\u1ee7a b\u1ea1n khi \u0111\u01b0\u1ee3c \u00e1p d\u1ee5ng. \u0110\u1eebng ch\u1ea7n ch\u1eeb, h\u00e3y b\u1eaft tay ngay v\u00e0o vi\u1ec7c x\u00e2y d\u1ef1ng m\u1ed9t d\u1ef1 \u00e1n c\u1ee7a ri\u00eang m\u00ecnh. Ch\u00ednh qu\u00e1 tr\u00ecnh th\u1ef1c h\u00e0nh, s\u1eeda l\u1ed7i v\u00e0 ho\u00e0n thi\u1ec7n s\u1ea3n ph\u1ea9m m\u1edbi l\u00e0 c\u00e1ch t\u1ed1t nh\u1ea5t \u0111\u1ec3 c\u1ee7ng c\u1ed1 k\u1ef9 n\u0103ng.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Spring Boot \u0111\u01b0\u1ee3c xem nh\u01b0 m\u1ed9t gi\u1ea3i ph\u00e1p c\u1ee9u c\u00e1nh, gi\u00fap b\u1ea1n kh\u1edfi t\u1ea1o d\u1ef1 \u00e1n Java ch\u1ec9 trong v\u00e0i ph\u00fat. D\u00f9 b\u1ea1n l\u00e0 m\u1ed9t l\u1eadp tr\u00ecnh vi\u00ean Java mu\u1ed1n hi\u1ec7n \u0111\u1ea1i h\u00f3a k\u1ef9 n\u0103ng, m\u1ed9t sinh vi\u00ean IT \u0111ang t\u00ecm h\u01b0\u1edbng \u0111i, hay b\u1ea5t k\u1ef3 ai mu\u1ed1n x\u00e2y d\u1ef1ng RESTful API v\u00e0 microservices nhanh [&hellip;]<\/p>\n","protected":false},"author":203,"featured_media":89357,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_gspb_post_css":"","footnotes":""},"categories":[109],"tags":[],"class_list":["post-89211","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-chuyen-mon-it"],"blocksy_meta":[],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.8 (Yoast SEO v27.7) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Spring Boot Roadmap: L\u1ed9 tr\u00ecnh h\u1ecdc Spring Boot chi ti\u1ebft - ITviec Blog<\/title>\n<meta name=\"description\" content=\"\u0110\u1ecdc ngay l\u1ed9 tr\u00ecnh h\u1ecdc Spring Boot roadmap chi ti\u1ebft t\u1eeb ki\u1ebfn th\u1ee9c n\u1ec1n t\u1ea3ng, Spring Boot Core \u0111\u1ebfn b\u1ea3o m\u1eadt v\u00e0 c\u00e1c ch\u1ee7 \u0111\u1ec1 n\u00e2ng cao.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/itviec.com\/blog\/lo-trinh-hoc-spring-boot-roadmap\/\" \/>\n<meta property=\"og:locale\" content=\"vi_VN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Spring Boot Roadmap: L\u1ed9 tr\u00ecnh h\u1ecdc Spring Boot chi ti\u1ebft\" \/>\n<meta property=\"og:description\" content=\"Spring Boot \u0111\u01b0\u1ee3c xem nh\u01b0 m\u1ed9t gi\u1ea3i ph\u00e1p c\u1ee9u c\u00e1nh, gi\u00fap b\u1ea1n kh\u1edfi t\u1ea1o d\u1ef1 \u00e1n Java ch\u1ec9 trong v\u00e0i ph\u00fat. D\u00f9 b\u1ea1n l\u00e0 m\u1ed9t l\u1eadp tr\u00ecnh vi\u00ean Java mu\u1ed1n hi\u1ec7n \u0111\u1ea1i h\u00f3a k\u1ef9\" \/>\n<meta property=\"og:url\" content=\"https:\/\/itviec.com\/blog\/lo-trinh-hoc-spring-boot-roadmap\/\" \/>\n<meta property=\"og:site_name\" content=\"ITviec Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ITviec\" \/>\n<meta property=\"article:published_time\" content=\"2025-07-12T14:48:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-12T14:48:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/07\/spring-boot-roadmap-scaled.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"1347\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Tien Tran\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ITviec\" \/>\n<meta name=\"twitter:site\" content=\"@ITviec\" \/>\n<meta name=\"twitter:label1\" content=\"\u0110\u01b0\u1ee3c vi\u1ebft b\u1edfi\" \/>\n\t<meta name=\"twitter:data1\" content=\"Tien Tran\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u01af\u1edbc t\u00ednh th\u1eddi gian \u0111\u1ecdc\" \/>\n\t<meta name=\"twitter:data2\" content=\"33 ph\u00fat\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Spring Boot Roadmap: L\u1ed9 tr\u00ecnh h\u1ecdc Spring Boot chi ti\u1ebft - ITviec Blog","description":"\u0110\u1ecdc ngay l\u1ed9 tr\u00ecnh h\u1ecdc Spring Boot roadmap chi ti\u1ebft t\u1eeb ki\u1ebfn th\u1ee9c n\u1ec1n t\u1ea3ng, Spring Boot Core \u0111\u1ebfn b\u1ea3o m\u1eadt v\u00e0 c\u00e1c ch\u1ee7 \u0111\u1ec1 n\u00e2ng cao.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/itviec.com\/blog\/lo-trinh-hoc-spring-boot-roadmap\/","og_locale":"vi_VN","og_type":"article","og_title":"Spring Boot Roadmap: L\u1ed9 tr\u00ecnh h\u1ecdc Spring Boot chi ti\u1ebft","og_description":"Spring Boot \u0111\u01b0\u1ee3c xem nh\u01b0 m\u1ed9t gi\u1ea3i ph\u00e1p c\u1ee9u c\u00e1nh, gi\u00fap b\u1ea1n kh\u1edfi t\u1ea1o d\u1ef1 \u00e1n Java ch\u1ec9 trong v\u00e0i ph\u00fat. D\u00f9 b\u1ea1n l\u00e0 m\u1ed9t l\u1eadp tr\u00ecnh vi\u00ean Java mu\u1ed1n hi\u1ec7n \u0111\u1ea1i h\u00f3a k\u1ef9","og_url":"https:\/\/itviec.com\/blog\/lo-trinh-hoc-spring-boot-roadmap\/","og_site_name":"ITviec Blog","article_publisher":"https:\/\/www.facebook.com\/ITviec","article_published_time":"2025-07-12T14:48:10+00:00","article_modified_time":"2025-07-12T14:48:13+00:00","og_image":[{"width":2560,"height":1347,"url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/07\/spring-boot-roadmap-scaled.png","type":"image\/png"}],"author":"Tien Tran","twitter_card":"summary_large_image","twitter_creator":"@ITviec","twitter_site":"@ITviec","twitter_misc":{"\u0110\u01b0\u1ee3c vi\u1ebft b\u1edfi":"Tien Tran","\u01af\u1edbc t\u00ednh th\u1eddi gian \u0111\u1ecdc":"33 ph\u00fat"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/itviec.com\/blog\/lo-trinh-hoc-spring-boot-roadmap\/#article","isPartOf":{"@id":"https:\/\/itviec.com\/blog\/lo-trinh-hoc-spring-boot-roadmap\/"},"author":{"name":"Tien Tran","@id":"https:\/\/itviec.com\/blog\/#\/schema\/person\/1595d671c49cfa2a48cd3c0a047a1298"},"headline":"Spring Boot Roadmap: L\u1ed9 tr\u00ecnh h\u1ecdc Spring Boot chi ti\u1ebft","datePublished":"2025-07-12T14:48:10+00:00","dateModified":"2025-07-12T14:48:13+00:00","mainEntityOfPage":{"@id":"https:\/\/itviec.com\/blog\/lo-trinh-hoc-spring-boot-roadmap\/"},"wordCount":8508,"publisher":{"@id":"https:\/\/itviec.com\/blog\/#organization"},"image":{"@id":"https:\/\/itviec.com\/blog\/lo-trinh-hoc-spring-boot-roadmap\/#primaryimage"},"thumbnailUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/07\/spring-boot-roadmap-scaled.png","articleSection":["Chuy\u00ean m\u00f4n IT"],"inLanguage":"vi"},{"@type":"WebPage","@id":"https:\/\/itviec.com\/blog\/lo-trinh-hoc-spring-boot-roadmap\/","url":"https:\/\/itviec.com\/blog\/lo-trinh-hoc-spring-boot-roadmap\/","name":"Spring Boot Roadmap: L\u1ed9 tr\u00ecnh h\u1ecdc Spring Boot chi ti\u1ebft - ITviec Blog","isPartOf":{"@id":"https:\/\/itviec.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/itviec.com\/blog\/lo-trinh-hoc-spring-boot-roadmap\/#primaryimage"},"image":{"@id":"https:\/\/itviec.com\/blog\/lo-trinh-hoc-spring-boot-roadmap\/#primaryimage"},"thumbnailUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/07\/spring-boot-roadmap-scaled.png","datePublished":"2025-07-12T14:48:10+00:00","dateModified":"2025-07-12T14:48:13+00:00","description":"\u0110\u1ecdc ngay l\u1ed9 tr\u00ecnh h\u1ecdc Spring Boot roadmap chi ti\u1ebft t\u1eeb ki\u1ebfn th\u1ee9c n\u1ec1n t\u1ea3ng, Spring Boot Core \u0111\u1ebfn b\u1ea3o m\u1eadt v\u00e0 c\u00e1c ch\u1ee7 \u0111\u1ec1 n\u00e2ng cao.","breadcrumb":{"@id":"https:\/\/itviec.com\/blog\/lo-trinh-hoc-spring-boot-roadmap\/#breadcrumb"},"inLanguage":"vi","potentialAction":[{"@type":"ReadAction","target":["https:\/\/itviec.com\/blog\/lo-trinh-hoc-spring-boot-roadmap\/"]}]},{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/itviec.com\/blog\/lo-trinh-hoc-spring-boot-roadmap\/#primaryimage","url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/07\/spring-boot-roadmap-scaled.png","contentUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/07\/spring-boot-roadmap-scaled.png","width":800,"height":421,"caption":"Spring Boot Roadmap - itviec blog"},{"@type":"BreadcrumbList","@id":"https:\/\/itviec.com\/blog\/lo-trinh-hoc-spring-boot-roadmap\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Chuy\u00ean m\u00f4n IT","item":"https:\/\/itviec.com\/blog\/chuyen-mon-it\/"},{"@type":"ListItem","position":2,"name":"Spring Boot Roadmap: L\u1ed9 tr\u00ecnh h\u1ecdc Spring Boot chi ti\u1ebft"}]},{"@type":"WebSite","@id":"https:\/\/itviec.com\/blog\/#website","url":"https:\/\/itviec.com\/blog\/","name":"ITviec Blog","description":"IT Jobs &amp; People in Vietnam","publisher":{"@id":"https:\/\/itviec.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/itviec.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"vi"},{"@type":"Organization","@id":"https:\/\/itviec.com\/blog\/#organization","name":"ITviec","url":"https:\/\/itviec.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/itviec.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2018\/12\/itviec-black-square-facebook.png","contentUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2018\/12\/itviec-black-square-facebook.png","width":1800,"height":1800,"caption":"ITviec"},"image":{"@id":"https:\/\/itviec.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/ITviec","https:\/\/x.com\/ITviec","https:\/\/www.linkedin.com\/company\/itviec","https:\/\/www.youtube.com\/channel\/UCYthAQ3bcGr57M_ag5gHDvQ"]},{"@type":"Person","@id":"https:\/\/itviec.com\/blog\/#\/schema\/person\/1595d671c49cfa2a48cd3c0a047a1298","name":"Tien Tran","image":{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/05\/tien-tran-author-e1715658627643-100x100.jpg","url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/05\/tien-tran-author-e1715658627643-100x100.jpg","contentUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/05\/tien-tran-author-e1715658627643-100x100.jpg","caption":"Tien Tran"},"url":"https:\/\/itviec.com\/blog\/author\/tien-tran\/"}]}},"_links":{"self":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts\/89211","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/users\/203"}],"replies":[{"embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/comments?post=89211"}],"version-history":[{"count":5,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts\/89211\/revisions"}],"predecessor-version":[{"id":89358,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts\/89211\/revisions\/89358"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/media\/89357"}],"wp:attachment":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/media?parent=89211"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/categories?post=89211"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/tags?post=89211"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}