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
2answers
82 views

Caching expensive sql queries on first page load

I have a web application with an express/node backend using typeorm and PostgreSQL. The home page in my app is a query with lots of inner joins that shows the user a complex report. This query takes ...
0
votes
1answer
58 views

Design review for a Cache aside system

I am maintaining a system where a list of string ids are stored against a container (using the term here as a generic entity) object. The database used is MySQL and the table structure looks like this....
0
votes
1answer
39 views

How do I decide an initial in-memory cache size given my DB size and expected load throughput?

(Purely for learning purposes) Say the DB contains 1 billion rows with 200 bytes per row = 200 GB of data. The traffic at peak is 1000 requests/s, with each request asking for one DB row. What cache ...
0
votes
0answers
23 views

Is it ok to cache the user password in Hibernate two-level cache, if not, how to avoid it?

I am working on a blog system, and use Hibernate as my ORM framework. The blog system has Post and Comment entities. Both of them has a nested author field, associated with the User entity by a ...
0
votes
0answers
25 views

Best way to implement Shopify-like cache for products?

I'm currently building a shopping cart from scratch and am thinking of how I can cache the individual products as well as the product lists (e.g. Show All products page, Show 'Cakes' only page, Show '...
0
votes
1answer
32 views

Caching or in-memory table in Azure for performance

I am building an Angular web application that retrieves part of its data from a Azure SQL Database table via APIs developed in Azure Functions (with Azure API Management at the API Gateway). The data ...
1
vote
1answer
37 views

Writing a data-oriented ECS update loop that handles multiple components

So I have an engine in progress that's structured like this: entities are simple ids (unsigned short) components are stored in pools which are static members systems are stored by the manager, and ...
0
votes
1answer
55 views

Caching strategy for a fast front-end search

I'd like to implement a fast, smooth search. Searched items are not that many: ~100 max. Each item holds the amount of data a facebook event would hold. They will all show up on initial load (maybe an ...
-2
votes
1answer
45 views

Reducing duplicate API call between micro services in a latency sensitive flow

Let's suppose that I have 5 microservices, let's also name them ServiceA, ServiceB, ServiceC, ServiceD, ServiceE. To perform an operation X communication needs to happen between these services. And ...
1
vote
0answers
40 views

Architect Java Hashmap Hierarchy to its equivalent in Redis Cache?

I have the following Job class representing runs of a job. I have a list of start and end times in Job class because the same Job can be rerun. public class Job { private final List<...
0
votes
1answer
45 views

what extra benefit do I get from a caching layer over the caching layer of the database?

I'm looking at the design of dropbox's edgestore. It manages several thousands of MySql instances, where all dropbox's metadata resides (users, filenames, etc.). I understand why sharding is ...
0
votes
0answers
27 views

Cache graph with hierachy

I'm looking to build a graph that's tied to any caching system that I can interact with. Its only goal is when an item is deleted, based on its "linked items", to also delete these. A partial rebuild ...
2
votes
1answer
256 views

How to perform consistent hashing on any Python object that works with hash()?

I have a Python library that performs a kind of calculation given a parameter-object. A requirement of the parameter object is that it be both hashable and serializable. It's a long calculation, so it ...
0
votes
3answers
313 views

ASP.NET MVC - Using Session Variables or Caching to prevent unnecessary calls. Is it a good practice in general?

I have an application that consists of multiple sections of which each section will need to load data from various API calls. Now I'm thinking of taking advantage of Session variables(or caching) to ...
-3
votes
1answer
69 views

How to exchange 1T data between multiple processes?

How to exchange 1T data between multiple processes? Requirements: Data < 1TB. Memory > 1T. Multiple processes (different languages) on the same machine or different machines over network Data ...
1
vote
1answer
66 views

Uncertain of cache solutions for CAD models

I am running a personal project of offering 3D model generation as a service (in this case CAD model). Since most of the generation of 3D models take a long time, I thought about using cache to ...
-2
votes
1answer
115 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 ...
4
votes
1answer
352 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 ...
1
vote
2answers
117 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
46 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 ...
0
votes
4answers
588 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 ...
4
votes
3answers
3k 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
0answers
329 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 ...
1
vote
2answers
98 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
1answer
155 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 ...
-2
votes
1answer
130 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
865 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
44 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 ...
5
votes
1answer
681 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 ...
1
vote
1answer
764 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 ...
3
votes
3answers
2k 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
61 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
1k 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
72 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
1answer
182 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
48 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 ...
4
votes
1answer
3k 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, ...
4
votes
1answer
575 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, ...
0
votes
2answers
763 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 ...
-3
votes
1answer
285 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
95 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 ...
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 ...
0
votes
1answer
940 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 ...
0
votes
1answer
138 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
353 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 ...
2
votes
4answers
291 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
2 3 4 5