Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9074361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:37:06+00:00 2026-06-16T18:37:06+00:00

I have something like: import java.util.HashMap; import java.util.List; public class A { HashMap<Long, List<B>>

  • 0

I have something like:

import java.util.HashMap;
import java.util.List;

public class A {
    HashMap<Long, List<B>> hashMap = new HashMap<Long, List<B>>();
}

class B{
    int a;
    int b;
    int c;
}

And I want to store this in database, because it will be huge huge.

I will have more 250000000 keys in HashMap and each key representing huge list of data (say list size may be around 1000).

How I can do this for best performance on retrieving list of B’s objects with Long hashKey from database?

Any other suggestions?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T18:37:07+00:00Added an answer on June 16, 2026 at 6:37 pm

    As you have a very large data set of up to 1/4 bn * 20 * 1 k or about 5 TB, the main problem you have is that it can’t be stored in memory and is too large to store on SSD, so you will have to access disk efficiently otherwise you are looking at a latency of about 8 ms per key This should be your primary concern otherwise it will take days just to access every key randomly once.

    Unless you have a good understand of how to implement this with memory mapped files you will need to use a database, preferable one design to handle large numbers of records. You with also need a disk sub-system not only for capacity but to give you more spindles so you can increase the number of requests you can perform concurrently.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Parent class. import java.util.HashMap; import java.util.Map; public class Parent { Map<String,String>
I have something like this: import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.OutputStream; import java.util.HashMap; import
I have something like the code below: for(int i=0;i<10;i++){ button=new JButton(buttons[i]); button.addActionListener(new ActionListener(){ public
I have the following code: import java.util.*; public class SellTransaction extends Transaction { private
Here is my Request class which holds a generics request: import java.util.ArrayList; import java.util.List;
Say I have something like this, which sends unhanded exceptions to logging.critical() : import
I have seen in some source code (by other developers) something like this: #import
I have something like this: [{'date': 1, 'value':5}, {'date':2,'value':3}, ...] and want to map
I'd like to print a formatted time (clientside), I'm using the following: import java.util.Date;
I have a code piece that looks something like what I've pasted below: import

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.