DEV Community

Raja Upadhyay
Raja Upadhyay

Posted on

1 1

Storage and Retrieval

  • Indexes are used in databases to speed up reads. Any kind of index usually slows down writes, because the index also needs to be updated every time data is written.

A clustered index stores all row data within the index.
A non-clustered index only stores the references (to heap file) to the data within the index.
A covering index stores some of a table's columns within the index. This allows some queries to be answered using the index alone.

Indexes duplicate data and although they speed up reads, they require additional storage and can add overhead on writes.

Multi-column indexes enables efficient querying of multiple columns at once. e.g. a multi-column index on (date, temp) can be used to efficiently find all observations in 2013 where the temp was between 25 and 30 degrees. With a 1D index, you would have to either scan all records from 2013 and then filter (or vice vera).

In memory databases

The performance advantage of in-memory databases is not due to the fact that they don't need to read from disk - even a disk-based storage engine may not need to read from disk if there is enough memory since the OS caches recently used disk blocks in memory anyway. The performance advantage comes from not having to encode in-memory data structures in a format that can be written to disk.

OLTP vs OLAP access pattern

OLTP (Online Transaction Processing) is an access pattern that is widely used in interactive applications where records are inserted/updated based on user input e.g. actions in a game.

OLAP (Online Analytics Processing) is an access pattern used for analytic queries and business intelligence.

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

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

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay