Database Reference
In-Depth Information
Hence while adopting technology and databases we must keep this in mind to avoid
such performance overheads.
Logical and Physical Reads
Logical reads mean reading rows from the data cache, whereas physical reads seek disc
access. The higher side on logical reads tends to have a big memory footprint, and,
similarly, frequent physical reads introduce read latency and can introduce performance
overhead. Hence it is important to strike a balance between both. Cassandra provides
row and key cache along with memtables to reduce physical reads. We will discuss
these in detail in this chapter.
Next, let's discuss various Cassandra-specific configurations. During the latter part
of this chapter we will cover performance monitoring and tuning for front-end applica-
tions, as well.
Cassandra Configuration
Cassandra offers multiple configurations that can be tweaked for heavy read/write load.
Let's explore them one by one, starting with cache configuration.
Data Caches
Data caches keep frequently accessed rows in memory to avoid disc access at the serv-
er side. In n-tier architecture, data caching can also be implemented at the client side
(e.g., Ehcache). The concept of data caching is not new and has been there with tradi-
tional RDBMS, as well. Data cache is very useful with read operations, and it is recom-
mended to opt for database level caches for frequently fetched data. Cassandra offers
both key and row caches.
Figure 8-1
shows a flow chart diagram of how these caches
work while reading data from the Cassandra database.