DEV Community

Aniketh Deshpande
Aniketh Deshpande

Posted on

1

Write Through

Write through cache is a simple to implement caching mechanism.

  • Here the newly arrived data is written into cache and as well as persisted into the disk or a database. Atomicity is maintained.

There are two ways to implement it:
1] The application writes data to cache and database simultaneously

Write through cache

2] The application writes data to cache and then the cache writes the data into the database.

Write through cache 2

Advantages:
  • Simple to implement.
  • Faster response times.
  • Data integrity because of atomic nature of write operation.
  • Lower latency for subsequent reads.
Disadvantages:
  • Cache pollution: Since every time the data is filled into cache, it can get filled with less frequently read data and more cache eviction which could introduce some latency.

  • Not suitable for write intensive scenarios as the write operations are slower compared to other methods because data needs to be written in cache as well as persistent storage everytime.

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more →

Top comments (1)

Collapse
 
rudu1 profile image
Rudram •

wah subhanallah!

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more