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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:29:29+00:00 2026-06-10T19:29:29+00:00

I need to store quite large amount of binary data in database (MS SQL),

  • 0

I need to store quite large amount of binary data in database (MS SQL), and interact with this database via EF. Unfortunately, EF doesn’t support FILESTREAM (more exactly, there’s no streaming support).

So, I’ve decided to store data in chunks. Chunk is just an entity type:

public class Data
{
  public int Id { get; set; }
  public Collection<Chunk> Chunks { get; set; }
}

public class Chunk
{
  public int Id { get; set; }
  public int DataId { get; set; }
  public byte[] Content { get; set; }
}

First, I wanted to limit chunk size by some optimal value, let’s say, 1 Mb.
But then I’ve remembered about large objects and LOH.

As far as I understand, every Chunk.Content instance will be considered as large object with following consequences (memory fragmentation, particularly). Hence, intensive creation of Chunk objects finally will cause OutOfMemoryException (it is a “24/7” application, and work with that binary data is the main purpose of application).

I can’t reuse any buffer for data chunks, because I’m using EF…
Should I decrease chunk size, making it lower, then 85K?
Or is it a paranoia? 🙂

  • 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-10T19:29:31+00:00Added an answer on June 10, 2026 at 7:29 pm

    LOH fragmentation issue can occur only if you have too many chunks in the memory in the same time but from your description it looks like you will have one chunk per “process”. How many concurrent processes do you expect to have? If you expect to have many processes you most probably also expect HW with enough processing power and memory (64bit platform). Isn’t the HW a real limitation to have so many parallel chunks processed?

    Anyway if you need to store stream to database you should simply use FILESTREAM without EF. Staying with EF at all costs is architecture failure.

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

Sidebar

Related Questions

I have an existing SQL Server database, where I store data from large specific
I need to store a very large amount of instances of my class, and
I need to store lotto numbers in a SQL database. There are 8 separate
I need to store a very big amount of text in mysql database. It
I need a database that can store a large number of BLOBS. The BLOBs
Quite simply, I need to store time series data in a document. I have
Am about to do a homework, and i need to store quite a lot
I need to store GPS coordinates in a database. I've heard that floats are
I have an application that stores large amount of files (XML and binary) in
I need to store some data that follows the simple pattern of mapping an

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.