Identity map pattern: Difference between revisions

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
imported>Frap
Remove category
 
imported>Chimneychobga
m Added short description
 
Line 1: Line 1:
{{Short description|Database access design pattern}}
{{One source|date=April 2020}}
{{One source|date=April 2020}}


In the design of [[database|DBMS]], the '''identity map pattern''' is a database access [[Software design pattern|design pattern]] used to improve performance by providing a context-specific, in-memory [[database caching|cache]] to prevent duplicate retrieval of the same object data from the database.<ref>{{cite book | last = Fowler | first = Martin | title = Patterns of Enterprise Application Architecture | pages = 195–199 | publisher = Addison-Wesley | isbn = 0-321-12742-0 | year = 2003
In [[database]] design, the '''identity map pattern''' is a database access [[Software design pattern|design pattern]] used to improve performance by providing a context-specific, in-memory [[database caching|cache]] to prevent duplicate retrieval of the same object data from the database.<ref>{{cite book | last = Fowler | first = Martin | title = Patterns of Enterprise Application Architecture | pages = 195–199 | publisher = Addison-Wesley | isbn = 0-321-12742-0 | year = 2003
}}</ref>
}}</ref>



Latest revision as of 17:32, 5 November 2025

Template:Short description Template:One source

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.[1]

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

  1. Explicit
  2. Generic
  3. Session
  4. Class

See also

References

Template:Reflist

Template:Design Patterns Patterns


Template:Asbox

  1. Script error: No such module "citation/CS1".