{"id":517010,"date":"2023-07-12T09:20:46","date_gmt":"2023-07-12T07:20:46","guid":{"rendered":"https:\/\/www.devoteam.com\/expert-view\/using-firestore-as-a-dynamic-cache\/"},"modified":"2025-04-10T10:40:23","modified_gmt":"2025-04-10T08:40:23","slug":"using-firestore-as-a-dynamic-cache","status":"publish","type":"expert-view","link":"https:\/\/devoteam.info\/en-pt\/expert-view\/using-firestore-as-a-dynamic-cache\/","title":{"rendered":"Using Firestore as a Dynamic Cache"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"h-the-scenario-nbsp\">The Scenario&nbsp;<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The API serves a user base with hundreds of thousands of users who have a high demand for our services. Receiving up to 8,000 requests per second during peak times. These users are passionate and actively engaged with our content, making it crucial to ensure timely data updates to avoid negative social media feedback. An improved version of the API using Google Cloud was released, serving both old and new data.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However, an unexpected challenge surfaced. The usage and engagement surpassed our expectations, resulting in a concerning 99th percentile latency of 7 seconds for the data API. Fortunately, the peak usage occurred on weekends, and the dedicated users remained active throughout the week. Although this provided some relief, there was a tight deadline of five days to resolve the issue. In response, we focused on Redis as a potential solution, as it showed promising features to help us overcome these problems.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-the-challenge\">The challenge<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"http:\/\/redis.io\">Redis<\/a> was considered a potential solution because of its reputation for quickly delivering document sets in sub-millisecond timeframes. What seemed like the perfect fit for the needs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Upon closer examination, it became clear that while Redis excelled in speed, it had certain drawbacks. To put it in perspective, let&#8217;s use an analogy. Think of a Bugatti Chiron Supersport, an impressive engineering marvel that can get you from Belgium to Portugal in just 4 hours. Amazing, right? But there are downsides. It can&#8217;t accommodate your entire family, you&#8217;ll likely accumulate numerous speeding tickets, and it consumes fuel (and money) at an alarming rate.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Sub-second speeds weren\u2019t needed for the API. Instead, the primary requirements were:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The ability to store and retrieve cached data with a 99th percentile latency below 500 milliseconds.<\/li>\n\n\n\n<li>The capability to scale seamlessly without compromising the first requirement, effectively handling increasing demands.<\/li>\n\n\n\n<li>Quick invalidation of selected entries, ideally below 5 seconds, without impacting the first two requirements.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-why-redis-wasn-t-the-right-pick\">Why Redis wasn\u2019t the right pick<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Redis delivers cache data with remarkable speed, meeting the first requirement effectively. Its performance in this aspect is unquestionable. However, the necessary experience to fully comprehend how Redis would handle performance under increased demands wasn\u2019t in place. Although this presented a challenge, it wasn&#8217;t an insurmountable obstacle.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The real difficulty arose with the third requirement. None of the team members possessed extensive expertise in utilising Redis beyond basic caching functionalities. The advanced querying capabilities weren\u2019t explored or delved into their full potential. While Redis showed promise, it ultimately didn&#8217;t align perfectly with the specific needs, given the limited familiarity and experience with its more advanced features.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-firestore-got-our-back\">Firestore got our Back<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"http:\/\/firebase.google.com\/docs\/firestore\">Firestore<\/a> proved to be a great solution for the needs. It met the requirements with reading times below 30 milliseconds and writes below 100 milliseconds. Its querying capabilities were an advantage. The recent addition of Time to Live (TTL) functionality in Firestore was a welcome bonus, further enhancing its appeal. Being a fully managed service by Google, Firestore alleviated any operational concerns. It handled operations and scaling seamlessly, allowing focus on the core tasks.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A service developed to streamline the process, standardise requests and check if the data existed in Firestore. If not, it retrieved the data from the source, parsed the response to extract relevant tags, and cached the request using those tags. Intelligent hooks maintained a consistently fresh cache, triggering whenever changes occurred in the original data. These hooks invoked the invalidator, which parsed the changes to extract relevant tags. The invalidator queried Firestore and invalidated the corresponding cached entries using the tags. Not immediately deleting the entries ensured correctness even during periods of high concurrency. Firestore proved to be a capable contender, offering the perfect combination of performance, versatility, and seamless management for the API.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-details-on-the-implementation\">Details On The Implementation<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The service was implemented in <a href=\"https:\/\/go.dev\/\">Go<\/a> and deployed on <a href=\"https:\/\/cloud.google.com\/run\">Cloud Run<\/a>. It consisted of two endpoints: the proxy and the invalidator, each deployed in a separate Cloud Run service to ensure smooth operation. One service exclusively handles the proxy, and the other is dedicated to real-time invalidation. This segregation provides a homogenous workflow, simplifying scaling decisions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">By leveraging Firestore&#8217;s triggers, you establish a seamless connection between data changes and the invoker of the invalidator. Whenever a change occurs in the original data, Firestore triggers the invalidator, initiating our cache invalidation process. This intelligent setup maintains efficiency and prevents interference between the proxy and the invalidation process. The gears are now in motion, and the service is ready to overcome <a href=\"https:\/\/gcloud.devoteam.com\/blog\/the-most-challenging-aspects-of-the-data-journey-unveiled\/\">the challenges<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-results\">Results<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><\/td><td><strong>Before Cache<\/strong><\/td><td><strong>After Cache<\/strong><\/td><td><strong>Improvements<\/strong><\/td><\/tr><tr><td><strong>Throughput<\/strong><\/td><td>1675 req\/s<\/td><td>5993 req\/s<\/td><td><strong>4318 rec\/s<\/strong><\/td><\/tr><tr><td><strong>Percentile 99<\/strong><\/td><td>9.96s<\/td><td>477ms<\/td><td><strong>9.483s<\/strong><\/td><\/tr><tr><td><strong>Percentile 95<\/strong><\/td><td>2.52s<\/td><td>57ms<\/td><td><strong>2.463s<\/strong><\/td><\/tr><tr><td><strong>Percentile 50<\/strong><\/td><td>220ms<\/td><td>22ms<\/td><td><strong>198ms<\/strong><\/td><\/tr><tr><td><strong>Cache Hits<\/strong><\/td><td>0%<\/td><td>*85%<\/td><td><strong>85%<\/strong><\/td><\/tr><tr><td><strong>Service Instances<\/strong><\/td><td>606<\/td><td>**200<\/td><td><strong>400<\/strong><\/td><\/tr><tr><td><strong>Cache Instances<\/strong><\/td><td>0<\/td><td>20<\/td><td><strong>20<\/strong><\/td><\/tr><tr><td><strong>Invalidator Instances<\/strong><\/td><td>0<\/td><td>2<\/td><td><strong>2<\/strong><\/td><\/tr><tr><td><strong>Total Memory<\/strong><\/td><td>606 Gb<\/td><td>203.5 Gb<\/td><td><strong>402.5 Gb<\/strong><\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\">* This number should be higher, but there is one endpoint that does not respect the REST API best practices resulting in being unable to be cached. Because it does not mess with the SLAs, this issue was never addressed.<br>** The main server is fundamentally heavy. Without restructuring we cannot lower more than this.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">During peak weekend usage, caching was important in improving the system&#8217;s capabilities. Most cache invalidations occur within a second, with occasional instances exceeding 5 seconds. These longer durations typically arise when streaming and invalidating a large number of documents simultaneously.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">From a cost perspective, caching has been a game-changer. Previously, the service required reading an average of 6 documents for single-resource endpoints and approximately 150 documents for multiple-resource endpoints. With cached hits, a single read is all it takes. Resulting in significant cost reduction while maintaining efficient operations.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Firestore is a versatile caching solution for REST services or websites. It offers scalability, flexibility, and performance that meets most Service Level Objectives (SLOs). As a fully managed service, it handles all the management tasks, allowing you to focus on your core business. With Firestore, you only pay for the resources you use, ensuring cost-effectiveness.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Whether you want to optimise your caching, gain more flexibility, or prefer a managed cache experience, Firestore empowers your caching efforts. It unlocks the full potential of your applications and websites with its powerful capabilities.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Looking for a managed cache solution, more flexibility and ready to pay only for the resources you utilise? <a href=\"https:\/\/gcloud.devoteam.com\/contact-us\/\">Contact us now<\/a> to explore the possibilities.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-future-applications\">Future Applications<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Enhance your server infrastructure with upcoming advancements that deliver remarkable performance improvements:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Service Cache Integration:<\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Integrate the cache directly into each server, eliminating the need for a separate cache server. This reduces latency, lowers costs, and leverages Firestore&#8217;s batch-get capabilities for efficient API aggregation. It ensures optimal performance, resembling cache hits or direct access to the origin server.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Advanced Rule Systems:<\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Utilise sophisticated rule systems to handle complex data conditions. Configure rules that adapt and branch out based on multiple fields, providing unmatched flexibility and accommodating intricate requirements.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Fragmented Speed:<\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Accelerate large-scale invalidations by fragmenting the document stream into multiple concurrent streams.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Precise Indexing:<\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Fine-tune your indexing strategy to achieve quick updates, boosting your system&#8217;s overall performance.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<div class=\"wp-block-cover alignfull is-style-blur-image is-style-blur-image-less\" style=\"margin-top:0;margin-bottom:0;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0\"><span aria-hidden=\"true\" class=\"wp-block-cover__background has-black-background-color has-background-dim-70 has-background-dim\"><\/span><img loading=\"lazy\" decoding=\"async\" width=\"2560\" height=\"1707\" src=\"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/programmers-cooperating-brainstorming-at-informati-2021-08-29-00-02-34-utc-1-scaled-1.jpg\" class=\"wp-block-cover__image-background wp-post-image\" alt=\"\" data-object-fit=\"cover\" srcset=\"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/programmers-cooperating-brainstorming-at-informati-2021-08-29-00-02-34-utc-1-scaled-1.jpg 2560w, https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/programmers-cooperating-brainstorming-at-informati-2021-08-29-00-02-34-utc-1-scaled-1-300x200.jpg 300w, https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/programmers-cooperating-brainstorming-at-informati-2021-08-29-00-02-34-utc-1-scaled-1-1024x683.jpg 1024w, https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/programmers-cooperating-brainstorming-at-informati-2021-08-29-00-02-34-utc-1-scaled-1-768x512.jpg 768w, https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/programmers-cooperating-brainstorming-at-informati-2021-08-29-00-02-34-utc-1-scaled-1-1536x1024.jpg 1536w, https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/programmers-cooperating-brainstorming-at-informati-2021-08-29-00-02-34-utc-1-scaled-1-2048x1366.jpg 2048w\" sizes=\"auto, (max-width: 2560px) 100vw, 2560px\" \/><div class=\"wp-block-cover__inner-container is-layout-flow wp-block-cover-is-layout-flow\">\n<div class=\"wp-block-group alignfull has-base-color has-text-color has-global-padding is-layout-constrained wp-container-core-group-is-layout-46b67d08 wp-block-group-is-layout-constrained\" style=\"margin-top:0px;margin-bottom:0px;padding-top:var(--wp--preset--spacing--xxx-large);padding-right:var(--wp--preset--spacing--medium);padding-bottom:var(--wp--preset--spacing--xxx-large);padding-left:var(--wp--preset--spacing--medium)\">\n<div class=\"wp-block-group is-layout-flow wp-block-group-is-layout-flow\">\n<div class=\"wp-block-group has-global-padding is-content-justification-left is-layout-constrained wp-container-core-group-is-layout-5f9de3d0 wp-block-group-is-layout-constrained\">\n<h2 class=\"wp-block-heading has-text-align-left has-secondary-font-family has-large-font-size\" id=\"h-devoteam-helps-you-lead-the-gen-ai-revolution\">Devoteam helps you lead the (gen)AI revolution<\/h2>\n<\/div>\n\n\n\n<p class=\"has-text-align-left has-main-accent-color has-text-color wp-block-paragraph\">Partner with Devoteam to access experienced AI consultants and the best AI technologies for tailored solutions that maximise your return on investment. With over 1,000 certified AI Consultants and over 300 successful AI projects, we have the expertise to meet your unique needs.<\/p>\n\n\n\n<div class=\"wp-block-buttons is-content-justification-left is-layout-flex wp-container-core-buttons-is-layout-3c38c079 wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/devoteam.info\/en-pt\/services\/ai-ml\/\">Begin your AI Journey<\/a><\/div>\n\n\n\n<div class=\"wp-block-button is-style-outline-white-button\"><a class=\"wp-block-button__link has-base-color has-text-color has-background wp-element-button\" href=\"https:\/\/devoteam.info\/success-story\/?category_name=ai\" style=\"background-color:#64648254\">AI References<\/a><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>When a web resource fails to respond within a reasonable time frame, it disrupts the entire system. One obvious solution is implementing a cache, which significantly reduces the latency of requests that could otherwise take a long time, such as 10 seconds, 50 seconds, or even 10 minutes, to just a few moments.<\/p>\n<p>You might wonder which cache engine to choose. For basic resources without structured data requirements, Memcached is often a suitable choice. In other cases, Redis Cache is preferred.<\/p>\n<p>But have you considered Firestore as a viable option for caching?<\/p>\n","protected":false},"featured_media":320260,"template":"","categories":[917],"tags":[2305,2864,2285,2510],"industry":[],"class_list":["post-517010","expert-view","type-expert-view","status-publish","has-post-thumbnail","hentry","category-google-cloud-en-pt","tag-data-en-pt","tag-data-analytics-en-pt","tag-google-cloud-en-pt","tag-google-cloud-platform-en-pt"],"acf":[],"cards":"\n\t<div class=\"single-post-card\">\n\n\t\t<figure class=\"wp-block-post-featured-image\"><a href=\"https:\/\/devoteam.info\/en-pt\/expert-view\/using-firestore-as-a-dynamic-cache\/\" target=\"_self\" ><img width=\"2560\" height=\"1707\" src=\"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/programmers-cooperating-brainstorming-at-informati-2021-08-29-00-02-34-utc-1-scaled-1.jpg\" class=\"attachment-post-thumbnail size-post-thumbnail wp-post-image\" alt=\"Using Firestore as a Dynamic Cache\" style=\"aspect-ratio:4\/3;width:100%;object-fit:cover;\" decoding=\"async\" loading=\"lazy\" srcset=\"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/programmers-cooperating-brainstorming-at-informati-2021-08-29-00-02-34-utc-1-scaled-1.jpg 2560w, https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/programmers-cooperating-brainstorming-at-informati-2021-08-29-00-02-34-utc-1-scaled-1-300x200.jpg 300w, https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/programmers-cooperating-brainstorming-at-informati-2021-08-29-00-02-34-utc-1-scaled-1-1024x683.jpg 1024w, https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/programmers-cooperating-brainstorming-at-informati-2021-08-29-00-02-34-utc-1-scaled-1-768x512.jpg 768w, https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/programmers-cooperating-brainstorming-at-informati-2021-08-29-00-02-34-utc-1-scaled-1-1536x1024.jpg 1536w, https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/programmers-cooperating-brainstorming-at-informati-2021-08-29-00-02-34-utc-1-scaled-1-2048x1366.jpg 2048w\" sizes=\"auto, (max-width: 2560px) 100vw, 2560px\" \/><\/a><\/figure>\n\n\t\t\n\t\t<div class=\"wp-block-group is-vertical is-layout-flex wp-container-core-group-is-layout-43282307 wp-block-group-is-layout-flex\">\n\t<p style=\"font-style:normal;font-weight:700\" class=\"has-link-color wp-elements-1 wp-block-lp-post-type has-text-color has-primary-color has-small-font-size\">Expert View<\/p>\n\n\t\t\n\t\t<h3 style=\"font-style:normal;font-weight:400\" class=\"wp-block-post-title has-base-font-size\"><a href=\"https:\/\/devoteam.info\/en-pt\/expert-view\/using-firestore-as-a-dynamic-cache\/\" target=\"_self\" >Using Firestore as a Dynamic Cache<\/a><\/h3><\/div>\n\t\t\n\t<\/div>\n\n","yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v28.4 (Yoast SEO v28.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Using Firestore as a Dynamic Cache | Devoteam<\/title>\n<meta name=\"description\" content=\"Using Firestore as a Dynamic Cache. Firestore is not the obvious choice for caching. Read why the choice was made in this project.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/devoteam.info\/en-pt\/expert-view\/using-firestore-as-a-dynamic-cache\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Using Firestore as a Dynamic Cache\" \/>\n<meta property=\"og:description\" content=\"Using Firestore as a Dynamic Cache. Firestore is not the obvious choice for caching. Read why the choice was made in this project.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/devoteam.info\/en-pt\/expert-view\/using-firestore-as-a-dynamic-cache\/\" \/>\n<meta property=\"og:site_name\" content=\"Devoteam\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-10T08:40:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/programmers-cooperating-brainstorming-at-informati-2021-08-29-00-02-34-utc-1-scaled-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"1707\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/devoteam.info\\\/en-pt\\\/expert-view\\\/using-firestore-as-a-dynamic-cache\\\/\",\"url\":\"https:\\\/\\\/devoteam.info\\\/en-pt\\\/expert-view\\\/using-firestore-as-a-dynamic-cache\\\/\",\"name\":\"Using Firestore as a Dynamic Cache | Devoteam\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/devoteam.info\\\/en-pt\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/devoteam.info\\\/en-pt\\\/expert-view\\\/using-firestore-as-a-dynamic-cache\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/devoteam.info\\\/en-pt\\\/expert-view\\\/using-firestore-as-a-dynamic-cache\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/devoteam.info\\\/wp-content\\\/uploads\\\/2024\\\/12\\\/programmers-cooperating-brainstorming-at-informati-2021-08-29-00-02-34-utc-1-scaled-1.jpg\",\"datePublished\":\"2023-07-12T07:20:46+00:00\",\"dateModified\":\"2025-04-10T08:40:23+00:00\",\"description\":\"Using Firestore as a Dynamic Cache. Firestore is not the obvious choice for caching. Read why the choice was made in this project.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/devoteam.info\\\/en-pt\\\/expert-view\\\/using-firestore-as-a-dynamic-cache\\\/#breadcrumb\"},\"inLanguage\":\"en-PT\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/devoteam.info\\\/en-pt\\\/expert-view\\\/using-firestore-as-a-dynamic-cache\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-PT\",\"@id\":\"https:\\\/\\\/devoteam.info\\\/en-pt\\\/expert-view\\\/using-firestore-as-a-dynamic-cache\\\/#primaryimage\",\"url\":\"https:\\\/\\\/devoteam.info\\\/wp-content\\\/uploads\\\/2024\\\/12\\\/programmers-cooperating-brainstorming-at-informati-2021-08-29-00-02-34-utc-1-scaled-1.jpg\",\"contentUrl\":\"https:\\\/\\\/devoteam.info\\\/wp-content\\\/uploads\\\/2024\\\/12\\\/programmers-cooperating-brainstorming-at-informati-2021-08-29-00-02-34-utc-1-scaled-1.jpg\",\"width\":2560,\"height\":1707},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/devoteam.info\\\/en-pt\\\/expert-view\\\/using-firestore-as-a-dynamic-cache\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/devoteam.info\\\/en-pt\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Expert View\",\"item\":\"https:\\\/\\\/devoteam.info\\\/en-pt\\\/expert-view\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Using Firestore as a Dynamic Cache\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/devoteam.info\\\/en-pt\\\/#website\",\"url\":\"https:\\\/\\\/devoteam.info\\\/en-pt\\\/\",\"name\":\"Devoteam\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/devoteam.info\\\/en-pt\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-PT\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Using Firestore as a Dynamic Cache | Devoteam","description":"Using Firestore as a Dynamic Cache. Firestore is not the obvious choice for caching. Read why the choice was made in this project.","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:\/\/devoteam.info\/en-pt\/expert-view\/using-firestore-as-a-dynamic-cache\/","og_locale":"en_US","og_type":"article","og_title":"Using Firestore as a Dynamic Cache","og_description":"Using Firestore as a Dynamic Cache. Firestore is not the obvious choice for caching. Read why the choice was made in this project.","og_url":"https:\/\/devoteam.info\/en-pt\/expert-view\/using-firestore-as-a-dynamic-cache\/","og_site_name":"Devoteam","article_modified_time":"2025-04-10T08:40:23+00:00","og_image":[{"width":2560,"height":1707,"url":"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/programmers-cooperating-brainstorming-at-informati-2021-08-29-00-02-34-utc-1-scaled-1.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/devoteam.info\/en-pt\/expert-view\/using-firestore-as-a-dynamic-cache\/","url":"https:\/\/devoteam.info\/en-pt\/expert-view\/using-firestore-as-a-dynamic-cache\/","name":"Using Firestore as a Dynamic Cache | Devoteam","isPartOf":{"@id":"https:\/\/devoteam.info\/en-pt\/#website"},"primaryImageOfPage":{"@id":"https:\/\/devoteam.info\/en-pt\/expert-view\/using-firestore-as-a-dynamic-cache\/#primaryimage"},"image":{"@id":"https:\/\/devoteam.info\/en-pt\/expert-view\/using-firestore-as-a-dynamic-cache\/#primaryimage"},"thumbnailUrl":"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/programmers-cooperating-brainstorming-at-informati-2021-08-29-00-02-34-utc-1-scaled-1.jpg","datePublished":"2023-07-12T07:20:46+00:00","dateModified":"2025-04-10T08:40:23+00:00","description":"Using Firestore as a Dynamic Cache. Firestore is not the obvious choice for caching. Read why the choice was made in this project.","breadcrumb":{"@id":"https:\/\/devoteam.info\/en-pt\/expert-view\/using-firestore-as-a-dynamic-cache\/#breadcrumb"},"inLanguage":"en-PT","potentialAction":[{"@type":"ReadAction","target":["https:\/\/devoteam.info\/en-pt\/expert-view\/using-firestore-as-a-dynamic-cache\/"]}]},{"@type":"ImageObject","inLanguage":"en-PT","@id":"https:\/\/devoteam.info\/en-pt\/expert-view\/using-firestore-as-a-dynamic-cache\/#primaryimage","url":"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/programmers-cooperating-brainstorming-at-informati-2021-08-29-00-02-34-utc-1-scaled-1.jpg","contentUrl":"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/programmers-cooperating-brainstorming-at-informati-2021-08-29-00-02-34-utc-1-scaled-1.jpg","width":2560,"height":1707},{"@type":"BreadcrumbList","@id":"https:\/\/devoteam.info\/en-pt\/expert-view\/using-firestore-as-a-dynamic-cache\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/devoteam.info\/en-pt\/"},{"@type":"ListItem","position":2,"name":"Expert View","item":"https:\/\/devoteam.info\/en-pt\/expert-view\/"},{"@type":"ListItem","position":3,"name":"Using Firestore as a Dynamic Cache"}]},{"@type":"WebSite","@id":"https:\/\/devoteam.info\/en-pt\/#website","url":"https:\/\/devoteam.info\/en-pt\/","name":"Devoteam","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/devoteam.info\/en-pt\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-PT"}]}},"uagb_featured_image_src":{"full":["https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/programmers-cooperating-brainstorming-at-informati-2021-08-29-00-02-34-utc-1-scaled-1.jpg",2560,1707,false],"thumbnail":["https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/programmers-cooperating-brainstorming-at-informati-2021-08-29-00-02-34-utc-1-scaled-1-150x150.jpg",150,150,true],"medium":["https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/programmers-cooperating-brainstorming-at-informati-2021-08-29-00-02-34-utc-1-scaled-1-300x200.jpg",300,200,true],"medium_large":["https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/programmers-cooperating-brainstorming-at-informati-2021-08-29-00-02-34-utc-1-scaled-1-768x512.jpg",768,512,true],"large":["https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/programmers-cooperating-brainstorming-at-informati-2021-08-29-00-02-34-utc-1-scaled-1-1024x683.jpg",1024,683,true],"1536x1536":["https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/programmers-cooperating-brainstorming-at-informati-2021-08-29-00-02-34-utc-1-scaled-1-1536x1024.jpg",1536,1024,true],"2048x2048":["https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/programmers-cooperating-brainstorming-at-informati-2021-08-29-00-02-34-utc-1-scaled-1-2048x1366.jpg",2048,1366,true]},"uagb_author_info":{"display_name":"Julien Pawlowski","author_link":"https:\/\/devoteam.info\/en-pt\/author\/"},"uagb_comment_info":0,"uagb_excerpt":"When a web resource fails to respond within a reasonable time frame, it disrupts the entire system. One obvious solution is implementing a cache, which significantly reduces the latency of requests that could otherwise take a long time, such as 10 seconds, 50 seconds, or even 10 minutes, to just a few moments. You might&hellip;","_links":{"self":[{"href":"https:\/\/devoteam.info\/en-pt\/wp-json\/wp\/v2\/expert-view\/517010","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devoteam.info\/en-pt\/wp-json\/wp\/v2\/expert-view"}],"about":[{"href":"https:\/\/devoteam.info\/en-pt\/wp-json\/wp\/v2\/types\/expert-view"}],"version-history":[{"count":0,"href":"https:\/\/devoteam.info\/en-pt\/wp-json\/wp\/v2\/expert-view\/517010\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devoteam.info\/en-pt\/wp-json\/wp\/v2\/media\/320260"}],"wp:attachment":[{"href":"https:\/\/devoteam.info\/en-pt\/wp-json\/wp\/v2\/media?parent=517010"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devoteam.info\/en-pt\/wp-json\/wp\/v2\/categories?post=517010"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devoteam.info\/en-pt\/wp-json\/wp\/v2\/tags?post=517010"},{"taxonomy":"industry","embeddable":true,"href":"https:\/\/devoteam.info\/en-pt\/wp-json\/wp\/v2\/industry?post=517010"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}