---
title: Identity map pattern
slug: identity-map-pattern
qid: 
snapshot: enwiki-001320591548
content_hash: 
license: CC BY-SA 4.0
source: https://en.wikipedia.org/w/index.php?oldid=1320591548
tags: [20346051, 22906453, 23118434, 23468805, 23603337, 24043274, 27695885, 63106071]
---

# Identity map pattern

> [!note] Provenance
> Snapshot `enwiki-001320591548` · content root `…`
> Derived from <https://en.wikipedia.org/w/index.php?oldid=1320591548> · Licensed CC BY-SA 4.0

In database design, the identity map pattern is a database access design pattern used to improve performance by providing a context-specific, in-memory cache to prevent duplicate retrieval of the same object data from the database. If the requested data has already been loaded from the database, the identity map returns the same instance of the already instantiated object, but if it has not been loaded yet, it loads it and stores the new object in the map. In this way, it follows a similar principle to lazy loading. There are 4 types of identity maps #Explicit #Generic #Session #Class

In database design, the identity map pattern is a database access design pattern used to improve performance by providing a context-specific, in-memory cache to prevent duplicate retrieval of the same object data from the database. If the requested data has already been loaded from the database, the identity map returns the same instance of the already instantiated object, but if it has not been loaded yet, it loads it and stores the new object in the map. In this way, it follows a similar principle to lazy loading. There are 4 types of identity maps Explicit Generic Session Class
