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
1 vote
2 answers
172 views

Handling simultaneous duplicate expensive read-only HTTP requests

(updated) We have a read-only REST endpoint that performs a somewhat “expensive“ but transient request. Without client needing to poll, we need a mechanism for the server to avoid unnecessary ...
eliangius's user avatar
  • 111
3 votes
1 answer
1k views

Best way to store quite large JSON objects?

I'm building an app where I need access to quite large reports about different publicly accessible URLs, JSON objects about 200kb to 500kB in size. Each user would generate hundreds of these reports ...
any_h's user avatar
  • 131
0 votes
1 answer
103 views

How can I implement a lazy-loading cache for REST objects with custom role-based access?

I'm thinking through adding a lazy-loading cache to my API. Currently, REST objects are filtered out (scoped) based on the user's role, and additional constraints in the system. Users of the same role ...
Brady Dean's user avatar
0 votes
3 answers
129 views

Optimizing writes over the same entity in relational DB

I am developing a micro service that saves votes to a relational database. I have a use case with an entity that represents an aggregation of votes. I receive events from voters saying that they vote ...
jesantana's user avatar
  • 146
0 votes
0 answers
76 views

Cache publishing updates, or clients polling the cache?

Context: I am working on an application which loads a cache on startup - periodically refreshed. However it turns out that this cache is something which is very general and can be used by other ...
r4bb1t's user avatar
  • 109
-1 votes
1 answer
64 views

Is it practical to cache multiple instances of variable API data (updates hourly for each instance) for N users?

I'm using flask with SQLAlchemy on a postgresql database for a mobile app I'm building. My application allows a single user to save lets say up to 5 different locations which are saved in the database....
joepaji's user avatar
0 votes
1 answer
208 views

Optimal way Implement a Session Cache

I have an App that connects with Salesforce and do different operations. So I'm trying to implement a Session Cache for the Application to avoid repetitive login calls. So far what I have done is I ...
Arun Lal's user avatar
0 votes
0 answers
99 views

How to generate idempotency token for remote cache

We are using a client library over Memcache. This library has a lot of logic for Memcache client and is indispensable in current form. One of the API of the library is put which internally just uses ...
Saurav Prakash's user avatar
14 votes
5 answers
6k views

How can I efficiently diff a CSV file against a database?

I have an inventory of products stored in Postgres. I need to be able to take a CSV file and get a list of changes—the things in the CSV file that are different to what is in the database. The CSV ...
Isvara's user avatar
  • 620
0 votes
2 answers
2k views

Simple Java Spring Boot Cache for multi-container system

I have a requirement to cache some static data as it is being consumed by our system. There is a static API that gives a map of records and we are fetching the corresponding record based on request. ...
Hindol Dey's user avatar
0 votes
0 answers
72 views

Effective cache solution to have the newest data in React Native

