DZone
Database Zone
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
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Database Zone > Trade-Offs: Choosing Where to Put the Complexity

Trade-Offs: Choosing Where to Put the Complexity

Mark Needham user avatar by
Mark Needham
·
Mar. 07, 12 · Database Zone · Interview
Like (0)
Save
Tweet
4.89K Views

Join the DZone community and get the full member experience.

Join For Free

On the current application I’m working on we need to make use of some data which comes from another system so we’ve created an import script which creates a copy of that data so that we can use it in our application.

In general we’ve been trying not to do too much manipulation of the data and keeping it close to the initial structure so that if something goes wrong with the import we can more easily trace the problem back to the original data source.

Complexity

While that approach has generally been fine we recently had a situation where the way the data was stored in the original database was quite de-normalised and recreating that structure made some of the code in the data access layer quite messy.

We therefore decided to change the import script to normalise the data, thereby simplifying our database access code.

For now the complexity trade off seems ok because we haven’t had to change the schema that much so it’ll still be reasonably easy to track the data back to the source.

We currently don’t have any tests specifically around the data import because there’s not very much logic going on but if the complexity increases and we start to see problems with the import process then we’ll need to change that.

While we were having this conversation about where we should place the complexity I found it interesting that you could argue for each approach equally convincingly and neither really seemed definitively better – it was back to the world of trade offs!

Trade-off

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • When Writing Code Isn't Enough: Citizen Development and the Developer Experience
  • Is DataOps the Future of the Modern Data Stack?
  • MACH Architecture Explained
  • Is Your Code DRY or WET?

Comments

Database Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • 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
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo