[V4RB] RAM-based databases
Ruslan Zasukhin
sunshine at public.kherson.ua
Sun Jun 24 00:05:35 CDT 2007
On 23/6/07 11:12 PM, "Erik Mueller-Harder" <erikmh at gmail.com> wrote:
>>> In other words, your example code calls this method:
>>>
>>> dim f as folderitem
>>>
>>> // obtain folder item for file in the same folder.
>>> f = GetFolderItem("Database1.vdb")
>>>
>>> // We will keep db in the 4 disk files
>>> mDataBase.Create( f, EVdbMode.kDsc_Dat_Blb_Ind , 32 * 1024 )
>>>
>>> which seems absolutely non-intuitive to me for a RAM-based database.
>>> Folderitem? Number and distribution of disk files?
>>
>> Yes FolderItem, just because be SIMIALR to disk-based db case.
>>
>> RAM Database will not use this info, or at least will use NAME of file for
>> name of db.
>
> So, just to be consistent, you require that a RAM-based database be
> "opened" even after you've created an instance of it, and that you
> pass as its opening parameters a folderitem, the number of files you
> want the database to use, and even the segment size for the files?
YES.
RAM database uses 99.99% THE SAME algorithms as disk based db :-)
Only is used OTHER File class.
>> Number of files for RAM db still have sense, yes in RAM can be created ONE
>> or FOUR logical files.
>
> OK, that's valid then -- though I'd be interested to know why you'd
> want to define different numbers of logical files in a RAM-based db.
No difference I think.
> But it just doesn't seem like Valentina's style to require me to pass
> bogus parameters just for the sake of consistency.
Why?
Valentina style is EASY SWITCH between platforms, data models, local or
client/server, disk or RAM based dbs.
So you can have APP with DISK BASED DB, and EASY create new instance of the
same db on RAM. One line have to be change.
Do you think it is better provide special version of methods? Push developer
to learn them? :-)
>> Work with RAM db differ only in constant kRamDb instead of kDiskDb
>
> OK, I've got it. And as of a few hours ago I have both the example and
> my own project working fine. I just wanted to confirm that I'm really
> doing this the right way.
As easy as change ONE constant :-)
--
Best regards,
Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc
Valentina - Joining Worlds of Information
http://www.paradigmasoft.com
[I feel the need: the need for speed]
More information about the Valentina
mailing list