Goal We have an app with different articles. I want to cache an article when the user has read it, but make sure that I display the latest data. I came up with this hook: React.useEffect(() => { ...
Gh05d's user avatar
  • 101
1 vote
1 answer
95 views

Contextual Implementation Overhead vs Redundancy

I have an application that has use cases relative to where it is used. A local client and server, where all the server data is in a single location and the client queries that server knowing it is ...
FinalFortune's user avatar
-2 votes
1 answer
68 views

Should cached data be kept separate from primary tables?

I have a table in an SQL database for storing information about some business object that looks something like this (details changed so as not to give away what company I work for): CREATE TABLE ...
Omegastick's user avatar
1 vote
1 answer
2k views

Can cache be shared among services via Redis/Hazelcast?

Can cache be shared among services via Redis/Hazelcast? I have a few microservices A, B, C etc. The Microservice C is mainly for helping other services. Service C periodically updates cache - so that ...
RamPrakash's user avatar
-1 votes
1 answer
34 views

Options to maintain queue of resources that will be uniquely returned

I need to maintain a queue of resources in a cache such that when multiple clients try to pop elements from the queue concurrently, each element would be uniquely returned to only one of the clients. ...
Aadith Ramia's user avatar
0 votes
1 answer
300 views

Low Latency for multi-million record database in a web app [closed]

As a forewarning, this is for a school project with other school teammates, so my question is just for the sake of learning best practices. We are creating a recommendation system web app which ...
RocketSocks22's user avatar
0 votes
0 answers
121 views

Should I use ETag Cache on all HTTP Responses?

I was wondering if there is any downside to using E-Tag cache for every request and response. To be more specific, I'm building a data heavy SPA connected to a Laravel API and the client insists that ...
Ali Rahimi's user avatar
-1 votes
2 answers
211 views

Should I make all my business logic depend on the data that comes from the cache?

One of my web services hits a few hundred thousand visits per day where most of the operations are CRUD and we are thinking to get a cache sitting in front of our SQL database. I have had implemented ...
parse's user avatar
  • 107
3 votes
1 answer
1k views

Best strategy to flush Redis cache used in a distributed environment

Current setup: We follow the cache-first strategy right now. Always fetch from the cache first. If absent in cache, fetch from DB and update the cache. Cache TTL is 30 min. After this, the cache-key ...
YetAnotherBot's user avatar
0 votes
2 answers
416 views

Taking load off of Rest API with Cloudflare Cache?

I have a server running on AWS which serves data, that is not changing too often (think about a CMS system) to multiple clients. This service is critical for most of the client apps, thus I want to ...
godzsa's user avatar
  • 109
0 votes
1 answer
190 views

Is it possible for the CPU to read or write to the cache, while I/O device is reading main memory?

If an I/O device is reading the main memory (directly) then is it possible for the CPU to access the cache? I think it's possible for the CPU to access the cache in case of a hit. But in case of a ...
Mugen's user avatar
  • 111
-2 votes
1 answer
269 views

Recommended way of caching weather information

I'm developing an application that will show some weather information based on the user's location. Since the weather forecast is just a very small feature of the app that complements the main ones, I ...
Cornwell's user avatar
  • 117
0 votes
1 answer
48 views

What is the added value of using cache control header on top of CDN for a web application?

I'm a developer on a website which has a server which serves HTML and another server which handles API requests. I use a CDN to cache both the HTML and API responses. I feel that it gives me all the ...
Yos's user avatar
  • 155
-4 votes
1 answer
281 views

Design a login system

I have a task of designing login system with the requirement below: If the user login over three times, lock account for the first 5 minutes. The next failed 3 times login-in will lock the user ...
kungho's user avatar
  • 101
1 vote
0 answers
149 views

Near Real-Time Data Aggregation using Complex Queries

We are working on a multi-tenant SaaS product that has a ledger of all tenant customer transactions, which we use to track invoice states on a line-item level. This particular application will result ...
André Haupt's user avatar
0 votes
4 answers
261 views

Where is network data stored while awaiting to be written to disk?

I think download rates may depend on these 3 factors: the Network Infrastructure (router, VPN, network card, towers), the RAM or cache, the Final Storage (HDD or SDD or whatnot). So we take this as an ...
vixalien's user avatar
  • 133
0 votes
1 answer
40 views

Fast sliding cache counter

We have an email system that handles incoming and outgoing emails, the risk is that we get so called feedback loops, a bounce email is answered with another bounce etc. We have safeguards in place to ...
Roger Far's user avatar
  • 301
0 votes
2 answers
506 views

What are the differences between memory coherence and cache coherence?

https://en.wikipedia.org/wiki/Memory_coherence says: Memory coherence is an issue that affects the design of computer systems in which two or more processors or cores share a common area of memory.[1]...
Tim's user avatar
  • 5,415
-1 votes
1 answer
442 views

Can I call a WCF endpoint from ASP.Net Web API?

I have a web api with controller methods that use rest http(post/get calls). Clients consume this API with normal httpclient calls and I pass an http response back. My use case is I have a legacy ...
Terrance Jackson's user avatar
3 votes
1 answer
565 views

ASP.NET MVC Caching of ViewModels

My question is regarding caching and ViewModels in ASP.NET (Core) MVC. I have a service which injects a Repository<T> which is used to fetch domain models from the database. The service layer ...
Duane's user avatar
  • 139
1 vote
3 answers
3k views

Redis write-through cache vs write-behind cache (message queue?)

I have a simple use case: Newsfeeds aggregated based on posts that are linked to geopoints Users can comment on feed posts Users can like feed posts and comments I'm certain that Redis as a cache ...
Trace's user avatar
  • 185
3 votes
1 answer
180 views

Design that hides cache as an implementation detail

I have a type which is fairly heavy (maintains an off-heap object), and which can be uniquely derived from a String. It requires cleanup, so of course the type has a close() method, but it is used in ...
amalloy's user avatar
  • 142
0 votes
0 answers
89 views

Handle big data sets in a web application in combination with real-time communication between web-clients

We have the following use case to be developing: A web application that shows a data table / data grid with up to 100000 rows and 30-50 columns. Each column is filterable and sortable. The web ...
OPunktSchmidt's user avatar
2 votes
2 answers
193 views

Where to place an in-memory cache to handle repetitive bursts of database queries from several downstream sources, all within a few milliseconds span

I'm working on a Java service that runs on Google Cloud Platform and utilizes a MySQL database via Cloud SQL. The database stores simple relationships between users, accounts they belong to, and ...
Andrew Cheong's user avatar
-1 votes
1 answer
106 views

Strategy to make sure relevant cache records are expired on data update

In our database, we have around 150 different tables. However, there are a handful of them that are key, as in they get referenced pretty much everywhere. We also have quite a few reports that we pull ...
Riz's user avatar
  • 196
1 vote
2 answers
347 views

How to cache duplicate fetch and save calls that are fired within the same second

I have a service which provides an endpoint that fetches from another service, saves, and returns an record. Here are the details: The caller calls the endpoint using an identifier (say a customer's ...
Wenduo's user avatar
  • 19
7 votes
3 answers
981 views

Best way to reduce database writes?

I couldn't find a similar enough thread, so i'm making a new one. My question is about reducing database writes. Context is that I have an application which increments a number in a database every ...
Epic Speedy's user avatar
-2 votes
2 answers
266 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 ...
CamJohnson26's user avatar
-1 votes
1 answer
116 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....
DrunkOnBytes's user avatar
1 vote
2 answers
376 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 ...
user2495123's user avatar
0 votes
1 answer
587 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 ...
Tanmoy Sengupta's user avatar
1 vote
1 answer
140 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 ...
leonardo vegetti's user avatar
0 votes
1 answer
257 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 ...
Georgian's user avatar
  • 101
-2 votes
1 answer
319 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 ...
Amit Upadhyay's user avatar
1 vote
0 answers
187 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<...
ThinkGeek's user avatar
  • 119
0 votes
1 answer
69 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 ...
ihadanny's user avatar
  • 123
0 votes
0 answers
46 views

Cache graph with hierarchy

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 ...
Daniel M's user avatar
8 votes
4 answers
3k 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 ...
nben's user avatar
  • 345
0 votes
3 answers
5k 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 ...
knewit's user avatar
  • 17
-3 votes
1 answer
78 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 ...
Jill Clover's user avatar

1
2 3 4 5