Questions tagged [caching]

Questions regarding cache algorithms by applications and implementations of information caching by database engines and other information repository and presentation applications.

Filter by
Sorted by
Tagged with
-2
votes
1answer
88 views

Map synchronization algorithm

Say I have two Map instances in JavaScript (or HashMap in Java, or Dictionary in C#), A and B. I want to synchronize B to A, so that B is a copy of A. I can't copy the reference and I don't want to ...
-1
votes
1answer
28 views

Order of deletion with web cache overflow

I'm creating an web app who uses a service worker to download its pages in the cache so I can use the web app offline. It is possible that the user doesn't connect to the internet for a while. I know ...
-3
votes
0answers
41 views

Caching middle man service for outbound requests [closed]

I have various services in my application that make external requests to web to scrape some data, as in Service A makes a requests to imdb.com/query and service B makes to reddit.com/query. I want to ...
3
votes
1answer
120 views

Is LRU still a good algorithm for a cache with diferent size elements?

I am currently working on a project where I need to implement a cache with limited size. The most common eviction policy seems to be Least recently used (LRU), that simply discards the least recently ...
0
votes
0answers
51 views

How to elegantly allow for lookups/dropdowns to be loaded with items marked 'Inactive' without totally messing up caching?

Where the application has the ability to mark dropdown items 'inactive' - this means to the user that particular item is no longer in use and should not be shown in dropdowns. However, it is used on ...
2
votes
3answers
111 views

Web page: randomised collection of paged items retrieved via rest api call

Using .Net web api I have a web page that renders a collection of items depending on filter values applied via an ajax call to an api endpoint. The items are paged so that if the user scrolls to the ...
1
vote
2answers
79 views

Cache maintained by caller app or by provider app in microservices inter-app communication?

Suppose there are app1 and app2 in a microservices. app2 needs to call app1's RESTful APIs. Cache is needed since the call will be frequent. So after a successful RESTful call, there will be cache ...
0
votes
0answers
26 views

How to cache timestamp based key values with a distributed cache?

I have a dataset in a key value store (similar to Cassandra). The data model is - Key - ServiceName / timestamp_in_milliseconds value - operation In the write side I get some operations for a ...
2
votes
3answers
247 views

Is caching Access Tokens on the back end of a Web Application a good idea? (access_token storage best practices)

Let's suppose we have a Web Application that uses an Open Id Connect service provider, the Web Application uses the Authorization Code flow to get access to a different API, and therefore gets an ...
0
votes
2answers
78 views

How to handle user permission changes in SPA?

I have a SPA which at the beginning of application startup calls the backend API, sends a JWT and asks for the access permissions of the current user. SPA then caches the permissions in-memory and ...
1
vote
2answers
97 views

Design optimal read operation in my service

---- Description I'd like to optimize read operation in my service. It has basically put and get methods. On put I accept some numbers in a string format and put them into thread-safe cache with ...
0
votes
0answers
118 views

Using signalR for streaming alongside a microservice architecture

I have a cluster of micro services with an exposed search API serving a client app. I want to "stream" in real time the aggregated results of a complex search. The search will be kicked of by the ...
0
votes
1answer
99 views

How to solve cache eviction when not using distributed cache in microservices?

Let's say we will not use distributed caching because we want that our microservices are independent and they do not have many single point of failures. Either we will have in-memory cache (simple ...
9
votes
1answer
4k views

Caching authenticated requests for all users

I am working on a web app that must deal with very large impulses of simultaneous users, who need to be authorized, to request identical content. In its current state, it's totally crippling to even a ...
-2
votes
1answer
63 views

Do I need a redis for caching object while MongoDB already cached frequently accessed items

I'm using mongodb for our web application. Recently I'm think of adding redis for caching objects which usually is the setting/configuration. But the mongodb already cached the frequently accessed ...
1
vote
1answer
322 views

Pros and Cons of using ASPNET.Core In-Memory Caching instead of Redis? [closed]

I know redis is a very robust caching solution and scales great, but when it comes to simpler non-enterprise websites I feel as if it's a bit too expensive (Azure Standard/C1: $100/m). I'm ...
1
vote
0answers
40 views

How to specify constant data wrt cache coherence?

I am suspecting cache latency issues due to constant data (or same data across multiprocessor caches) being churned up in the cache coherence protocols. Is there a way to specify specific data as ...
3
votes
2answers
148 views

Preventive measures for stopping developers from forgetting to update cached values

I'm at the point where results need to be cached to make the application more responsive. From experience in a previous project, countless (to say the least) bugs occurred because there was lots of ...
2
votes
1answer
138 views

How is caching used within messaging apps?

I'm actually studying about web development. I was just asking why a lot of web apps and chats(Whatsapp, Telegram, Discord, and a lot, a lot more!) are using cache. I mean, after learning cache ...
0
votes
1answer
374 views

How to store counters on Redis while minimizing potential data loss

The application I'm working on has a need to create a counter representing the number of times each piece of content has been viewed. There are two goals here: Update the counter in real time ...
5
votes
4answers
685 views

Storing objects whose size are run-time dependent contiguously in memory

The background I am working on an ECS in C++ for fun and I am trying to make it as efficient as possible. One of the optimisations I am striving to implement is to minimise cache misses by storing ...
0
votes
2answers
538 views

Preventing abuse of API which is called via client side Javascript

I'm setting up an AWS API Gateway + Lambda micro-service that will return non-sensitive but user-specific data.This means that the responses from the service can't be cached and served to multiple ...
13
votes
4answers
13k views

What is important when optimising for the CPU cache (in C)?

Reading these two questions, I see that understanding CPU caching behaviour can be important when dealing with large amounts of data in memory. I would like to understand the way the caching works to ...
2
votes
1answer
71 views

Data points to use cache or database for these three major features under scalable ecommerce? [closed]

Auto-completion :- When we start typing, does system suggest the product from cache or hit the DB every time or hit the DB only when no result found in cache ? Search:- When enter any product, does ...
2
votes
3answers
1k views

How to align on both word size and cache lines in x86

From what it sounds like, a 64 bit processor means aligning to 64 bits, which means if you have unicode utf-8 stored in there, each 8-bit chunk would take up 64 bits of space. That doesn't really make ...
1
vote
3answers
60 views

Calculating Journey Summary made by a vehicle and Cache them to database

This is more of a point me in the right direction kind of question, I have 2 solutions but both of them are invalid because the data calculated is invalid in some scenarios. I am working on a system ...
0
votes
1answer
305 views

Cache vs DB design decision?

Number of times this question comes to my and my team mind, should we persist or cache the data. I understand some time there is functional requirement that we need to persist in DB. But in my case ...
-2
votes
1answer
144 views

Design for 'inbox' with 'unread' feature

I am implementing a similar feature like the StackExchange Inbox and I have many considerations about the resource usage. My system has inbox messages, system health notifications and Achievements. ...
1
vote
1answer
47 views

Managing cache when matching datas

I'm retrieving values from 3 tables in database and trying to make them match. I was wondering how I could manage cache in an elegant way. I can't change the database structure even though one of the ...
3
votes
1answer
2k views

Microservices - sharing data through distributed in-memory cache?

I'm fairly new to both microservices and shared in-memory databases like Redis. I'm wondering though if it would be a good idea to combine the two to address the challenges of data duplication, ...
3
votes
1answer
325 views

API design and storing custom queries from Db to cache

I was thinking about how people actually implement utilising results from a cache before a doing database lookup. When designing an API, should there always be a manual check to the cache first before ...
1
vote
1answer
73 views

How to go about accessing data on a server that has large downtime periods

Where I work, there is an Oracle data warehouse that is managed by another group that contains some pretty critical information for the company to run smoothly. The issue is that they (apparently, ...
1
vote
1answer
320 views

Using a distributed system as an alternative to disk storage

So, one of the differences between "main memory" and disk storage is durability -- the data on hard disks will stay accessible and unaffected even if the host machine crashes or loses power. One can ...
-3
votes
1answer
223 views

Design the cache and search feature like hotel booking?

I need to design the feature like in encommerce(consider hotel booking site) we can enter the keyword/partial-keyword and need to return the relevant results. For Example :- If site admin or hotel ...
0
votes
1answer
49 views

What is the name for an object saving a cache of the result of operations as part of requests? [closed]

What is the conceptual term for a service that will respond to a request for a resource by: checking for its copy in a cache if it exists and isn't stale, returns it if it doesn't exist or is stale, ...
1
vote
3answers
77 views

Performance on highly filterable web pages

In our application we have a page were we list our entities with many options to filter and to search. Over time this page got slower and slower especially for large datasets, so we thought about how ...
0
votes
1answer
831 views

Pattern for web service response caching, but only use the cache for when the data store goes down or request otherwise would fail

We have a REST web service written in C# in ASP.NET MVC/WebAPI. When the underlying data store fails, this can lead to our service being completely unavailable, instantly. There is currently no ...
27
votes
3answers
20k views

Dealing with browser cache in single-page apps

I'm trying to figure out how to properly handle the web browser cache for single page apps. I have a fairly typical design: several HTML, JS and CSS files implementing the SPA, and a bunch of JSON ...
0
votes
1answer
106 views

RESTful API get requests by “modified” condition from mobile app

Currently I have following scenario. I have two projects: ASP.NET Core Web API and Xamarin.Forms app. General idea is to have consumer (Xamarin.Forms app) which is getting data from server (Web API)....
1
vote
1answer
300 views

Caching data based on dependency-graph

My team and I are currently maintaining a caching system that is purely based on keys. From what I've read we are striving for a system that's based on the cache-aside strategy. Where we have a ...
3
votes
1answer
548 views

Django: caching properties for non-changing entries

I am wondering if it is a good idea to do the following: I have a Django model (which is related to a migration, therefore it has a database entry) with a bunch of properties. Accessing these are ...
1
vote
1answer
574 views

Near real-time analytics from Cassandra with frequent updates

We have an activity metrics page where users can select a date period and see other user's aggregated activity (by action) and optionally filter everything by 4 or 5 fields. Actions happen ...
2
votes
4answers
272 views

What to call data that's not ready yet?

I often see the term stale used to refer to data that is out of date, and fresh to describe data that is up to date. Both of those make sense to me. But what do you call data that is not yet fresh, ...
1
vote
0answers
165 views

Location specific caching for read-heavy data (server architecture)

This project will serve many duplicate requests with location-specific answers. I.e. 10,000 people in New York will all get the same server response (a list of businesses in New York), but one person ...
3
votes
1answer
626 views

Persistence Strategies - Filling a cache strategy

Let's say I have an interface IDataAccessObject<TSource> with CRUD methods to access a data source. I have an implementation StrategyDataAccessObject<TSource>, which uses an strategy ...
1
vote
1answer
100 views

Distributed BiPartite Graph [closed]

I have a use case where I have a Bi-Partite Graph. Call one type of nodes "Type A" and the other "Type B." Now when a Type A node gets added, it forms some edges based on a criterion with Type B nodes ...
2
votes
1answer
582 views

Is there a way to group keys when using Memcached?

I use Memcache to store content lists with very key combinations, when user edited the content, I must refresh the cache, but it is hard to say what particular list to refresh, it is not either a good ...
0
votes
3answers
750 views

How do I handle 3rd party search result data (via cache)

I have a search function on my site and it is taking data from 6 different 3rd party resources. The problem is, it takes too long requesting the data over and over again on the results page. I've ...
2
votes
2answers
2k views

Caching mechanism for REST APIs

I have been given a project recently where REST API have been implemented in the most basic way possible i.e. request comes to app, app hits controller, queries db, returns response. So this ...
1
vote
0answers
137 views

Cache sync across nodes in a cluster

I recently started working on a Spring web application, in which a cache for some heavily used data is stored in the JVM of each node in the AWS cluster. Any change in any of the node values results ...