Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Datenbanken (https://www.delphipraxis.net/15-datenbanken/)
-   -   Delphi Save record to BLOB (https://www.delphipraxis.net/144310-save-record-blob.html)

nanix 5. Dez 2009 16:24

Re: Save record to BLOB
 
This is a table that will hold Sensor info.I have like 4 more tables in that hold other computer information about graphic cards,processor and so and so on.

So what would be best to solve this?

And has to be structured Data + DB :)

sx2008 5. Dez 2009 16:43

Re: Save record to BLOB
 
Zitat:

Zitat von nanix
I only save all data to 1 BLOB how can i loose performance with this. :lol:

Let's asume you want to read all sensors from one monitor with the name "Test2009".
Let's asume further there are 100 monitors and each monitor has 100 sensors.
And everything is stored in one single BLOB.
You have to read the BLOB on the whole and start a while-loop to find the monitor.
This is really unefficient.
You read a BLOB that could be huge only to use small parts of it.
On a network this would waste a lot of bandwith.

On the other side, if you have a well designed database you would emit this SQL query:
SQL-Code:
SELECT * FROM sensors WHERE MonitorName='Test2009'
and within a few milliseconds you will get exactly what you are looking for.

Let's assume you want to extend the TMonitor structure:
Delphi-Quellcode:
TMonitor = record
  Name  :String[20];
  Sensor :Array of TSensor
  Manufacturer : string; // new
end;
If you have a clean database this task is very easy; simply add a field to the table "monitors".
But with your design you will have big problems.
You need a TMonitorOld and a TMonitorNew record and a flag to indicate the old or the new structure.

Here are some argument against Blobs:
A clean designed database could be used without your application.
It has a value because it is open and portable.
But a table with a single BLOB is worthless without a working app.
If your app has a bug, everything could be destroyed and your data is lost.

nanix 5. Dez 2009 17:09

Re: Save record to BLOB
 
Yes but i need structured data this is a must in a DB variant.
So if you have suggestion please write.

sx2008 5. Dez 2009 18:33

Re: Save record to BLOB
 
Liste der Anhänge anzeigen (Anzahl: 2)
I've attached a small MS access database and a image with the relationship between the tables.
You need some more tables and fields, but it could serve as a template.

nanix 5. Dez 2009 19:43

Re: Save record to BLOB
 
And thanks for the info you have given me so far infact to all of you! :dp:

Interesting idea,i looked it with office 2010

but how to realize this with delphi any example would more than thankfull.]
One of the features is DB should be universal and this would be more than good.

Tell me some of the features and how it scales to DB like Absolute DB and SQL..

generic 11. Dez 2009 23:46

Re: Save record to BLOB
 
if speed is the important thing, why are you using a db?

when you are using flat files with your records/data its much much much much much much much faster than using a db!


Alle Zeitangaben in WEZ +1. Es ist jetzt 02:16 Uhr.
Seite 2 von 2     12   

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz