# Why and how we use primitive maps

DevFeed: [Why and how we use primitive maps](<https://devfeed.tech/articles/why-and-how-we-use-primitive-maps-28019.md>)

Original publisher: [Read original article](<https://tech.trivago.com/post/2022-03-09-why-and-how-we-use-primitive-maps/>)

Author: Mikhail Chernyakov Senior Software Engineer

Published: 2022-03-09T00:00:00Z

Content type: tutorial

Language: en

Sources: [Trivago](<https://devfeed.tech/sources/trivago.md>)

Topics: [data](<https://devfeed.tech/topics/data.md>), [Java](<https://devfeed.tech/topics/java.md>), [Optimization](<https://devfeed.tech/topics/optimization.md>), [Data structures](<https://devfeed.tech/topics/data-structures.md>)

Tags: [backend](<https://devfeed.tech/tags/backend.md>), [big-data](<https://devfeed.tech/tags/big-data.md>), [data](<https://devfeed.tech/tags/data.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [java](<https://devfeed.tech/tags/java.md>), [memory](<https://devfeed.tech/tags/memory.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [optimization](<https://devfeed.tech/tags/optimization.md>), [performance](<https://devfeed.tech/tags/performance.md>), [structure](<https://devfeed.tech/tags/structure.md>)

## AI overview

This article explains how trivago uses concurrent wrappers around primitive maps in Java-based in-memory storage services. It describes bit-packing records into primitive values to reduce memory overhead when storing billions of records.

## Source excerpt

At trivago we operate on petabytes of data. In live-traffic applications that are related to the bidding business cases we use our in-house in-memory key-value storage-service written in Java to...