Skip to content

170 practical guides on SAP, cybersecurity and AI, $49 each. Shop all books ›

0

Blog›SAP

What Is SAP HANA? The In-Memory Database Explained

SAP HANA is SAP’s in-memory, column-based database and the engine under S/4HANA. Here is how it works and why it matters, explained simply.

SAP HANA is SAP’s database. What makes it different is that it keeps data in memory, in columns, so it can process business transactions and run analytics on the same live data, very fast. SAP HANA is the foundation of SAP S/4HANA, and its cloud version, SAP HANA Cloud, powers many of SAP’s cloud and AI services. This guide explains what HANA is, how it works and why it matters.

In one sentence: SAP HANA is an in-memory, column-based, multi-model database that lets companies run transactions and real-time analytics in one system.

What problem did HANA solve?

For a long time, companies ran two kinds of systems. Transactional systems (OLTP) recorded each sale, payment and goods movement. Analytical systems (OLAP), such as data warehouses, received copies of that data overnight so managers could run reports without slowing down the transactional system.

That meant reports were often a day old, data had to be copied and reconciled, and companies paid for two sets of infrastructure. SAP HANA, introduced in 2010 and generally available from 2011, was built to do both jobs in one database, on live data, by using two ideas: in-memory storage and columnar storage.

Idea 1: in-memory

Traditional databases keep data on disk and bring pieces of it into memory when needed. Memory (RAM) is far faster than disk, so HANA keeps its working data in memory and treats disk mainly as a place to save data safely in case of a restart.

The result is that HANA can scan and calculate over very large amounts of data in a fraction of the time a disk-based database would need. Memory is more expensive than disk, which is why HANA also compresses data heavily and offers ways to move older data to cheaper storage.

Idea 2: columns instead of rows

Most classic databases store data row by row, which suits reading and writing one record at a time. HANA mainly stores data column by column.

Row store Column store
How data is laid out All fields of one record together All values of one field together
Good at Reading or writing a single full record Scanning, filtering and adding up many records
Compression Moderate Very high, because similar values sit together
Typical use Classic transactional systems Analytics, and in HANA, transactions too

Imagine a sales table with millions of rows and you want total sales by country. A column store only needs to read the “country” and “amount” columns, which are compact and compressed, instead of every full row. Combined with in-memory speed and parallel processing across many CPU cores, that is what makes HANA fast.

Multi-model: more than tables

HANA is primarily a relational database, but it is also multi-model. It can store and query several kinds of data in the same engine:

  • relational tables, queried with SQL and SAP’s SQLScript;
  • JSON documents;
  • spatial (geographic) data;
  • graph data, including knowledge graphs queried with SPARQL;
  • text, with full-text search;
  • vectors, through the vector engine used for AI and similarity search.

The vector engine and knowledge graph engine matter for AI. They let applications ground large language models in a company’s own documents and business relationships, without copying data into separate specialist databases.

HANA and S/4HANA

The “HANA” in S/4HANA is not a coincidence. SAP rebuilt its ERP to run only on SAP HANA, and used HANA’s speed to simplify the data model. Many old aggregate and index tables were removed because HANA can calculate totals on the fly. For example, S/4HANA’s Universal Journal (table ACDOCA) brings financial and controlling line items into one table that reports can read directly.

So if a company moves from SAP ECC to S/4HANA, it moves to SAP HANA too.

Ways to run HANA

Option What it means
SAP HANA (on-premise) You install and run SAP HANA 2.0 on certified hardware in your own data center or on infrastructure you manage
Hosted / private cloud HANA runs in a cloud, often as part of RISE with SAP, managed by SAP or a partner
SAP HANA Cloud A fully managed database-as-a-service on SAP BTP, generally available since 2020, with data tiering and a built-in data lake

Keeping costs under control: data tiering

Not all data needs to be in memory. HANA offers data tiering: frequently used (“hot”) data stays in memory, less-used (“warm”) data can sit on disk in HANA’s native storage extension, and rarely used (“cold”) data can move to a data lake. Queries can still reach all of it, but the expensive memory is used where it matters.

Security basics for HANA

Because HANA holds a company’s core data, it needs its own security care:

  • Users and roles: database users, roles and privileges decide who can read or change data. Highly privileged users such as SYSTEM should be locked down and monitored.
  • Encryption: data can be encrypted in memory persistence, in backups and in transit.
  • Auditing: audit policies record access to sensitive data and changes to users and privileges.
  • Patching and hardening: SAP publishes security notes for HANA, and secure configuration baselines should be checked regularly.

Who works with SAP HANA?

  • Basis and database administrators install, size, back up, patch and tune HANA.
  • Developers and data modelers build calculation views, SQLScript procedures and CDS views on top of HANA.
  • Data and AI teams use HANA Cloud for analytics, vectors and knowledge graphs.
  • Security teams manage HANA users and roles, encryption, auditing and monitoring.

Frequently asked questions

What does HANA stand for?

It is often expanded as “High-performance ANalytic Appliance”, from its early days as an appliance for analytics. Today SAP simply uses the name SAP HANA.

Is SAP HANA only for SAP software?

No. HANA is a general-purpose database and can run custom applications and non-SAP workloads, although most customers use it with SAP applications.

Is HANA the same as S/4HANA?

No. HANA is the database; S/4HANA is the ERP application that runs on it.

Why is HANA expensive?

Memory costs more than disk, and HANA is licensed as a premium database. Compression and data tiering help keep the memory footprint, and the cost, under control.

The bottom line

SAP HANA changed enterprise software by keeping data in memory and in columns, so the same database can run transactions and real-time analytics. It is the engine under S/4HANA, and through HANA Cloud, with its vector and knowledge graph engines, it is also a foundation for SAP’s AI. If you work with modern SAP, you work with HANA, even when you never see it.

Go deeper with these books