DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Full-Stack Observability Essentials: Explore the fundamentals of system-wide observability and key components of the OpenTelemetry standard.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • Data Annotation's Essential Role in Machine Learning Success
  • Auditing Spring Boot Using JPA, Hibernate, and Spring Data JPA
  • OneStream Fast Data Extracts APIs
  • Artificial Intelligence (AI) Utilizing Deep Learning Techniques to Enhance ADAS

Trending

  • Choosing the Appropriate AWS Load Balancer: ALB vs. NLB
  • REST vs. Message Brokers: Choosing the Right Communication
  • Deploy Like a Pro: Mastering the Best Practices for Code Deployment
  • How To Verify Database Connection From a Spring Boot Application
  1. DZone
  2. Data Engineering
  3. Data
  4. The Cost of Getting Data from LevelDB

The Cost of Getting Data from LevelDB

Oren Eini user avatar by
Oren Eini
·
Mar. 12, 13 · Interview
Like (0)
Save
Tweet
Share
4.76K Views

Join the DZone community and get the full member experience.

Join For Free

we are currently investigating the usage of leveldb as a storage engine in ravendb. some of the things that we feel very strongly about is transactions (leveldb doesn’t have it) and performance (for a different definition of the one usually bandied about).

leveldb does have atomicity, and the rest of cid can be built atop of that without too much complexity (already done, in fact). but we run into an issue when looking at the performance of reading. i am not sure if that is unique or not, but in our scenario, we typically deal with relatively large values. documents of several mb are quite common. that means that we are pretty sensitive to memory allocations. it doesn’t help that we have very little control on the large object heap, so it was with great interest that we looked at how leveldb did things.

reading the actual code make a lot of sense (more on that later, i will probably go through a big review of that). but there was one story that really didn’t make any sense to us, reading a value by key.

we started out using leveldb sharp :

database.get("users/1");

this in turn result in the following getting called:

image

a few things to note here. all from the point of view of someone who deals with very large values.

  • valueptr is not released, even though it was allocated by us.
  • we copy the value from valueptr into a string, resulting in two copies of the data and twice the memory usage.
  • there is no way to get just partial data.
  • there is no way to get binary data (for example, encrypted)
  • this is going to be putting a lot of pressure on the large object heap.

but wait, it actually gets better. let us look at the leveldb method that get called:

image

so we are actually copying the data multiple times now. for fun, the db->rep->get() call also copy the data. and that is pretty much where we stopped looking.

we are actually going to need to write a new c api and export that to be able to make use of that in our c# code. fun, or not.

LevelDB Data (computing)

Published at DZone with permission of Oren Eini, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Data Annotation's Essential Role in Machine Learning Success
  • Auditing Spring Boot Using JPA, Hibernate, and Spring Data JPA
  • OneStream Fast Data Extracts APIs
  • Artificial Intelligence (AI) Utilizing Deep Learning Techniques to Enhance ADAS

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: