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 7617343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:07:35+00:00 2026-05-31T03:07:35+00:00

Consider an application that stores inventory for a store, which consists of hundreds of

  • 0

Consider an application that stores inventory for a store, which consists of hundreds of item types and quantities of each item. I currently have a database mapped out which can handles this, which was natural to design due to a background in procedural programming. However, I am now working in an OOP language (C#) and I am considering storing the inventory and other entities (branch offices, employees, suppliers) as CLR objects, grouped in ObservableCollections, and then persisted to the database via an ORM such as NHibernate.

My concern is that having ObservableCollections with hundreds or thousands of items in memory at all times will be a resource and performance barrier. I am also worried about potential dataloss considering equipment failure or power outage. As the system will be recording financial transactions (sales) the reliability of a database is rather important. Specifically, having all changes / sales in the database at the time of transaction, as opposed to whenever the ORM persists back is important to me.

Should I work directly with the database, or should I work with objects and let the ORM handle the storage?

  • 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-05-31T03:07:37+00:00Added an answer on May 31, 2026 at 3:07 am

    My concern is that having ObservableCollections with hundreds or thousands of items in memory at
    all times will be a resource and performance barrier

    Depends how you work with htem.

    I have a service keeping about a quarter million items by string key in memory. I do up to around 50.000 updates on them per second, then ttream the udpates out to the database – not as updates but as new data with timestamp (track change over time).

    It really depends.

    In general this is not an easy question – MOST of the time it is easier to do a SQL query, but an in meemory cache can really BOOST performance. Yes, it uses memory. WHO CARES – worksations can have 64gb memory these days. THe question is whether it makes sense from a performance.

    Specifically, having all changes / sales in the database at the time of transaction, as opposed to
    whenever the ORM persists back is important to me.

    LOGICAL ERROR. An ORM will persist them as part of the ORM transaction. Naturally the cache would not be “one ORM transaction” but independent of transactions updated. If na ORM gets into your way here, it is either the worlds most sucking ORM or your application architecture is broken.

    All updates to financial data should happen in a database levele transaction and every ORM I know of supports that.

    Should I work directly with the database, or should I work with objects and let the ORM handle the
    storage?

    Depends on requirements. I love ORM’s but hav gone lately to a service oriented architecture where I update in moemry representations thn stream the transaction out to the database. But then I do streaming data inocoming / No decision in logic stuff (data comes from external soruce and HAS to e be processed, no error possible, no loss possible – if soemthign blows on my end, the next start of the app gets the same data again, until I say I processed it).

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

Sidebar

Related Questions

I have a chat application(Socket Programming) , for that consider I have 2 separate
Consider a web application that resizes large tiff files on the fly. Each large
Consider an iPhone application that is a catalogue of animals. The application should allow
Consider a Console application that starts up some services in a separate thread. All
Consider an ASP.NET MVC application that requires a session variable be set. It's used
hai consider that my application name is sApp.exe when i run my application as
Consider a production planning application with many products. Each product has a list of
I'm working on a C# application that needs to store all the successive revisions
We have an MVC.NET application that encounters fatal errors when it restarts. In our
Consider an ASP.NET web application [A] that makes a request to a secure web

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.