I need to have very fast access to a big Map – several millions of entries. Is it worth using an SQLite in-memory database to keep that map as opposed to just having that HashMap in memory?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
its depends on the services you require from your data structure. do you only need to retrieve values from the map? or do you need to do a complex query or sorting?.
there is nothing magical about a database internal structure, to make it arbitrary faster then a simple data structure . In the database there are more facilities to manipulate large sets of data that probably will cost in an overheard of CPU and memory. if you only need a dictionary like functionality , go with a map, for something more complex consider a database