Identity Map Pattern

In the design of database management systems, 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 four types of Identity Map

  • Explicit
  • Generic
  • Session
  • Class

Famous quotes containing the words identity, map and/or pattern:

    Personal change, growth, development, identity formation—these tasks that once were thought to belong to childhood and adolescence alone now are recognized as part of adult life as well. Gone is the belief that adulthood is, or ought to be, a time of internal peace and comfort, that growing pains belong only to the young; gone the belief that these are marker events—a job, a mate, a child—through which we will pass into a life of relative ease.
    Lillian Breslow Rubin (20th century)

    Unless, governor, teacher inspector, visitor,
    This map becomes their window and these windows
    That open on their lives like crouching tombs
    Break, O break open,
    Stephen Spender (1909–1995)

    It was her stern necessity: all things
    Are of one pattern made; bird, beast, and flower,
    Deceive us, seeming to be many things,
    And are but one. Beheld far off, they differ
    As God and devil; bring them to the mind,
    They dull its edge with their monotony.
    Ralph Waldo Emerson (1803–1882)