{"id":7689,"date":"2020-06-30T10:50:00","date_gmt":"2020-06-30T10:50:00","guid":{"rendered":"https:\/\/gtechbooster.com\/?p=7689"},"modified":"2023-10-19T00:37:25","modified_gmt":"2023-10-19T00:37:25","slug":"memcached","status":"publish","type":"post","link":"https:\/\/gtechbooster.com\/memcached\/","title":{"rendered":"Memcached: a general-purpose distributed memory caching system"},"content":{"rendered":"\n<p>Memcached is a general-purpose distributed memory caching system that is aimed at speeding up dynamic database-driven websites. It is used to reduce the number of times an external data source (like a database or API) is read by caching data and objects in RAM.<\/p>\n\n\n\n<div class=\"gtech-migrated-from-ad-inserter-placement-2\" style=\"text-align: center;\" id=\"gtech-802147419\"><div style=\"margin-right: auto;margin-left: auto;text-align: center;\" id=\"gtech-3669582080\"><a data-bid=\"1\" data-no-instant=\"1\" href=\"https:\/\/gtechbooster.com\/linkout\/17207\" rel=\"noopener\" class=\"notrack\" aria-label=\"26001\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/gtechbooster.com\/media\/2023\/01\/26001.jpeg\" alt=\"\"  srcset=\"https:\/\/gtechbooster.com\/media\/2023\/01\/26001.jpeg 1024w, https:\/\/gtechbooster.com\/media\/2023\/01\/26001-768x960.jpeg 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" width=\"500\" height=\"625\"  style=\"display: inline-block;\" \/><\/a><\/div><\/div><p>The Memcached system uses a client\u2013server architecture. The server maintain a key\u2013value associative array, while the clients populate this array and query it. Keys are up to 250 bytes long and values can be at most 1 megabyte in size.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">How it work<\/h4>\n\n\n\n<p>Memcached operates as a key-value store, where data is stored in the form of key-value pairs. It is often used to <a href=\"https:\/\/gtechbooster.com\/i\/cache\/\" data-type=\"post_tag\" data-id=\"154\">cache database<\/a> query results, API responses, and other computationally expensive or frequently accessed data.<\/p>\n\n\n\n<p>As a distributed system, it can be deployed across multiple servers to handle high traffic loads and provide fault tolerance. Memcached offers both ASCII and binary protocols for communication via a client-server architecture, where clients (applications) communicate with Memcached servers to store and retrieve data. Memcached supports various programming languages, including Python, Java, PHP, C\/C++, Perl, Ruby, JavaScript, and Node.js  with a focus on high performance and low latency.<\/p>\n\n\n\n<p>Memcached can be used in conjunction with other caching systems, such as Redis, to provide a comprehensive caching solution.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full has-custom-border\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/gtechbooster.com\/media\/2023\/10\/memcached-arch-jpg.webp\" alt=\"memcached arch\" class=\"wp-image-31042\" style=\"border-radius:5px\" srcset=\"https:\/\/gtechbooster.com\/media\/2023\/10\/memcached-arch-jpg.webp 1024w, https:\/\/gtechbooster.com\/media\/2023\/10\/memcached-arch-768x480.webp 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Memcached <\/figcaption><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Use Cases<\/h4>\n\n\n\n<ul class=\"has-palette-color-6-background-color has-background wp-block-list\">\n<li>Memcached is commonly used in web applications to cache frequently accessed data, such as user sessions, HTML fragments, and database query results.<\/li>\n\n\n\n<li>It is particularly effective in scenarios where read-heavy workloads and high concurrency are involved.<\/li>\n\n\n\n<li>Memcached can help alleviate the load on backend databases, reduce response times, and improve overall application performance.<\/li>\n\n\n\n<li>It is often used in large-scale web applications, social media platforms, content delivery networks (CDNs), and e-commerce websites.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Security Considerations<\/h4>\n\n\n\n<ul class=\"has-palette-color-5-background-color has-background wp-block-list\">\n<li>By default, Memcached does not provide built-in security features, such as authentication or encryption.<\/li>\n\n\n\n<li>It is typically deployed within trusted networks where clients can freely connect to any server.<\/li>\n\n\n\n<li>However, in situations where Memcached is deployed in untrusted networks or administrators want to exercise control over client connections, it can be compiled with optional SASL (Simple Authentication and Security Layer) authentication support.<\/li>\n\n\n\n<li>It is important to ensure that Memcached servers are properly secured and not exposed to unauthorized access, as misconfigurations can lead to data exposure or modification.<\/li>\n<\/ul>\n\n\n\n<p>The Memcached system is used by some of the most traffic heavy sites such as YouTube, Reddit, Facebook, Twitter. It is also supported by some popular CMSs such as Drupal, Joomla, and WordPress.<\/p>\n\n\n\n<p>To use Memcached with PHP, go to PHP Configuration and enable memcached extension.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Memcached - Web Development\" width=\"1290\" height=\"726\" src=\"https:\/\/www.youtube.com\/embed\/1MAgt0bFdwM?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><figcaption class=\"wp-element-caption\">Memcached<\/figcaption><\/figure>\n\n\n\n<p class=\"has-palette-color-3-color has-palette-color-1-background-color has-text-color has-background\">Memcached has become a popular choice for caching frequently accessed data in web applications due to its simplicity, high performance, and scalability. Its ability to reduce database load and improve response times makes it a valuable tool for optimizing application performance.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">More Information \u2139<\/h6>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/gtechbooster.com\/i\/memcached\/\" data-type=\"post_tag\" data-id=\"1202\">Memcached<\/a><\/li>\n<\/ul>\n<div class=\"gtech-end-cont\" id=\"gtech-1035020262\"><div style=\"margin-right: auto;margin-left: auto;text-align: center;\" id=\"gtech-78987128\"><a data-bid=\"1\" data-no-instant=\"1\" href=\"https:\/\/gtechbooster.com\/linkout\/17207\" rel=\"noopener\" class=\"notrack\" aria-label=\"26001\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/gtechbooster.com\/media\/2023\/01\/26001.jpeg\" alt=\"\"  srcset=\"https:\/\/gtechbooster.com\/media\/2023\/01\/26001.jpeg 1024w, https:\/\/gtechbooster.com\/media\/2023\/01\/26001-768x960.jpeg 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" width=\"500\" height=\"625\"  style=\"display: inline-block;\" \/><\/a><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Memcached has become a popular choice for caching frequently accessed data in web applications due to its simplicity, high performance, and scalability.<\/p>\n","protected":false},"author":7,"featured_media":7766,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[154,238,1128,1202,540,6],"class_list":["post-7689","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-features","tag-cache","tag-database","tag-docuvideos","tag-memcached","tag-computer-memory","tag-programming"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":6}},"_links":{"self":[{"href":"https:\/\/gtechbooster.com\/api-json\/wp\/v2\/posts\/7689","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gtechbooster.com\/api-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gtechbooster.com\/api-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gtechbooster.com\/api-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/gtechbooster.com\/api-json\/wp\/v2\/comments?post=7689"}],"version-history":[{"count":0,"href":"https:\/\/gtechbooster.com\/api-json\/wp\/v2\/posts\/7689\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gtechbooster.com\/api-json\/wp\/v2\/media\/7766"}],"wp:attachment":[{"href":"https:\/\/gtechbooster.com\/api-json\/wp\/v2\/media?parent=7689"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gtechbooster.com\/api-json\/wp\/v2\/categories?post=7689"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gtechbooster.com\/api-json\/wp\/v2\/tags?post=7689"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}