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

  • SEARCH
  • Home
  • 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 9005889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:15:53+00:00 2026-06-16T01:15:53+00:00

Is it best practice to model CoreData objects exactly like your relational database? I

  • 0

Is it best practice to model CoreData objects exactly like your relational database? I know CoreData is NOT a relational db.

So would I have the following objects (I know I shouldn’t have id fields in relationships):

Business 
Building (Business has many locations; relationship)
Location (building has a location relationship)
Coord (Locations has a lat/long coord)
Worker (work has relationship to business and to location)

Is this to much of a breakdown? Would it be better to just have a worker and that has a work address attribute and a business attribute? Should building just have address, city, state, zip fields rather than a relationship to location?

  • 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-16T01:15:54+00:00Added an answer on June 16, 2026 at 1:15 am

    One guiding principle here should be that faulting means no memory usage. This is usually very desirable (in fact, it’s one of the main reasons you’re using Core Data in the first place). A building with a location relationship means we don’t have to load the location information just to load a building; instead, we fault, and fetch the location information only if it is actually needed.

    But the opposite consideration also applies. You should resist the temptation to over-normalize your model. This is not a SQL database. A relationship means that we can’t fetch the data without a separate loading stage. That takes overhead and time. So if you have single facts that you’re going to want to access whenever you access an object, they should be in the object so that they are loaded with them.

    In your case I’d say you’re way overnormalized. Unless you are going to do something very interesting with coordinates, for example, I don’t see why coordinates should not be part of a location. And unless you are going to do something locations as separate objects, I don’t see why a building doesn’t just have an address.

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

Sidebar

Related Questions

I would like to know what the best practice is for the following scenario:-
I would like to know what would be the best practice. I have been
I would love some best practice feedback on the security model I have come
Would it be best practice to create a model in your asp.net mvc -
What is the best way to model the following... Assume I have two objects:
I wonder what the best practice is to deal with a data model like
Is using one database column for each attribute in an ER-model considered best practice?
I have been searching for best practice, but I did not found it. I
Is there a best practice pattern to model the following parent child relationship where
What's the difference (if any) between model.__dict__['title_en'] and model.__getattribute__('title_en') and what's best practice ?

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.