{"id":31641,"date":"2023-06-29T13:26:28","date_gmt":"2023-06-29T06:26:28","guid":{"rendered":"https:\/\/itviec.com\/blog\/?p=31641"},"modified":"2024-09-20T14:22:45","modified_gmt":"2024-09-20T07:22:45","slug":"mongodb-la-gi","status":"publish","type":"post","link":"https:\/\/itviec.com\/blog\/mongodb-la-gi\/","title":{"rendered":"MongoDB l\u00e0 g\u00ec? \u0110\u1ecbnh ngh\u0129a v\u00e0 Hi\u1ec3u r\u00f5 A-Z v\u1ec1 MongoDB"},"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\/mongodb-la-gi\/#MongoDB_la_gi\" >MongoDB l\u00e0 g\u00ec?<\/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\/mongodb-la-gi\/#Cong_dung_cua_MongoDB\" >C\u00f4ng d\u1ee5ng c\u1ee7a MongoDB<\/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\/mongodb-la-gi\/#Cac_thuat_ngu_MongoDB_thuong_dung\" >C\u00e1c thu\u1eadt ng\u1eef MongoDB th\u01b0\u1eddng d\u00f9ng<\/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\/mongodb-la-gi\/#Moi_tuong_quan_giua_thuat_ngu_MongoDB_va_RDBMS\" >M\u1ed1i t\u01b0\u01a1ng quan gi\u1eefa thu\u1eadt ng\u1eef MongoDB v\u00e0 RDBMS<\/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\/mongodb-la-gi\/#MongoDB_hoat_dong_nhu_the_nao\" >MongoDB ho\u1ea1t \u0111\u1ed9ng nh\u01b0 th\u1ebf n\u00e0o?<\/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\/mongodb-la-gi\/#Uu_diem_va_khuyet_diem_cua_MongoDB\" >\u01afu \u0111i\u1ec3m v\u00e0 khuy\u1ebft \u0111i\u1ec3m c\u1ee7a MongoDB<\/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\/mongodb-la-gi\/#So_sanh_MongoDB_va_MySQL\" >So s\u00e1nh MongoDB v\u00e0 MySQL<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/itviec.com\/blog\/mongodb-la-gi\/#Cac_cau_hoi_MongoDB_thuong_gap\" >C\u00e1c c\u00e2u h\u1ecfi MongoDB th\u01b0\u1eddng g\u1eb7p<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/itviec.com\/blog\/mongodb-la-gi\/#Tong_ket\" >T\u1ed5ng k\u1ebft<\/a><\/li><\/ul><\/nav><\/div>\n<p><b><i>\u0110\u01b0\u1ee3c ph\u00e1t h\u00e0nh l\u1ea7n \u0111\u1ea7u v\u00e0o th\u00e1ng 2 n\u0103m 2009, MongoDB l\u00e0 m\u1ed9t c\u01a1 s\u1edf d\u1eef li\u1ec7u h\u01b0\u1edbng document m\u00e3 ngu\u1ed3n m\u1edf \u0111\u01b0\u1ee3c thi\u1ebft k\u1ebf \u0111\u1ec3 l\u01b0u tr\u1eef m\u1ed9t l\u01b0\u1ee3ng l\u1edbn d\u1eef li\u1ec7u v\u00e0 cho ph\u00e9p b\u1ea1n l\u00e0m vi\u1ec7c v\u1edbi ngu\u1ed3n d\u1eef li\u1ec7u \u0111\u00f3 m\u1ed9t c\u00e1ch hi\u1ec7u qu\u1ea3. Nh\u01b0ng \u0111i\u1ec1u g\u00ec th\u1eadt s\u1ef1 khi\u1ebfn MongoDB n\u1ed5i b\u1eadt gi\u1eefa c\u00e1c ph\u1ea7n m\u1ec1m qu\u1ea3n l\u00fd c\u01a1 s\u1edf d\u1eef li\u1ec7u kh\u00e1c?<\/i><\/b><\/p>\n<p>\u0110\u1ecdc b\u00e0i vi\u1ebft n\u00e0y \u0111\u1ec3 hi\u1ec3u r\u00f5 h\u01a1n:<\/p>\n<ul>\n<li aria-level=\"1\">MongoDB l\u00e0 g\u00ec?<\/li>\n<li aria-level=\"1\">C\u00e1ch MongoDB l\u01b0u tr\u1eef d\u1eef li\u1ec7u v\u00e0 ho\u1ea1t \u0111\u1ed9ng<\/li>\n<li aria-level=\"1\">\u01afu \u0111i\u1ec3m v\u00e0 Khuy\u1ebft \u0111i\u1ec3m c\u1ee7a MongoDB<\/li>\n<li aria-level=\"1\">Nh\u1eefng c\u00e2u h\u1ecfi MongoDB th\u01b0\u1eddng g\u1eb7p<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"MongoDB_la_gi\"><\/span><b> MongoDB l\u00e0 g\u00ec?<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><b>MongoDB<\/b> l\u00e0 m\u1ed9t ph\u1ea7n m\u1ec1m m\u00e3 ngu\u1ed3n m\u1edf d\u00f9ng \u0111\u1ec3 qu\u1ea3n tr\u1ecb c\u01a1 s\u1edf d\u1eef li\u1ec7u NoSQL.<\/p>\n<blockquote><p><i>NoSQL (Not only SQL) \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng thay th\u1ebf cho c\u01a1 s\u1edf d\u1eef li\u1ec7u quan h\u1ec7 (Relational Database &#8211; RDB) truy\u1ec1n th\u1ed1ng. C\u01a1 s\u1edf d\u1eef li\u1ec7u NoSQL kh\u00e1 h\u1eefu \u00edch trong khi l\u00e0m vi\u1ec7c v\u1edbi c\u00e1c t\u1eadp d\u1eef li\u1ec7u ph\u00e2n t\u00e1n l\u1edbn. MongoDB l\u00e0 m\u1ed9t c\u00f4ng c\u1ee5 c\u00f3 th\u1ec3 qu\u1ea3n l\u00fd th\u00f4ng tin h\u01b0\u1edbng document c\u0169ng nh\u01b0 l\u01b0u tr\u1eef ho\u1eb7c truy xu\u1ea5t th\u00f4ng tin.<\/i><\/p>\n<p><i>Trong khi \u0111\u00f3, ng\u00f4n ng\u1eef truy v\u1ea5n c\u00f3 c\u1ea5u tr\u00fac (<\/i><a href=\"https:\/\/itviec.com\/blog\/sql-la-gi\/\" target=\"_blank\" rel=\"noopener\"><i>SQL<\/i><\/a><i>) l\u00e0 ng\u00f4n ng\u1eef l\u1eadp tr\u00ecnh \u0111\u01b0\u1ee3c ti\u00eau chu\u1ea9n h\u00f3a, d\u00f9ng \u0111\u1ec3 qu\u1ea3n l\u00fd c\u01a1 s\u1edf d\u1eef li\u1ec7u quan h\u1ec7. D\u1eef li\u1ec7u \u0111\u01b0\u1ee3c chu\u1ea9n h\u00f3a SQL d\u01b0\u1edbi d\u1ea1ng schema v\u00e0 table v\u00e0 m\u1ecdi table \u0111\u1ec1u c\u00f3 c\u1ea5u tr\u00fac c\u1ed1 \u0111\u1ecbnh.<\/i><\/p><\/blockquote>\n<p>Hi\u1ec7n nay, c\u00f3 nhi\u1ec1u c\u00f4ng ty to\u00e0n c\u1ea7u s\u1eed d\u1ee5ng MongoDB \u0111\u1ec3 l\u01b0u tr\u1eef l\u01b0\u1ee3ng d\u1eef li\u1ec7u \u201ckh\u1ed5ng l\u1ed3&#8221; c\u1ee7a h\u1ecd nh\u01b0 Facebook, Nokia, eBay, Adobe, Google,\u2026<\/p>\n<blockquote><p><em><a href=\"https:\/\/itviec.com\/it-jobs\/mongodb?utm_medium=anchor_text_mid&amp;utm_source=blog_&amp;utm_campaign=viec_lam_mongodb&amp;utm_content=mongodb_la_gi\" target=\"_blank\" rel=\"noopener\">Vi\u1ec7c l\u00e0m MongoDB<\/a> &#8220;ch\u1ea5t&#8221; to\u00e0n qu\u1ed1c tr\u00ean ITviec!<\/em><\/p><\/blockquote>\n<h2><span class=\"ez-toc-section\" id=\"Cong_dung_cua_MongoDB\"><\/span><strong>C\u00f4ng d\u1ee5ng c\u1ee7a MongoDB<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">MongoDB gi\u00fap c\u00e1c t\u1ed5 ch\u1ee9c l\u01b0u tr\u1eef l\u01b0\u1ee3ng l\u1edbn d\u1eef li\u1ec7u trong khi v\u1eabn ho\u1ea1t \u0111\u1ed9ng nhanh ch\u00f3ng. Ngo\u00e0i l\u01b0u tr\u1eef d\u1eef li\u1ec7u, MongoDB c\u00f2n \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng trong c\u00e1c tr\u01b0\u1eddng h\u1ee3p sau:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">T\u00edch h\u1ee3p m\u1ed9t l\u01b0\u1ee3ng l\u1edbn d\u1eef li\u1ec7u \u0111a d\u1ea1ng<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">M\u00f4 t\u1ea3 c\u00e1c c\u1ea5u tr\u00fac d\u1eef li\u1ec7u ph\u1ee9c t\u1ea1p, bi\u1ebfn ho\u00e1<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Cung c\u1ea5p d\u1eef li\u1ec7u cho c\u00e1c \u1ee9ng d\u1ee5ng hi\u1ec7u su\u1ea5t cao<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">H\u1ed7 tr\u1ee3 c\u00e1c \u1ee9ng d\u1ee5ng <a href=\"https:\/\/itviec.com\/blog\/dien-toan-dam-may\/\" target=\"_blank\" rel=\"noopener\">\u0111\u00e1m m\u00e2y lai<\/a> v\u00e0 \u0111a \u0111\u00e1m m\u00e2y<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\">H\u1ed7 tr\u1ee3 ph\u01b0\u01a1ng ph\u00e1p ph\u00e1t tri\u1ec3n <a href=\"https:\/\/itviec.com\/blog\/agile-la-gi-scrum-la-gi\/\" target=\"_blank\" rel=\"noopener\">Agile<\/a><\/li>\n<\/ul>\n<p>Thay v\u00ec s\u1eed d\u1ee5ng c\u00e1c table v\u00e0 row nh\u01b0 trong c\u01a1 s\u1edf d\u1eef li\u1ec7u quan h\u1ec7, v\u00ec l\u00e0 c\u01a1 s\u1edf d\u1eef li\u1ec7u NoSQL, MongoDB \u0111\u01b0\u1ee3c t\u1ea1o th\u00e0nh t\u1eeb collection v\u00e0 document. Document \u0111\u01b0\u1ee3c t\u1ea1o th\u00e0nh t\u1eeb c\u00e1c c\u1eb7p kh\u00f3a-gi\u00e1 tr\u1ecb (l\u00e0 \u0111\u01a1n v\u1ecb d\u1eef li\u1ec7u c\u01a1 b\u1ea3n c\u1ee7a MongoDB). C\u00f2n collection, t\u01b0\u01a1ng \u0111\u01b0\u01a1ng v\u1edbi table trong SQL, l\u00e0 n\u01a1i ch\u1ee9a c\u00e1c b\u1ed9 document.<\/p>\n<p>\u0110\u1ec3 hi\u1ec3u r\u00f5 h\u01a1n v\u1ec1 c\u00e1ch MongoDB l\u01b0u tr\u1eef d\u1eef li\u1ec7u, b\u1ea1n \u0111\u1ecdc ti\u1ebfp trong ph\u1ea7n ti\u1ebfp theo nh\u00e9.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Cac_thuat_ngu_MongoDB_thuong_dung\"><\/span><b> C\u00e1c thu\u1eadt ng\u1eef MongoDB th\u01b0\u1eddng d\u00f9ng<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><b>_id<\/b><\/h3>\n<p>_id l\u00e0 m\u1ed9t tr\u01b0\u1eddng b\u1eaft bu\u1ed9c trong m\u1ecdi document c\u1ee7a MongoDB. _id \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng \u0111\u1ec3 \u0111\u1ea1i di\u1ec7n cho t\u00ednh duy nh\u1ea5t c\u1ee7a m\u1ed9t document trong m\u1ed9t collection. Tr\u01b0\u1eddng _id ho\u1ea1t \u0111\u1ed9ng gi\u1ed1ng nh\u01b0 kh\u00f3a ch\u00ednh (primary key) c\u1ee7a document.<\/p>\n<p>_id l\u00e0 m\u1ed9t s\u1ed1 th\u1eadp l\u1ee5c ph\u00e2n 12 byte \u0111\u1ea3m b\u1ea3o t\u00ednh duy nh\u1ea5t c\u1ee7a m\u1ecdi document. B\u1ea1n c\u00f3 th\u1ec3 cung c\u1ea5p _id trong khi ch\u00e8n document. Trong 12 byte n\u00e0y:<\/p>\n<ul>\n<li aria-level=\"1\">4 byte \u0111\u1ea7u ti\u00ean \u0111\u1ea1i di\u1ec7n cho th\u1eddi \u0111i\u1ec3m hi\u1ec7n t\u1ea1i (d\u1ef1a tr\u00ean h\u1ec7 gi\u00e2y c\u1ee7a Unix Epoch);<\/li>\n<li aria-level=\"1\">3 byte ti\u1ebfp theo cho id m\u00e1y;<\/li>\n<li aria-level=\"1\">2 byte ti\u1ebfp theo cho process id c\u1ee7a m\u00e1y ch\u1ee7 MongoDB;<\/li>\n<li aria-level=\"1\">3 byte cu\u1ed1i c\u00f9ng l\u00e0 gi\u00e1 tr\u1ecb gia t\u0103ng \u0111\u01a1n gi\u1ea3n.<\/li>\n<\/ul>\n<p>N\u1ebfu b\u1ea1n kh\u00f4ng cung c\u1ea5p \u0111\u01b0\u1ee3c s\u1ed1 id th\u00ec MongoDB s\u1ebd t\u1ef1 \u0111\u1ed9ng cung c\u1ea5p m\u1ed9t id duy nh\u1ea5t cho document c\u1ee7a b\u1ea1n.<\/p>\n<h3><b>Document<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Document l\u00e0 \u0111\u01a1n v\u1ecb l\u01b0u tr\u1eef d\u1eef li\u1ec7u c\u01a1 b\u1ea3n trong c\u01a1 s\u1edf d\u1eef li\u1ec7u MongoDB. Document mang vai tr\u00f2 t\u01b0\u01a1ng t\u1ef1 nh\u01b0 row trong c\u00e1c h\u1ec7 th\u1ed1ng c\u01a1 s\u1edf d\u1eef li\u1ec7u quan h\u1ec7 truy\u1ec1n th\u1ed1ng.<\/span><b><\/b><\/p>\n<p><span style=\"font-weight: 400;\">Document l\u00e0 m\u1ed9t c\u00e1ch \u0111\u1ec3 s\u1eafp x\u1ebfp v\u00e0 l\u01b0u tr\u1eef d\u1eef li\u1ec7u d\u01b0\u1edbi d\u1ea1ng m\u1ed9t t\u1eadp h\u1ee3p c\u00e1c c\u1eb7p field-value. Document trong MongoDB kh\u00f4ng c\u1ea7n ph\u1ea3i c\u00f3 c\u00f9ng m\u1ed9t b\u1ed9 field ho\u1eb7c c\u1ea5u tr\u00fac v\u1edbi c\u00e1c document kh\u00e1c trong c\u00f9ng m\u1ed9t collection.<\/span><b><\/b><\/p>\n<p><span style=\"font-weight: 400;\">\u0110\u1ed3ng th\u1eddi, c\u00e1c field chung trong document c\u1ee7a m\u1ed9t collection c\u00f3 th\u1ec3 ch\u1ee9a c\u00e1c lo\u1ea1i d\u1eef li\u1ec7u kh\u00e1c nhau.<\/span><\/p>\n<h3><b>Collection<\/b><\/h3>\n<p>Collection l\u00e0 m\u1ed9t t\u1eadp h\u1ee3p c\u00e1c document MongoDB. Collection t\u01b0\u01a1ng t\u1ef1 nh\u01b0 table trong h\u1ec7 th\u1ed1ng c\u01a1 s\u1edf d\u1eef li\u1ec7u quan h\u1ec7. C\u00e1c collection c\u00f3 t\u00ednh ch\u1ea5t schema less, do \u0111\u00f3 c\u00e1c document trong c\u00f9ng m\u1ed9t collection c\u00f3 th\u1ec3 c\u00f3 c\u00e1c tr\u01b0\u1eddng kh\u00e1c nhau.<\/p>\n<p>Th\u00f4ng th\u01b0\u1eddng, m\u1ed9t collection ch\u1ee9a c\u00e1c document c\u00f3 m\u1ee5c \u0111\u00edch t\u01b0\u01a1ng t\u1ef1 ho\u1eb7c li\u00ean quan v\u1edbi nhau.<\/p>\n<h3><b>Database<\/b><\/h3>\n<p>Trong MongoDB, database l\u00e0 m\u1ed9t container v\u1eadt l\u00fd ch\u1ee9a t\u1eadp h\u1ee3p c\u00e1c collection. M\u1ed9t database c\u00f3 th\u1ec3 ch\u1ee9a 0 collection ho\u1eb7c nhi\u1ec1u collection.<\/p>\n<p>M\u1ed9t phi\u00ean b\u1ea3n m\u00e1y ch\u1ee7 MongoDB c\u00f3 th\u1ec3 l\u01b0u tr\u1eef nhi\u1ec1u database v\u00e0 kh\u00f4ng c\u00f3 gi\u1edbi h\u1ea1n v\u1ec1 s\u1ed1 l\u01b0\u1ee3ng database c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c l\u01b0u tr\u1eef tr\u00ean m\u1ed9t phi\u00ean b\u1ea3n, nh\u01b0ng gi\u1edbi h\u1ea1n \u1edf kh\u00f4ng gian b\u1ed9 nh\u1edb \u1ea3o c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c ph\u00e2n b\u1ed5 b\u1edfi h\u1ec7 \u0111i\u1ec1u h\u00e0nh.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Moi_tuong_quan_giua_thuat_ngu_MongoDB_va_RDBMS\"><\/span><b>M\u1ed1i t\u01b0\u01a1ng quan gi\u1eefa thu\u1eadt ng\u1eef MongoDB v\u00e0 RDBMS<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<table>\n<tbody>\n<tr>\n<td><b>RDBMS<\/b><\/td>\n<td><b>MongoDB<\/b><\/td>\n<\/tr>\n<tr>\n<td>Database<\/td>\n<td>Database<\/td>\n<\/tr>\n<tr>\n<td>Table<\/td>\n<td>Collection<\/td>\n<\/tr>\n<tr>\n<td>Tuple\/Row<\/td>\n<td>Document<\/td>\n<\/tr>\n<tr>\n<td>Column<\/td>\n<td>Field<\/td>\n<\/tr>\n<tr>\n<td>Table Join<\/td>\n<td>Embedded Documents<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">Primary Key<\/td>\n<td style=\"text-align: center;\">Primary Key (Kh\u00f3a m\u1eb7c \u0111\u1ecbnh _id do ch\u00ednh MongoDB cung c\u1ea5p)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<blockquote><p><em><a href=\"https:\/\/itviec.com\/it-jobs\/mongodb\/ho-chi-minh-hcm?utm_medium=anchor_text_mid&amp;utm_source=blog_&amp;utm_campaign=viec_lam_mongodb_o_tphcm&amp;utm_content=mongodb_la_gi\" target=\"_blank\" rel=\"noopener\">Vi\u1ec7c l\u00e0m MongoDB \u1edf TP. HCM<\/a> &#8220;ch\u1ea5t&#8221; tr\u00ean ITviec!<\/em><\/p>\n<p><em><a href=\"https:\/\/itviec.com\/it-jobs\/mongodb\/ha-noi?utm_medium=anchor_text_mid&amp;utm_source=blog_&amp;utm_campaign=viec_lam_mongodb_o_ha_noi&amp;utm_content=mongodb_la_gi\" target=\"_blank\" rel=\"noopener\">Vi\u1ec7c l\u00e0m MongoDB \u1edf H\u00e0 N\u1ed9i<\/a> &#8220;ch\u1ea5t&#8221; tr\u00ean ITviec!<\/em><\/p>\n<p><em><a href=\"https:\/\/itviec.com\/it-jobs\/mongodb\/da-nang?utm_medium=anchor_text_mid&amp;utm_source=blog_&amp;utm_campaign=viec_lam_mongodb_o_da_nang&amp;utm_content=mongodb_la_gi\" target=\"_blank\" rel=\"noopener\">Vi\u1ec7c l\u00e0m MongoDB \u1edf \u0110\u00e0 N\u1eb5ng<\/a>&#8220;ch\u1ea5t&#8221; tr\u00ean ITviec!<\/em><\/p><\/blockquote>\n<h2><span class=\"ez-toc-section\" id=\"MongoDB_hoat_dong_nhu_the_nao\"><\/span><b>MongoDB ho\u1ea1t \u0111\u1ed9ng nh\u01b0 th\u1ebf n\u00e0o?<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><b> MongoDB l\u01b0u tr\u1eef d\u1eef li\u1ec7u nh\u01b0 th\u1ebf n\u00e0o?<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Nh\u01b0 ch\u00fang ta bi\u1ebft r\u1eb1ng MongoDB l\u00e0 m\u1ed9t m\u00e1y ch\u1ee7 c\u01a1 s\u1edf d\u1eef li\u1ec7u v\u00e0 d\u1eef li\u1ec7u \u0111\u01b0\u1ee3c l\u01b0u tr\u1eef trong c\u00e1c c\u01a1 s\u1edf d\u1eef li\u1ec7u n\u00e0y. Hay n\u00f3i c\u00e1ch kh\u00e1c, m\u00f4i tr\u01b0\u1eddng MongoDB cung c\u1ea5p cho b\u1ea1n m\u1ed9t m\u00e1y ch\u1ee7 m\u00e0 b\u1ea1n c\u00f3 th\u1ec3 kh\u1edfi \u0111\u1ed9ng v\u00e0 sau \u0111\u00f3 t\u1ea1o nhi\u1ec1u c\u01a1 s\u1edf d\u1eef li\u1ec7u tr\u00ean \u0111\u00f3 b\u1eb1ng MongoDB.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Nh\u1edd v\u00e0o c\u01a1 s\u1edf d\u1eef li\u1ec7u NoSQL, <strong>d\u1eef li\u1ec7u \u0111\u01b0\u1ee3c l\u01b0u tr\u1eef d\u01b0\u1edbi d\u1ea1ng collection v\u00e0 document<\/strong>. Do \u0111\u00f3, c\u01a1 s\u1edf d\u1eef li\u1ec7u, collection v\u00e0 document c\u00f3 m\u1ed1i li\u00ean h\u1ec7 v\u1edbi nhau nh\u01b0 h\u00ecnh d\u01b0\u1edbi \u0111\u00e2y:<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-31950 size-full\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2023\/06\/mongodb-data-structure.png\" alt=\"mongodb document collection database\" width=\"1920\" height=\"1080\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2023\/06\/mongodb-data-structure.png 640w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2023\/06\/mongodb-data-structure-300x169.png 300w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2023\/06\/mongodb-data-structure-200x113.png 200w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2023\/06\/mongodb-data-structure-100x56.png 100w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">Trong m\u00e1y ch\u1ee7 MongoDB, b\u1ea1n c\u00f3 th\u1ec3 t\u1ea1o nhi\u1ec1u c\u01a1 s\u1edf d\u1eef li\u1ec7u v\u00e0 nhi\u1ec1u collection.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">C\u00e1ch c\u01a1 s\u1edf d\u1eef li\u1ec7u MongoDB ch\u1ee9a c\u00e1c collection c\u0169ng gi\u1ed1ng nh\u01b0 c\u00e1ch c\u01a1 s\u1edf d\u1eef li\u1ec7u MySQL ch\u1ee9a c\u00e1c table.<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>B\u00ean trong collection, ch\u00fang ta c\u00f3 document.<\/strong> C\u00e1c document n\u00e0y ch\u1ee9a d\u1eef li\u1ec7u m\u00e0 b\u1ea1n mu\u1ed1n l\u01b0u tr\u1eef trong c\u01a1 s\u1edf d\u1eef li\u1ec7u MongoDB v\u00e0 m\u1ed9t collection c\u00f3 th\u1ec3 ch\u1ee9a nhi\u1ec1u document. \u0110\u1ed3ng th\u1eddi, v\u1edbi t\u00ednh ch\u1ea5t schema-less (kh\u00f4ng c\u1ea7n m\u1ed9t c\u1ea5u tr\u00fac l\u01b0u tr\u1eef d\u1eef li\u1ec7u), document n\u00e0y kh\u00f4ng nh\u1ea5t thi\u1ebft ph\u1ea3i gi\u1ed1ng v\u1edbi document kh\u00e1c.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">C\u00e1c document \u0111\u01b0\u1ee3c t\u1ea1o b\u1eb1ng c\u00e1ch s\u1eed d\u1ee5ng c\u00e1c field (tr\u01b0\u1eddng). C\u00e1c field l\u00e0 c\u00e1c c\u1eb7p kh\u00f3a-gi\u00e1 tr\u1ecb trong document, gi\u1ed1ng nh\u01b0 c\u00e1c column trong c\u01a1 s\u1edf d\u1eef li\u1ec7u quan h\u1ec7. Gi\u00e1 tr\u1ecb c\u1ee7a c\u00e1c field c\u00f3 th\u1ec3 l\u00e0 b\u1ea5t k\u1ef3 lo\u1ea1i d\u1eef li\u1ec7u BSON n\u00e0o nh\u01b0 double, string, boolean, v.v.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">MongoDB l\u01b0u tr\u1eef d\u1eef li\u1ec7u \u1edf \u0111\u1ecbnh d\u1ea1ng BSON document. \u1ede \u0111\u00e2y, BSON l\u00e0 \u0111\u1ea1i di\u1ec7n cho \u0111\u1ecbnh d\u1ea1ng m\u00e3 ho\u00e1 nh\u1ecb ph\u00e2n c\u1ee7a c\u00e1c t\u00e0i li\u1ec7u JSON (ch\u1eef B trong BSON l\u00e0 vi\u1ebft t\u1eaft c\u1ee7a Binary). Hay n\u00f3i c\u00e1ch kh\u00e1c, trong ph\u1ea7n backend, m\u00e1y ch\u1ee7 MongoDB chuy\u1ec3n \u0111\u1ed5i d\u1eef li\u1ec7u JSON th\u00e0nh d\u1ea1ng nh\u1ecb ph\u00e2n, \u0111\u01b0\u1ee3c g\u1ecdi l\u00e0 BSON, v\u00e0 BSON n\u00e0y c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c l\u01b0u tr\u1eef v\u00e0 truy v\u1ea5n hi\u1ec7u qu\u1ea3 h\u01a1n.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">K\u00edch th\u01b0\u1edbc t\u1ed1i \u0111a c\u1ee7a BSON document l\u00e0 16 MB.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Trong MongoDB document, b\u1ea1n \u0111\u01b0\u1ee3c ph\u00e9p l\u01b0u tr\u1eef d\u1eef li\u1ec7u l\u1ed3ng nhau. Vi\u1ec7c l\u1ed3ng d\u1eef li\u1ec7u n\u00e0y cho ph\u00e9p b\u1ea1n t\u1ea1o c\u00e1c m\u1ed1i quan h\u1ec7 ph\u1ee9c t\u1ea1p gi\u1eefa d\u1eef li\u1ec7u v\u00e0 l\u01b0u tr\u1eef ch\u00fang trong c\u00f9ng m\u1ed9t document, gi\u00fap cho qu\u00e1 tr\u00ecnh l\u00e0m vi\u1ec7c v\u00e0 t\u00ecm n\u1ea1p d\u1eef li\u1ec7u hi\u1ec7u qu\u1ea3 h\u01a1n so v\u1edbi SQL.<\/span><\/p>\n<h3><b> MongoDB ho\u1ea1t \u0111\u1ed9ng nh\u01b0 th\u1ebf n\u00e0o?<\/b><\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-31949 size-full\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2023\/06\/mongodb-works.png\" alt=\"c\u00e1ch mongodb ho\u1ea1t \u0111\u1ed9ng\" width=\"1255\" height=\"1661\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2023\/06\/mongodb-works.png 484w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2023\/06\/mongodb-works-227x300.png 227w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2023\/06\/mongodb-works-151x200.png 151w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2023\/06\/mongodb-works-76x100.png 76w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2023\/06\/mongodb-works-340x450.png 340w\" sizes=\"auto, (max-width: 1255px) 100vw, 1255px\" \/><\/p>\n<p>MongoDB ho\u1ea1t \u0111\u1ed9ng v\u1edbi hai layer:<\/p>\n<ul>\n<li aria-level=\"1\">Layer \u1ee8ng d\u1ee5ng<\/li>\n<li aria-level=\"1\">Layer D\u1eef li\u1ec7u<\/li>\n<\/ul>\n<p>Layer \u1ee8ng d\u1ee5ng c\u00f2n \u0111\u01b0\u1ee3c g\u1ecdi l\u00e0 Layer Tr\u1eebu t\u01b0\u1ee3ng Cu\u1ed1i c\u00f9ng (Final Abstraction Layer), g\u1ed3m hai ph\u1ea7n, \u0111\u1ea7u ti\u00ean l\u00e0 Front-end (Giao di\u1ec7n ng\u01b0\u1eddi d\u00f9ng) v\u00e0 th\u1ee9 hai l\u00e0 Back-end (m\u00e1y ch\u1ee7):<\/p>\n<ul>\n<li aria-level=\"1\"><strong>Giao di\u1ec7n ng\u01b0\u1eddi d\u00f9ng<\/strong> l\u00e0 n\u01a1i ng\u01b0\u1eddi d\u00f9ng s\u1eed d\u1ee5ng MongoDB v\u1edbi s\u1ef1 tr\u1ee3 gi\u00fap c\u1ee7a Web ho\u1eb7c Di \u0111\u1ed9ng. Web v\u00e0 thi\u1ebft b\u1ecb di \u0111\u1ed9ng n\u00e0y bao g\u1ed3m c\u00e1c trang web, \u1ee9ng d\u1ee5ng di \u0111\u1ed9ng, \u1ee9ng d\u1ee5ng m\u1eb7c \u0111\u1ecbnh c\u1ee7a Android, \u1ee9ng d\u1ee5ng iOS, v.v.<\/li>\n<li aria-level=\"1\">Ph\u1ea7n back-end ch\u1ee9a m\u1ed9t <strong>m\u00e1y ch\u1ee7<\/strong> \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng \u0111\u1ec3 th\u1ef1c hi\u1ec7n logic ph\u00eda m\u00e1y ch\u1ee7 v\u00e0 c\u0169ng ch\u1ee9a tr\u00ecnh \u0111i\u1ec1u khi\u1ec3n ho\u1eb7c MongoDB shell \u0111\u1ec3 t\u01b0\u01a1ng t\u00e1c v\u1edbi m\u00e1y ch\u1ee7 MongoDB v\u1edbi s\u1ef1 tr\u1ee3 gi\u00fap c\u1ee7a truy v\u1ea5n.<\/li>\n<\/ul>\n<blockquote><p><i><span style=\"font-weight: 400;\">MongoDB shell l\u00e0 m\u1ed9t b\u1ea3ng \u0111i\u1ec1u khi\u1ec3n JavaScript t\u01b0\u01a1ng t\u00e1c v\u1edbi MongoDB m\u00e0 b\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng \u0111\u1ec3 k\u1ebft n\u1ed1i v\u1edbi m\u00e1y ch\u1ee7 c\u01a1 s\u1edf d\u1eef li\u1ec7u v\u00e0 th\u1ef1c thi c\u00e1c l\u1ec7nh tr\u00ean \u0111\u00f3, cho ph\u00e9p b\u1ea1n th\u1ef1c hi\u1ec7n c\u00e1c t\u00e1c v\u1ee5 qu\u1ea3n tr\u1ecb v\u00e0 \u0111\u1ecdc, vi\u1ebft ho\u1eb7c thao t\u00e1c d\u1eef li\u1ec7u tr\u1ef1c ti\u1ebfp.<\/span><\/i><\/p><\/blockquote>\n<p><span style=\"font-weight: 400;\">C\u00e1c truy v\u1ea5n n\u00e0y \u0111\u01b0\u1ee3c g\u1eedi \u0111\u1ebfn m\u00e1y ch\u1ee7 MongoDB thu\u1ed9c Layer D\u1eef li\u1ec7u. B\u00e2y gi\u1edd, m\u00e1y ch\u1ee7 MongoDB nh\u1eadn c\u00e1c truy v\u1ea5n v\u00e0 chuy\u1ec3n c\u00e1c truy v\u1ea5n \u0111\u00e3 nh\u1eadn t\u1edbi c\u00f4ng c\u1ee5 l\u01b0u tr\u1eef v\u00ec b\u1ea3n th\u00e2n m\u00e1y ch\u1ee7 MongoDB kh\u00f4ng tr\u1ef1c ti\u1ebfp \u0111\u1ecdc ho\u1eb7c ghi d\u1eef li\u1ec7u v\u00e0o t\u1ec7p ho\u1eb7c \u0111\u0129a ho\u1eb7c b\u1ed9 nh\u1edb.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Sau khi chuy\u1ec3n c\u00e1c truy v\u1ea5n nh\u1eadn \u0111\u01b0\u1ee3c t\u1edbi b\u1ed9 m\u00e1y l\u01b0u tr\u1eef, b\u1ed9 m\u00e1y l\u01b0u tr\u1eef ch\u1ecbu tr\u00e1ch nhi\u1ec7m \u0111\u1ecdc ho\u1eb7c ghi d\u1eef li\u1ec7u trong t\u1ec7p ho\u1eb7c b\u1ed9 nh\u1edb.<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Uu_diem_va_khuyet_diem_cua_MongoDB\"><\/span><b> \u01afu \u0111i\u1ec3m v\u00e0 khuy\u1ebft \u0111i\u1ec3m c\u1ee7a MongoDB<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><b> \u01afu \u0111i\u1ec3m MongoDB<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">MongoDB mang \u0111\u1ebfn cho ng\u01b0\u1eddi s\u1eed d\u1ee5ng m\u1ed9t s\u1ed1 \u01b0u \u0111i\u1ec3m:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Kh\u00f4ng schema: <\/b><span style=\"font-weight: 400;\">Gi\u1ed1ng nh\u01b0 c\u00e1c c\u01a1 s\u1edf d\u1eef li\u1ec7u NoSQL kh\u00e1c, MongoDB kh\u00f4ng y\u00eau c\u1ea7u c\u00e1c schema \u0111\u01b0\u1ee3c x\u00e1c \u0111\u1ecbnh tr\u01b0\u1edbc.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>MongoDB l\u01b0u tr\u1eef b\u1ea5t k\u1ef3 lo\u1ea1i d\u1eef li\u1ec7u n\u00e0o:<\/b><span style=\"font-weight: 400;\"> \u0110i\u1ec1u n\u00e0y cho ph\u00e9p ng\u01b0\u1eddi d\u00f9ng linh ho\u1ea1t t\u1ea1o s\u1ed1 l\u01b0\u1ee3ng tr\u01b0\u1eddng trong document theo nhu c\u1ea7u, v\u00e0 gi\u00fap vi\u1ec7c m\u1edf r\u1ed9ng c\u01a1 s\u1edf d\u1eef li\u1ec7u MongoDB tr\u1edf n\u00ean d\u1ec5 d\u00e0ng h\u01a1n so v\u1edbi c\u01a1 s\u1edf d\u1eef li\u1ec7u quan h\u1ec7 truy\u1ec1n th\u1ed1ng.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>H\u01b0\u1edbng document: <\/b><span style=\"font-weight: 400;\">M\u1ed9t trong nh\u1eefng \u01b0u \u0111i\u1ec3m c\u1ee7a vi\u1ec7c s\u1eed d\u1ee5ng document l\u00e0 c\u00e1c \u0111\u1ed1i t\u01b0\u1ee3ng n\u00e0y \u00e1nh x\u1ea1 t\u1edbi c\u00e1c ki\u1ec3u d\u1eef li\u1ec7u g\u1ed1c trong m\u1ed9t s\u1ed1 ng\u00f4n ng\u1eef l\u1eadp tr\u00ecnh. Vi\u1ec7c c\u00f3 c\u00e1c document \u0111\u01b0\u1ee3c nh\u00fang c\u0169ng l\u00e0m gi\u1ea3m nhu c\u1ea7u k\u1ebft n\u1ed1i c\u01a1 s\u1edf d\u1eef li\u1ec7u, \u0111i\u1ec1u n\u00e0y c\u00f3 th\u1ec3 l\u00e0m gi\u1ea3m chi ph\u00ed.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Kh\u1ea3 n\u0103ng m\u1edf r\u1ed9ng: <\/b><span style=\"font-weight: 400;\">Ki\u1ebfn tr\u00fac m\u1edf r\u1ed9ng theo chi\u1ec1u ngang c\u1ee7a MongoDB gi\u00fap b\u1ea1n t\u1ea1o ra m\u1ed9t \u1ee9ng d\u1ee5ng c\u00f3 th\u1ec3 x\u1eed l\u00fd \u0111\u01b0\u1ee3c l\u01b0u l\u01b0\u1ee3ng truy c\u1eadp t\u0103ng \u0111\u1ed9t bi\u1ebfn khi doanh nghi\u1ec7p c\u1ee7a b\u1ea1n ph\u00e1t tri\u1ec3n. Ngo\u00e0i ra, vi\u1ec7c ph\u00e2n chia d\u1eef li\u1ec7u (sharding) cho ph\u00e9p c\u01a1 s\u1edf d\u1eef li\u1ec7u ph\u00e2n ph\u1ed1i d\u1eef li\u1ec7u tr\u00ean m\u1ed9t c\u1ee5m m\u00e1y. MongoDB c\u0169ng h\u1ed7 tr\u1ee3 t\u1ea1o v\u00f9ng d\u1eef li\u1ec7u d\u1ef1a tr\u00ean shard key.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>H\u1ed7 tr\u1ee3 b\u00ean th\u1ee9 ba:<\/b><span style=\"font-weight: 400;\"> MongoDB h\u1ed7 tr\u1ee3 m\u1ed9t s\u1ed1 c\u00f4ng c\u1ee5 l\u01b0u tr\u1eef v\u00e0 cung c\u1ea5p API c\u00f4ng c\u1ee5 l\u01b0u tr\u1eef c\u00f3 th\u1ec3 c\u1eafm \u0111\u01b0\u1ee3c (pluggable storage engine API) cho ph\u00e9p c\u00e1c b\u00ean th\u1ee9 ba ph\u00e1t tri\u1ec3n c\u00f4ng c\u1ee5 l\u01b0u tr\u1eef d\u1eef li\u1ec7u ri\u00eang.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Linh ho\u1ea1t l\u01b0u tr\u1eef t\u1ec7p dung l\u01b0\u1ee3ng l\u1edbn:<\/b> MongoDB ph\u00e1t tri\u1ec3n h\u1ec7 th\u1ed1ng t\u1ec7p ri\u00eang <b>GridFS<\/b>, g\u1ea7n gi\u1ed1ng v\u1edbi h\u1ec7 th\u1ed1ng t\u1ec7p ph\u00e2n t\u00e1n Hadoop. Vi\u1ec7c s\u1eed d\u1ee5ng h\u1ec7 th\u1ed1ng t\u1ec7p nh\u1eb1m \u0111\u1ec3 l\u01b0u tr\u1eef c\u00e1c t\u1ec7p v\u01b0\u1ee3t qua k\u00edch th\u01b0\u1edbc gi\u1edbi h\u1ea1n c\u1ee7a BSON (16 MB cho m\u1ed7i document).<\/li>\n<\/ul>\n<h3><b> Khuy\u1ebft \u0111i\u1ec3m MongoDB<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">M\u1eb7c d\u00f9 MongoDB mang l\u1ea1i nhi\u1ec1u gi\u00e1 tr\u1ecb l\u1edbn, c\u00f4ng c\u1ee5 n\u00e0y v\u1eabn c\u00f3 m\u1ed9t s\u1ed1 nh\u01b0\u1ee3c \u0111i\u1ec3m:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>T\u00ednh li\u00ean t\u1ee5c: <\/b><span style=\"font-weight: 400;\">V\u1edbi chi\u1ebfn l\u01b0\u1ee3c chuy\u1ec3n \u0111\u1ed5i d\u1ef1 ph\u00f2ng t\u1ef1 \u0111\u1ed9ng, ng\u01b0\u1eddi d\u00f9ng ch\u1ec9 c\u00f3 th\u1ec3 thi\u1ebft l\u1eadp m\u1ed9t node master trong c\u1ee5m MongoDB. N\u1ebfu node master b\u1ecb l\u1ed7i, m\u1ed9t node kh\u00e1c s\u1ebd t\u1ef1 \u0111\u1ed9ng chuy\u1ec3n \u0111\u1ed5i th\u00e0nh master m\u1edbi. Qu\u00e1 tr\u00ecnh chuy\u1ec3n \u0111\u1ed5i n\u00e0y \u0111\u1ea3m b\u1ea3o t\u00ednh li\u00ean t\u1ee5c, nh\u01b0ng kh\u00f4ng di\u1ec5n ra t\u1ee9c th\u1eddi m\u00e0 c\u00f3 th\u1ec3 m\u1ea5t t\u1edbi m\u1ed9t ph\u00fat.<\/span><\/li>\n<\/ul>\n<blockquote><p><i><span style=\"font-weight: 400;\">\u0110\u1ec3 b\u1ea1n d\u1ec5 so s\u00e1nh, b\u1ea1n c\u00f3 th\u1ec3 l\u1ea5y c\u01a1 s\u1edf d\u1eef li\u1ec7u <\/span><\/i><a href=\"https:\/\/cassandra.apache.org\/_\/index.html\" target=\"_blank\" rel=\"noopener\"><i><span style=\"font-weight: 400;\">Cassandra NoSQL<\/span><\/i><\/a><i><span style=\"font-weight: 400;\"> h\u1ed7 tr\u1ee3 nhi\u1ec1u node master l\u00e0m v\u00ed d\u1ee5. V\u1edbi Cassandra NoSQL, n\u1ebfu m\u1ed9t master ng\u1eebng ho\u1ea1t \u0111\u1ed9ng, m\u1ed9t master kh\u00e1c s\u1ebd s\u1eb5n s\u00e0ng, t\u1ea1o ra c\u01a1 s\u1edf h\u1ea1 t\u1ea7ng c\u01a1 s\u1edf d\u1eef li\u1ec7u c\u00f3 t\u00ednh s\u1eb5n s\u00e0ng cao.<\/span><\/i><\/p><\/blockquote>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Gi\u1edbi h\u1ea1n ghi:<\/b><span style=\"font-weight: 400;\"> Node master duy nh\u1ea5t c\u1ee7a MongoDB c\u0169ng l\u00e0m gi\u1edbi h\u1ea1n l\u1ea1i t\u1ed1c \u0111\u1ed9 ghi d\u1eef li\u1ec7u v\u00e0o c\u01a1 s\u1edf d\u1eef li\u1ec7u. Vi\u1ec7c ghi d\u1eef li\u1ec7u ph\u1ea3i \u0111\u01b0\u1ee3c ghi tr\u00ean node master v\u00e0 vi\u1ec7c ghi th\u00f4ng tin m\u1edbi v\u00e0o c\u01a1 s\u1edf d\u1eef li\u1ec7u b\u1ecb gi\u1edbi h\u1ea1n b\u1edfi kh\u1ea3 n\u0103ng c\u1ee7a node master \u0111\u00f3.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>T\u00ednh nh\u1ea5t qu\u00e1n c\u1ee7a d\u1eef li\u1ec7u: <\/b><span style=\"font-weight: 400;\">MongoDB kh\u00f4ng cung c\u1ea5p t\u00ednh to\u00e0n v\u1eb9n tham chi\u1ebfu \u0111\u1ea7y \u0111\u1ee7 th\u00f4ng qua vi\u1ec7c s\u1eed d\u1ee5ng c\u00e1c r\u00e0ng bu\u1ed9c kh\u00f3a ngo\u1ea1i (foreign-key), \u0111i\u1ec1u n\u00e0y c\u00f3 th\u1ec3 \u1ea3nh h\u01b0\u1edfng \u0111\u1ebfn t\u00ednh nh\u1ea5t qu\u00e1n c\u1ee7a d\u1eef li\u1ec7u.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>B\u1ea3o m\u1eadt:<\/b> T\u00ednh n\u0103ng x\u00e1c th\u1ef1c ng\u01b0\u1eddi d\u00f9ng kh\u00f4ng \u0111\u01b0\u1ee3c m\u1eb7c \u0111\u1ecbnh b\u1eadt trong c\u01a1 s\u1edf d\u1eef li\u1ec7u MongoDB. \u0110\u1ec3 b\u1ea3o m\u1eadt h\u1ec7 th\u1ed1ng tr\u01b0\u1edbc c\u00e1c cu\u1ed9c t\u1ea5n c\u00f4ng c\u1ee7a tin t\u1eb7c, b\u1ea1n c\u00f3 th\u1ec3 th\u1ee7 c\u00f4ng thi\u1ebft l\u1eadp c\u00e1c c\u00e0i \u0111\u1eb7t ch\u1eb7n nh\u1eefng k\u1ebft n\u1ed1i l\u1ea1 v\u00e0 kh\u00f4ng an to\u00e0n.<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"So_sanh_MongoDB_va_MySQL\"><\/span><b> So s\u00e1nh MongoDB v\u00e0 MySQL<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>H\u00e3y so s\u00e1nh tr\u1ef1c ti\u1ebfp nh\u1eefng kh\u00e1i ni\u1ec7m c\u01a1 b\u1ea3n nh\u1ea5t c\u1ee7a hai c\u01a1 s\u1edf d\u1eef li\u1ec7u ph\u1ed5 bi\u1ebfn n\u00e0y:<\/p>\n<table>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><\/td>\n<td style=\"text-align: center;\"><b>MongoDB<\/b><\/td>\n<td style=\"text-align: center;\"><a href=\"https:\/\/itviec.com\/blog\/mysql-la-gi\/\" target=\"_blank\" rel=\"noopener\"><b>MySQL<\/b><\/a><\/td>\n<\/tr>\n<tr>\n<td><b>\u01afu ti\u00ean<\/b><\/td>\n<td>Th\u00e2n thi\u1ec7n v\u1edbi cloud<\/td>\n<td>M\u1ee9c \u0111\u1ed9 b\u1ea3o m\u1eadt d\u1eef li\u1ec7u cao<\/td>\n<\/tr>\n<tr>\n<td><b>C\u1ea5u tr\u00fac d\u1eef li\u1ec7u<\/b><\/td>\n<td>Kh\u00f4ng c\u1ea5u tr\u00fac, ho\u1eb7c c\u1ea5u tr\u00fac d\u1eef li\u1ec7u c\u00f3 ti\u1ec1m n\u0103ng ph\u00e1t tri\u1ec3n nhanh<\/td>\n<td>C\u00f3 c\u1ea5u tr\u00fac<\/td>\n<\/tr>\n<tr>\n<td><b>\u0110\u1ea1i di\u1ec7n d\u1eef li\u1ec7u<\/b><\/td>\n<td>JSON document<\/td>\n<td>Table v\u00e0 row<\/td>\n<\/tr>\n<tr>\n<td><b>H\u1ed7 tr\u1ee3 JOIN<\/b><\/td>\n<td>Kh\u00f4ng<\/td>\n<td>C\u00f3<\/td>\n<\/tr>\n<tr>\n<td><b>Ng\u00f4n ng\u1eef truy v\u1ea5n<\/b><\/td>\n<td>JavaScript<\/td>\n<td>SQL<\/td>\n<\/tr>\n<tr>\n<td><b>Schema<\/b><\/td>\n<td>Kh\u00f4ng c\u1ea7n schema<\/td>\n<td>C\u1ea7n x\u00e1c \u0111\u1ecbnh column v\u00e0 table<\/td>\n<\/tr>\n<tr>\n<td><b>Hi\u1ec7u su\u1ea5t ph\u00e1t tri\u1ec3n<\/b><\/td>\n<td>Nhanh<\/td>\n<td>Ch\u1eadm<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\"><b>T\u00ednh nguy\u00ean t\u1eed c\u1ee7a transaction<\/b><\/td>\n<td style=\"text-align: center;\">Kh\u00f4ng h\u1ed7 tr\u1ee3 \u0111\u1ea7y \u0111\u1ee7 t\u1ea5t c\u1ea3 c\u00e1c ho\u1ea1t \u0111\u1ed9ng nh\u01b0ng h\u1ed7 tr\u1ee3 c\u00e1c transaction \u0111a document<\/td>\n<td style=\"text-align: center;\">H\u1ed7 tr\u1ee3 t\u00ednh nguy\u00ean t\u1eed c\u1ee7a transaction<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2><span class=\"ez-toc-section\" id=\"Cac_cau_hoi_MongoDB_thuong_gap\"><\/span><b>C\u00e1c c\u00e2u h\u1ecfi MongoDB th\u01b0\u1eddng g\u1eb7p<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><b> Nh\u1eefng ng\u00f4n ng\u1eef \u0111\u01b0\u1ee3c h\u1ed7 tr\u1ee3 b\u1edfi MongoDB<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Nhi\u1ec1u developer \u0111\u00e1nh gi\u00e1 cao vi\u1ec7c MongoDB \u0111\u1ea3m b\u1ea3o r\u1eb1ng c\u01a1 s\u1edf d\u1eef li\u1ec7u c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng t\u1eeb nhi\u1ec1u ng\u00f4n ng\u1eef l\u1eadp tr\u00ecnh kh\u00e1c nhau, bao g\u1ed3m C, <\/span><a href=\"https:\/\/itviec.com\/blog\/lap-trinh-c-2\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">C# <\/span><\/a><span style=\"font-weight: 400;\">v\u00e0 .NET, <\/span><a href=\"https:\/\/itviec.com\/blog\/cpp-la-gi\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">C++<\/span><\/a><span style=\"font-weight: 400;\">, Go, <\/span><a href=\"https:\/\/itviec.com\/blog\/hoc-lap-trinh-java\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Java<\/span><\/a><span style=\"font-weight: 400;\">, JavaScript, PHP, <\/span><a href=\"https:\/\/itviec.com\/blog\/tai-lieu-lap-trinh-python\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Python<\/span><\/a><span style=\"font-weight: 400;\">, <\/span><a href=\"https:\/\/itviec.com\/blog\/ruby-on-rails-la-gi\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Ruby<\/span><\/a><span style=\"font-weight: 400;\">, Rust, Scala v\u00e0 Swift.<\/span><\/p>\n<h3><b> MongoDB c\u00f3 nh\u1eefng phi\u00ean b\u1ea3n n\u00e0o? T\u1ed1n ph\u00ed kh\u00f4ng?<\/b><\/h3>\n<p>MongoDB hi\u1ec7n cung c\u1ea5p 2 phi\u00ean b\u1ea3n ch\u00ednh l\u00e0: Community v\u00e0 Enterprise. MongoDB Community l\u00e0 phi\u00ean b\u1ea3n c\u01a1 b\u1ea3n v\u00e0 mi\u1ec5n ph\u00ed.<\/p>\n<p>Phi\u00ean b\u1ea3n MongoDB Community bao g\u1ed3m m\u1ed9t v\u00e0i t\u00ednh n\u0103ng nh\u01b0:<\/p>\n<ul>\n<li aria-level=\"1\">Ph\u00f9 h\u1ee3p v\u1edbi vi\u1ec7c h\u1ed7 tr\u1ee3 cho c\u00e1c \u1ee9ng d\u1ee5ng hi\u1ec7n \u0111\u1ea1i v\u00e0 kh\u1ed1i l\u01b0\u1ee3ng c\u00f4ng vi\u1ec7c nh\u1ecf h\u01a1n<\/li>\n<li aria-level=\"1\">Schema linh ho\u1ea1t<\/li>\n<li aria-level=\"1\">Ng\u00f4n ng\u1eef truy v\u1ea5n d\u1ef1a tr\u00ean JSON<\/li>\n<li aria-level=\"1\">T\u1ed5ng h\u1ee3p th\u1eddi gian th\u1ef1c<\/li>\n<li aria-level=\"1\">Sao ch\u00e9p t\u00edch h\u1ee3p v\u00e0 chuy\u1ec3n \u0111\u1ed5i d\u1ef1 ph\u00f2ng t\u1ef1 \u0111\u1ed9ng<\/li>\n<li aria-level=\"1\">Ph\u00e2n chia d\u1eef li\u1ec7u native<\/li>\n<li aria-level=\"1\">Truy v\u1ea5n \u0111\u1eb7c bi\u1ec7t<\/li>\n<li aria-level=\"1\">Mi\u1ec5n ph\u00ed<\/li>\n<\/ul>\n<p>MongoDB Enterprise l\u00e0 phi\u00ean b\u1ea3n c\u00f3 t\u00ednh ph\u00ed v\u00e0 \u0111i k\u00e8m v\u1edbi nhi\u1ec1u t\u00ednh n\u0103ng ph\u00f9 h\u1ee3p v\u1edbi c\u00e1c t\u1ed5 ch\u1ee9c l\u1edbn h\u01a1n v\u00e0 nh\u1eefng t\u1ed5 ch\u1ee9c c\u00f3 kh\u1ed1i l\u01b0\u1ee3ng c\u00f4ng vi\u1ec7c quan tr\u1ecdng, c\u1ee5 th\u1ec3:<\/p>\n<ul>\n<li aria-level=\"1\">Ph\u00f9 h\u1ee3p v\u1edbi c\u00e1c d\u1ef1 \u00e1n ph\u00e1t tri\u1ec3n v\u00e0 kh\u1ed1i l\u01b0\u1ee3ng c\u00f4ng vi\u1ec7c c\u1ea5p doanh nghi\u1ec7p<\/li>\n<li aria-level=\"1\">C\u00e1c t\u00ednh n\u0103ng b\u1ea3o m\u1eadt bao g\u1ed3m c\u00f4ng c\u1ee5 l\u01b0u tr\u1eef \u0111\u01b0\u1ee3c m\u00e3 h\u00f3a v\u00e0 ki\u1ec3m so\u00e1t truy c\u1eadp Kerberos<\/li>\n<li aria-level=\"1\">Tr\u1ef1c quan h\u00f3a d\u1eef li\u1ec7u tr\u1ef1c ti\u1ebfp t\u1eeb c\u01a1 s\u1edf d\u1eef li\u1ec7u<\/li>\n<li aria-level=\"1\">T\u00ednh kh\u1ea3 d\u1ee5ng cao v\u00e0 th\u00f4ng l\u01b0\u1ee3ng cao<\/li>\n<li aria-level=\"1\">C\u00f4ng c\u1ee5 l\u01b0u tr\u1eef trong b\u1ed9 nh\u1edb<\/li>\n<li aria-level=\"1\">Chi ph\u00ed kho\u1ea3ng $6000 &#8211; $13000 m\u1ed7i n\u0103m<\/li>\n<\/ul>\n<h3><b> MongoDB ph\u00f9 h\u1ee3p v\u1edbi nh\u1eefng n\u1ec1n t\u1ea3ng n\u00e0o?<\/b><\/h3>\n<p>MongoDB c\u00f3 th\u1ec3 ho\u1ea1t \u0111\u1ed9ng v\u1edbi c\u00e1c n\u1ec1n t\u1ea3ng g\u1ed3m Linux, macOS, Windows, <a href=\"https:\/\/itviec.com\/blog\/docker-la-gi\/\" target=\"_blank\" rel=\"noopener\">Docker<\/a>, cho c\u1ea3 phi\u00ean b\u1ea3n Community v\u00e0 phi\u00ean b\u1ea3n Enterprise. B\u1ea1n c\u00f3 th\u1ec3 theo d\u00f5i c\u1ee5 th\u1ec3 c\u00e1ch c\u00e0i \u0111\u1eb7t MongoDB tr\u00ean t\u1eebng n\u1ec1n t\u1ea3ng theo b\u1ea3ng sau:<\/p>\n<table>\n<tbody>\n<tr>\n<td><\/td>\n<td><b>Phi\u00ean b\u1ea3n Community<\/b><\/td>\n<td><b>Phi\u00ean b\u1ea3n Enterprise<\/b><\/td>\n<\/tr>\n<tr>\n<td><b>Linux<\/b><\/td>\n<td><a href=\"https:\/\/www.mongodb.com\/docs\/manual\/administration\/install-on-linux\/\" target=\"_blank\" rel=\"noopener\">H\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t v\u00e0 download MongoDB phi\u00ean b\u1ea3n Community tr\u00ean Linux<\/a><\/td>\n<td><a href=\"https:\/\/www.mongodb.com\/docs\/manual\/administration\/install-enterprise-linux\/\" target=\"_blank\" rel=\"noopener\">H\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t v\u00e0 download MongoDB phi\u00ean b\u1ea3n Enterprise tr\u00ean Linux<\/a><\/td>\n<\/tr>\n<tr>\n<td><b>macOS<\/b><\/td>\n<td><a href=\"https:\/\/www.mongodb.com\/docs\/manual\/tutorial\/install-mongodb-on-os-x\/\" target=\"_blank\" rel=\"noopener\">H\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t v\u00e0 download MongoDB phi\u00ean b\u1ea3n Community tr\u00ean macOS<\/a><\/td>\n<td><a href=\"https:\/\/www.mongodb.com\/docs\/manual\/tutorial\/install-mongodb-enterprise-on-os-x\/\" target=\"_blank\" rel=\"noopener\">H\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t v\u00e0 download MongoDB phi\u00ean b\u1ea3n Enterprise tr\u00ean macOS<\/a><\/td>\n<\/tr>\n<tr>\n<td><b>Windows<\/b><\/td>\n<td><a href=\"https:\/\/www.mongodb.com\/docs\/manual\/tutorial\/install-mongodb-on-windows\/\" target=\"_blank\" rel=\"noopener\">H\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t v\u00e0 download MongoDB phi\u00ean b\u1ea3n Community tr\u00ean Windows<\/a><\/td>\n<td><a href=\"https:\/\/www.mongodb.com\/docs\/manual\/tutorial\/install-mongodb-enterprise-on-windows\/\" target=\"_blank\" rel=\"noopener\">H\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t v\u00e0 download MongoDB phi\u00ean b\u1ea3n Enterprise tr\u00ean Windows<\/a><\/td>\n<\/tr>\n<tr>\n<td><b>Docker<\/b><\/td>\n<td><a href=\"https:\/\/www.mongodb.com\/docs\/manual\/tutorial\/install-mongodb-community-with-docker\/\" target=\"_blank\" rel=\"noopener\">H\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t v\u00e0 download MongoDB phi\u00ean b\u1ea3n Community tr\u00ean Docker<\/a><\/td>\n<td><a href=\"https:\/\/www.mongodb.com\/docs\/manual\/tutorial\/install-mongodb-enterprise-with-docker\/\" target=\"_blank\" rel=\"noopener\">H\u01b0\u1edbng d\u1eabn c\u00e0i \u0111\u1eb7t v\u00e0 download MongoDB phi\u00ean b\u1ea3n Enterprise tr\u00ean Docker<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2><span class=\"ez-toc-section\" id=\"Tong_ket\"><\/span><b>T\u1ed5ng k\u1ebft<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Qua b\u00e0i vi\u1ebft tr\u00ean, mong b\u1ea1n \u0111\u00e3 c\u00f3 th\u1ec3 hi\u1ec3u r\u00f5 \u0111\u01b0\u1ee3c MongoDB l\u00e0 g\u00ec, c\u00e1ch MongoDB ho\u1ea1t \u0111\u1ed9ng, nh\u1eefng \u01b0u \u0111i\u1ec3m v\u00e0 khuy\u1ebft \u0111i\u1ec3m khi s\u1eed d\u1ee5ng MongoDB,&#8230; \u0111\u1ec3 b\u1ea1n v\u00e0 doanh nghi\u1ec7p c\u00f3 th\u1ec3 \u0111\u01b0a ra quy\u1ebft \u0111\u1ecbnh \u0111\u00fang h\u01a1n tr\u01b0\u1edbc khi s\u1eed d\u1ee5ng ph\u1ea7n m\u1ec1m qu\u1ea3n l\u00fd c\u01a1 s\u1edf d\u1eef li\u1ec7u MongoDB.<\/p>\n<p>B\u1ea1n c\u00f3 th\u1ec3 t\u00ecm \u0111\u1ecdc <a href=\"https:\/\/www.mongodb.com\/docs\/atlas\/\" target=\"_blank\" rel=\"noopener\">MongoDB Documentation<\/a> \u0111\u1ec3 hi\u1ec3u th\u00eam v\u1ec1 ph\u1ea7n m\u1ec1m n\u00e0y nh\u00e9!<\/p>\n<p>T\u1ed5ng h\u1ee3p m\u1ed9t s\u1ed1 b\u00e0i vi\u1ebft hay v\u1ec1 MongoDB:<\/p>\n<ol>\n<li><a href=\"https:\/\/itviec.com\/blog\/mongodb-vs-mysql\/\" target=\"_blank\" rel=\"noopener\">MongoDB vs MySQL: Khi n\u00e0o n\u00ean s\u1eed d\u1ee5ng CSDL n\u00e0o?<\/a><\/li>\n<li><a href=\"https:\/\/itviec.com\/blog\/mariadb-vs-mysql\/\" target=\"_blank\" rel=\"noopener\">MariaDB vs MySQL: \u201cCu\u1ed9c chi\u1ebfn\u201d c\u01a1 s\u1edf d\u1eef li\u1ec7u m\u00e3 ngu\u1ed3n m\u1edf<\/a><\/li>\n<\/ol>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" class=\"sp-no-webp wp-image-5668 aligncenter sp-no-webp entered lazyloaded\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2015\/07\/Robby2.png\" alt=\"robby-2\" width=\"300\" height=\"300\" data-lazy-src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2015\/07\/Robby2.png\" data-lazy-sizes=\"(max-width: 300px) 100vw, 300px\" data-lazy-srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2015\/07\/Robby2.png 300w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2015\/07\/Robby2-200x200.png 200w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2015\/07\/Robby2-60x60.png 60w\" data-ll-status=\"loaded\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2015\/07\/Robby2.png 300w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2015\/07\/Robby2-200x200.png 200w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2015\/07\/Robby2-60x60.png 60w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/figure>\n<\/div>\n<p id=\"block-bdf220a1-3635-4794-9101-81d879939b92\" class=\"has-text-align-center\" style=\"text-align: center;\"><strong>B\u1ea1n th\u1ea5y b\u00e0i vi\u1ebft hay v\u00e0 h\u1eefu \u00edch? \u0110\u1eebng ng\u1ea1i Share v\u1edbi b\u1ea1n b\u00e8 v\u00e0 \u0111\u1ed3ng nghi\u1ec7p nh\u00e9.<\/strong><\/p>\n<p id=\"block-a1315aab-406f-48df-97fc-6b9584e6e134\" class=\"has-text-align-center\" style=\"text-align: center;\"><strong>V\u00e0 nhanh tay tham kh\u1ea3o\u00a0<a href=\"http:\/\/itviec.com\/?utm_medium=anchor_text_low&amp;utm_source=blog_&amp;utm_campaign=viec_lam_it&amp;utm_content=mongodb_la_gi\" target=\"_blank\" rel=\"noreferrer noopener\">vi\u1ec7c l\u00e0m IT<\/a>\u00a0\u201cch\u1ea5t\u201d tr\u00ean ITviec<\/strong>!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0110\u01b0\u1ee3c ph\u00e1t h\u00e0nh l\u1ea7n \u0111\u1ea7u v\u00e0o th\u00e1ng 2 n\u0103m 2009, MongoDB l\u00e0 m\u1ed9t c\u01a1 s\u1edf d\u1eef li\u1ec7u h\u01b0\u1edbng document m\u00e3 ngu\u1ed3n m\u1edf \u0111\u01b0\u1ee3c thi\u1ebft k\u1ebf \u0111\u1ec3 l\u01b0u tr\u1eef m\u1ed9t l\u01b0\u1ee3ng l\u1edbn d\u1eef li\u1ec7u v\u00e0 cho ph\u00e9p b\u1ea1n l\u00e0m vi\u1ec7c v\u1edbi ngu\u1ed3n d\u1eef li\u1ec7u \u0111\u00f3 m\u1ed9t c\u00e1ch hi\u1ec7u qu\u1ea3. Nh\u01b0ng \u0111i\u1ec1u g\u00ec th\u1eadt s\u1ef1 khi\u1ebfn MongoDB [&hellip;]<\/p>\n","protected":false},"author":95,"featured_media":31661,"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-31641","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>MongoDB l\u00e0 g\u00ec? \u001dHi\u1ec3u r\u00f5 A-Z v\u1ec1 c\u01a1 s\u1edf d\u1eef li\u1ec7u MongoDB<\/title>\n<meta name=\"description\" content=\"MongoDB l\u00e0 g\u00ec? MongoDB l\u00e0 c\u01a1 s\u1edf d\u1eef li\u1ec7u h\u01b0\u1edbng document m\u00e3 ngu\u1ed3n m\u1edf. Nh\u01b0ng v\u00ec sao b\u1ea1n n\u00ean ch\u1ecdn ph\u1ea7n m\u1ec1m qu\u1ea3n l\u00fd c\u01a1 s\u1edf d\u1eef li\u1ec7u \bn\u00e0y?\" \/>\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\/mongodb-la-gi\/\" \/>\n<meta property=\"og:locale\" content=\"vi_VN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"MongoDB l\u00e0 g\u00ec? \u0110\u1ecbnh ngh\u0129a v\u00e0 Hi\u1ec3u r\u00f5 A-Z v\u1ec1 MongoDB\" \/>\n<meta property=\"og:description\" content=\"\u0110\u01b0\u1ee3c ph\u00e1t h\u00e0nh l\u1ea7n \u0111\u1ea7u v\u00e0o th\u00e1ng 2 n\u0103m 2009, MongoDB l\u00e0 m\u1ed9t c\u01a1 s\u1edf d\u1eef li\u1ec7u h\u01b0\u1edbng document m\u00e3 ngu\u1ed3n m\u1edf \u0111\u01b0\u1ee3c thi\u1ebft k\u1ebf \u0111\u1ec3 l\u01b0u tr\u1eef m\u1ed9t l\u01b0\u1ee3ng l\u1edbn d\u1eef li\u1ec7u v\u00e0 cho\" \/>\n<meta property=\"og:url\" content=\"https:\/\/itviec.com\/blog\/mongodb-la-gi\/\" \/>\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=\"2023-06-29T06:26:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-09-20T07:22:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2023\/06\/mongodb-blog-thumbnail.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"640\" \/>\n\t<meta property=\"og:image:height\" content=\"337\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Tuong Uyen\" \/>\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=\"Tuong Uyen\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u01af\u1edbc t\u00ednh th\u1eddi gian \u0111\u1ecdc\" \/>\n\t<meta name=\"twitter:data2\" content=\"15 ph\u00fat\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"MongoDB l\u00e0 g\u00ec? \u001dHi\u1ec3u r\u00f5 A-Z v\u1ec1 c\u01a1 s\u1edf d\u1eef li\u1ec7u MongoDB","description":"MongoDB l\u00e0 g\u00ec? MongoDB l\u00e0 c\u01a1 s\u1edf d\u1eef li\u1ec7u h\u01b0\u1edbng document m\u00e3 ngu\u1ed3n m\u1edf. Nh\u01b0ng v\u00ec sao b\u1ea1n n\u00ean ch\u1ecdn ph\u1ea7n m\u1ec1m qu\u1ea3n l\u00fd c\u01a1 s\u1edf d\u1eef li\u1ec7u \bn\u00e0y?","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\/mongodb-la-gi\/","og_locale":"vi_VN","og_type":"article","og_title":"MongoDB l\u00e0 g\u00ec? \u0110\u1ecbnh ngh\u0129a v\u00e0 Hi\u1ec3u r\u00f5 A-Z v\u1ec1 MongoDB","og_description":"\u0110\u01b0\u1ee3c ph\u00e1t h\u00e0nh l\u1ea7n \u0111\u1ea7u v\u00e0o th\u00e1ng 2 n\u0103m 2009, MongoDB l\u00e0 m\u1ed9t c\u01a1 s\u1edf d\u1eef li\u1ec7u h\u01b0\u1edbng document m\u00e3 ngu\u1ed3n m\u1edf \u0111\u01b0\u1ee3c thi\u1ebft k\u1ebf \u0111\u1ec3 l\u01b0u tr\u1eef m\u1ed9t l\u01b0\u1ee3ng l\u1edbn d\u1eef li\u1ec7u v\u00e0 cho","og_url":"https:\/\/itviec.com\/blog\/mongodb-la-gi\/","og_site_name":"ITviec Blog","article_publisher":"https:\/\/www.facebook.com\/ITviec","article_published_time":"2023-06-29T06:26:28+00:00","article_modified_time":"2024-09-20T07:22:45+00:00","og_image":[{"width":640,"height":337,"url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2023\/06\/mongodb-blog-thumbnail.jpg","type":"image\/jpeg"}],"author":"Tuong Uyen","twitter_card":"summary_large_image","twitter_creator":"@ITviec","twitter_site":"@ITviec","twitter_misc":{"\u0110\u01b0\u1ee3c vi\u1ebft b\u1edfi":"Tuong Uyen","\u01af\u1edbc t\u00ednh th\u1eddi gian \u0111\u1ecdc":"15 ph\u00fat"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/itviec.com\/blog\/mongodb-la-gi\/#article","isPartOf":{"@id":"https:\/\/itviec.com\/blog\/mongodb-la-gi\/"},"author":{"name":"Tuong Uyen","@id":"https:\/\/itviec.com\/blog\/#\/schema\/person\/e97d0e359f8840eaea7dc3a96006a8d4"},"headline":"MongoDB l\u00e0 g\u00ec? \u0110\u1ecbnh ngh\u0129a v\u00e0 Hi\u1ec3u r\u00f5 A-Z v\u1ec1 MongoDB","datePublished":"2023-06-29T06:26:28+00:00","dateModified":"2024-09-20T07:22:45+00:00","mainEntityOfPage":{"@id":"https:\/\/itviec.com\/blog\/mongodb-la-gi\/"},"wordCount":4168,"publisher":{"@id":"https:\/\/itviec.com\/blog\/#organization"},"image":{"@id":"https:\/\/itviec.com\/blog\/mongodb-la-gi\/#primaryimage"},"thumbnailUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2023\/06\/mongodb-blog-thumbnail.jpg","articleSection":["Chuy\u00ean m\u00f4n IT"],"inLanguage":"vi"},{"@type":"WebPage","@id":"https:\/\/itviec.com\/blog\/mongodb-la-gi\/","url":"https:\/\/itviec.com\/blog\/mongodb-la-gi\/","name":"MongoDB l\u00e0 g\u00ec? \u001dHi\u1ec3u r\u00f5 A-Z v\u1ec1 c\u01a1 s\u1edf d\u1eef li\u1ec7u MongoDB","isPartOf":{"@id":"https:\/\/itviec.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/itviec.com\/blog\/mongodb-la-gi\/#primaryimage"},"image":{"@id":"https:\/\/itviec.com\/blog\/mongodb-la-gi\/#primaryimage"},"thumbnailUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2023\/06\/mongodb-blog-thumbnail.jpg","datePublished":"2023-06-29T06:26:28+00:00","dateModified":"2024-09-20T07:22:45+00:00","description":"MongoDB l\u00e0 g\u00ec? MongoDB l\u00e0 c\u01a1 s\u1edf d\u1eef li\u1ec7u h\u01b0\u1edbng document m\u00e3 ngu\u1ed3n m\u1edf. Nh\u01b0ng v\u00ec sao b\u1ea1n n\u00ean ch\u1ecdn ph\u1ea7n m\u1ec1m qu\u1ea3n l\u00fd c\u01a1 s\u1edf d\u1eef li\u1ec7u \bn\u00e0y?","breadcrumb":{"@id":"https:\/\/itviec.com\/blog\/mongodb-la-gi\/#breadcrumb"},"inLanguage":"vi","potentialAction":[{"@type":"ReadAction","target":["https:\/\/itviec.com\/blog\/mongodb-la-gi\/"]}]},{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/itviec.com\/blog\/mongodb-la-gi\/#primaryimage","url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2023\/06\/mongodb-blog-thumbnail.jpg","contentUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2023\/06\/mongodb-blog-thumbnail.jpg","width":640,"height":337,"caption":"mongodb l\u00e0 g\u00ec - itviec blog"},{"@type":"BreadcrumbList","@id":"https:\/\/itviec.com\/blog\/mongodb-la-gi\/#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":"MongoDB l\u00e0 g\u00ec? \u0110\u1ecbnh ngh\u0129a v\u00e0 Hi\u1ec3u r\u00f5 A-Z v\u1ec1 MongoDB"}]},{"@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\/e97d0e359f8840eaea7dc3a96006a8d4","name":"Tuong Uyen","image":{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2022\/10\/tuong-uyen-profile-picture-100x100.jpg","url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2022\/10\/tuong-uyen-profile-picture-100x100.jpg","contentUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2022\/10\/tuong-uyen-profile-picture-100x100.jpg","caption":"Tuong Uyen"},"url":"https:\/\/itviec.com\/blog\/author\/tuong-uyen-pikachu\/"}]}},"_links":{"self":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts\/31641","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\/95"}],"replies":[{"embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/comments?post=31641"}],"version-history":[{"count":0,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts\/31641\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/media\/31661"}],"wp:attachment":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/media?parent=31641"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/categories?post=31641"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/tags?post=31641"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}