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 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
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
Partner Zones AWS Cloud
by AWS Developer Relations
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
Partner Zones
AWS Cloud
by AWS Developer Relations
Building Scalable Real-Time Apps with AstraDB and Vaadin
Register Now

Trending

  • Extending Java APIs: Add Missing Features Without the Hassle
  • Auditing Tools for Kubernetes
  • Effortlessly Streamlining Test-Driven Development and CI Testing for Kafka Developers
  • Design Patterns for Microservices: Ambassador, Anti-Corruption Layer, and Backends for Frontends

Trending

  • Extending Java APIs: Add Missing Features Without the Hassle
  • Auditing Tools for Kubernetes
  • Effortlessly Streamlining Test-Driven Development and CI Testing for Kafka Developers
  • Design Patterns for Microservices: Ambassador, Anti-Corruption Layer, and Backends for Frontends
  1. DZone
  2. Data Engineering
  3. Databases
  4. The wages of sin: Hit that database one more time…

The wages of sin: Hit that database one more time…

Oren Eini user avatar by
Oren Eini
·
Mar. 24, 11 · News
Like (0)
Save
Tweet
Share
3.67K Views

Join the DZone community and get the full member experience.

Join For Free

this time, this is a review of the sharp commerce application. again, i have stumbled upon the application by pure chance, and i have very little notion about who wrote it.

you might have wondered why i named this blog series the way i did, i named it because of the method outline below. please note that i had to invent a new system to visualize the data access behavior on this system:

image

  • in red, we have queries that are executed once: 3 queries total.
  • in aqua, we have queries that are executed once for each item in the order: 2 queries per each product in the order.
  • in purple, we have queries that are executed once for each attribute in each of the products in the order: 1 query per attribute per product in the order.

now, just to give you some idea, let us say that i order 5 items, and each item have 5 attributes…

we get the following queries:

  • 3 queries – basic method cost
  • 10 queries – 2 queries per each product
  • 25 queries – 1 query for each attribute for each product

totaling in 38 queries for creating a fairly simple order. after seeing this during the course review of the application, i have used that term for this method, because it is almost too easy to make those sort of mistakes.

Database

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

Opinions expressed by DZone contributors are their own.

Trending

  • Extending Java APIs: Add Missing Features Without the Hassle
  • Auditing Tools for Kubernetes
  • Effortlessly Streamlining Test-Driven Development and CI Testing for Kafka Developers
  • Design Patterns for Microservices: Ambassador, Anti-Corruption Layer, and Backends for Frontends

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

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com

Let's be friends: