473,795 Members | 3,393 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Serving Large Data From Files or From Blobs

My question is partly a language issue (memory) and partly a Web issue
(where the program runs), so I hope everyone will be open to helping.

Users may submit and store pictures with my program. I have the choice
of storing these pictures either as files on the server or as a blob
in the database. The pictures are just user data, and it seems logical
to keep them in the database with all the other data. But I'm
concerned about how to serve these pictures. I can write a program to
handle image requests and return the appropriate picture from the
database. But it seems to me this means the picture will need to be
read from the database and stored in memory, in a variable, then
written from the variable to the HTTP response.

The part where the whole picture is stored in a variable is the part
that worries me. Is this impractical? Or merely a bad idea? Is storing
the pictures as files, allowing the server to serve them as it would
server anything else, the best option?
Feb 15 '08 #1
1 1493
Fe**********@gm ail.com wrote:
My question is partly a language issue (memory) and partly a Web issue
(where the program runs), so I hope everyone will be open to helping.

Users may submit and store pictures with my program. I have the choice
of storing these pictures either as files on the server or as a blob
in the database. The pictures are just user data, and it seems logical
to keep them in the database with all the other data. But I'm
concerned about how to serve these pictures. I can write a program to
handle image requests and return the appropriate picture from the
database. But it seems to me this means the picture will need to be
read from the database and stored in memory, in a variable, then
written from the variable to the HTTP response.
Databases that support blob types generally support ways to either stream
those blobs or efficiently read them in chunks. How to do that would
depend on the specifics of the database being used.

How are you getting the data into the database in the first place without
having it all in memory at once?
The part where the whole picture is stored in a variable is the part
that worries me. Is this impractical?
It depends on the maximum practical size of the image, and the amount of
memory your server has. Only you can know those things.

Or merely a bad idea? Is storing
the pictures as files, allowing the server to serve them as it would
server anything else, the best option?
Do the file contents need the same transactional behavior (ACID, etc.)
as the rest of the stuff in database?

Xho

--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.
Feb 15 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
985
by: Tim Stone | last post by:
I'm working on a module that will manipulate large blobs. I'm using a C dll to allocate big blocks of memory, using PyMem_Malloc, which is working quite well up until I try to manipulate a blob that exhausts Python's heap. I'm guessing that to increase the heapsize, I'm going to have to recompile python... (??) Am I on the right track? If so, can you steer me toward some instructions on how to do that compile? I'm a command-line make...
1
6200
by: Good Man | last post by:
Hi there I'm developing a large web application. Part of this web application will be storing numerical chart data in a MySQL table - these numbers will be already calculated, and are just being stored for reference. In this particular table, the stored data will never be deleted or changed. The only actions performed will be SELECTs and INSERTs. There will never be any DELETEs or UPDATEs.
5
5610
by: Louis LeBlanc | last post by:
Hey folks. I'm new to the list, and not quite what you'd call a DB Guru, so please be patient with me. I'm afraid the lead up here is a bit verbose . . . I am working on an application that uses very high volume DB transactions - in the order of tens of millions per day . . . Anyway, the current database which will remain nameless, but begins with O and rymes with debacle (sorta), has a problem with high volume work when it comes to...
5
1768
by: Bob Bedford | last post by:
hello there, I've a file in wich I've almost all the text of my website. I do this because the site is multilingual and this is easier to translate. The file is becoming ever larger as we add new pages on our site. Actually the file is about 100ko I know the page is only used server side (I use a require_once) but wouldn't be better to create a "common" file wich will be about 20 ko large (with
0
9672
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9519
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10437
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10214
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9042
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5437
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.