[WebDNA] Recall with different scopes ...
This WebDNA talk-list message is from 2015
It keeps the original formatting.
numero = 112075
interpreted = N
texte = >> Why would it matter if the same volume of data were stored in>> a single db or in separate dbs?> > Just want to take this opportunity to make a parenthesis: > several small databases are usually faster than a large one.Good point. However, in my case my default reserved.db willalways be small. I can see myself using it for a few dozen codesnippets but probably never more than that. So realistically, atleast for me, the default reserved.db will be extremely small andtherefore insignificant in terms of RAM use.> One single modification in a database, in case "Automatically> commit databases to disk after modification" is checked, will> have to write few hundred KB or few MB instead of tens or> hundreds of MB to disk.Good point. However, I never have my prefs set to "Automaticallycommit databases to disk after modification" because I prefer tocommit when I think it is actually necessary, rather than dealwith the overhead caused by committing all the time.Having said this, I think we should keep in mind that thereserved.db will seldom be written to anyways -- assuming it isused as I understand it should be used -- to store permanentvariables for site-wide use. After all, how frequently do wechange our permanent variables? In my case, almost never!Case in point:I already have a "siteCode" file that I use to store frequentlyused (permanent) variables. I include it at the top of every pageof the site. It sets a bunch of values so I can use themconveniently whenever I need them. If I were to replace mysiteCode system with your new store/recall system:1- I would almost never use [store] because I seldom change thevalues in my siteCode file as it is.2- I would switch from putting [include /siteCode] in every pageto NOT including my siteCode file any more.3- I would switch from using simple [thisIP] tags to usingslightly longer [recall thisIP] tags.BY THE WAY ... I just had a new thought after considering how andwhere I use my permanent variables. I would definitely use bothserver-wide and site-wide permanent variables, but I can never seemyself using folder-specific permanent variables.Nevertheless I think it would be great if you could implementthese three new scopes for permanent variables, or at least thefirst two:[recall abc][siteRecall abc][localRecall abc]Then when I use [recall] it will use the single defaultreserved.db located at /WebDNA. And when I use [siteRecall] itwill use the reserved.db file that's located in the document rootfolder (/) of the current website.And when someone else (because I will never use this one) uses[localRecall] it will use the reserved.db located in the samefolder as the current template.So basically this gives us three different scopes for our newpermanent variables. What do you think about this?Doing it this way would let us set specific folder paths indifferent site scopes like this, all on the same server:site #1 reserved.db:fromtoimageFolder/imagessite #2 reserved.db:fromtoimageFolder/Pixsite #3 reserved.db:fromtoimageFolderhttp://someOtherServer.com/site3/imagesThen in each website we can reference our images like this:

And when we need to move all the images in one site to a newlocation, running this code ONE TIME -- from a template inside thespecific site we're dealing with -- would change all our imagereferences in the entire site to the new location:[siteStore]imageFolder=/newImgFolder[/siteStore]Chris, you asked for discussion regarding your new proposedfeatures so I hope I'm not overdoing it here. If I am, just tellme and I'll stop.:)Adding more to this proposed system:You could (if you wanted to) implement a single [recall abc] tagthat works in all three scopes mentioned above. Here's how Iwould implement if it I were writing the code:First I would look for a "from" value of "abc" in the reserved.dblocated in the same folder as the current template. When foundthis is the value returned. But when not found it would look inthe reserved.db located in the website's document root folder.Once again if found it would return this value. But when notfound it would look in the default reserved.db that's located in/WebDNA.This system would certainly simplify the number of different tagswe use to recall our data! However, it would also make itimpossible to get a value from a specific reserved.db ... UNLESSwe use the optional "path" parameter. My thought here is thatwhenever we specify a "path" in our recall tag, that would be theonly reserved.db used, regardless of how many other reserved.dbexist in the server.In terms coding in WebDNA I like the simplicity of using a single[recall] tag to find its value. After all, this means we do nothave to remember which db we stored a specific value in, becauseit's going to come from the reserved.db with the narrowest scope.Would a system like this force us to give up any flexibility? Orwould this be a better way to do it?Regards,Kenneth GromeWebDNA Solutionshttp://www.webdnasolutions.comWeb Database Systems and Linux Server Management
Associated Messages, from the most recent to the oldest:
>> Why would it matter if the same volume of data were stored in>> a single db or in separate dbs?> > Just want to take this opportunity to make a parenthesis: > several small databases are usually faster than a large one.Good point. However, in my case my default reserved.db willalways be small. I can see myself using it for a few dozen codesnippets but probably never more than that. So realistically, atleast for me, the default reserved.db will be extremely small andtherefore insignificant in terms of RAM use.> One single modification in a database, in case "Automatically> commit databases to disk after modification" is checked, will> have to write few hundred KB or few MB instead of tens or> hundreds of MB to disk.Good point. However, I never have my prefs set to "Automaticallycommit databases to disk after modification" because I prefer tocommit when I think it is actually necessary, rather than dealwith the overhead caused by committing all the time.Having said this, I think we should keep in mind that thereserved.db will seldom be written to anyways -- assuming it isused as I understand it should be used -- to store permanentvariables for site-wide use. After all, how frequently do wechange our permanent variables? In my case, almost never!Case in point:I already have a "siteCode" file that I use to store frequentlyused (permanent) variables. I include it at the top of every pageof the site. It sets a bunch of values so I can use themconveniently whenever I need them. If I were to replace mysiteCode system with your new store/recall system:1- I would almost never use
[store] because I seldom change thevalues in my siteCode file as it is.2- I would switch from putting [include /siteCode] in every pageto NOT including my siteCode file any more.3- I would switch from using simple [thisIP] tags to usingslightly longer [recall thisIP] tags.BY THE WAY ... I just had a new thought after considering how andwhere I use my permanent variables. I would definitely use bothserver-wide and site-wide permanent variables, but I can never seemyself using folder-specific permanent variables.Nevertheless I think it would be great if you could implementthese three new scopes for permanent variables, or at least thefirst two:[recall abc][siteRecall abc][localRecall abc]Then when I use [recall] it will use the single defaultreserved.db located at /WebDNA. And when I use [siteRecall] itwill use the reserved.db file that's located in the document rootfolder (/) of the current website.And when someone else (because I will never use this one) uses[localRecall] it will use the reserved.db located in the samefolder as the current template.So basically this gives us three different scopes for our newpermanent variables. What do you think about this?Doing it this way would let us set specific folder paths indifferent site scopes like this, all on the same server:site #1 reserved.db:fromtoimageFolder/imagessite #2 reserved.db:fromtoimageFolder/Pixsite #3 reserved.db:fromtoimageFolderhttp://someOtherServer.com/site3/imagesThen in each website we can reference our images like this:

And when we need to move all the images in one site to a newlocation, running this code ONE TIME -- from a template inside thespecific site we're dealing with -- would change all our imagereferences in the entire site to the new location:[siteStore]imageFolder=/newImgFolder[/siteStore]Chris, you asked for discussion regarding your new proposedfeatures so I hope I'm not overdoing it here. If I am, just tellme and I'll stop.:)Adding more to this proposed system:You could (if you wanted to) implement a single [recall abc] tagthat works in all three scopes mentioned above. Here's how Iwould implement if it I were writing the code:First I would look for a "from" value of "abc" in the reserved.dblocated in the same folder as the current template. When foundthis is the value returned. But when not found it would look inthe reserved.db located in the website's document root folder.Once again if found it would return this value. But when notfound it would look in the default reserved.db that's located in/WebDNA.This system would certainly simplify the number of different tagswe use to recall our data! However, it would also make itimpossible to get a value from a specific reserved.db ... UNLESSwe use the optional "path" parameter. My thought here is thatwhenever we specify a "path" in our recall tag, that would be theonly reserved.db used, regardless of how many other reserved.dbexist in the server.In terms coding in WebDNA I like the simplicity of using a single[recall] tag to find its value. After all, this means we do nothave to remember which db we stored a specific value in, becauseit's going to come from the reserved.db with the narrowest scope.Would a system like this force us to give up any flexibility? Orwould this be a better way to do it?Regards,Kenneth GromeWebDNA Solutionshttp://www.webdnasolutions.comWeb Database Systems and Linux Server Management
Kenneth Grome
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
database with 10,000+ web pages stored in it? (2000)
Uh...can someone help me out with the b10? (1997)
Carriage returns in [text] variables (1999)
Need correct syntax for writing to header2 (1999)
Date problems (1997)
serial number dishing (1997)
Counting LineItems (2000)
Any problem with using a g4 with WebCat (2000)
[cart] not being interpreted inside [founditems] (1997)
Problem displaying search result (1997)
Search in 2 or more catalogs (1997)
Math, Multiple Equasions and Show/Hide (1998)
show all problem (1997)
project (1998)
Exclamation point (1997)
Adding Items to Cart (2003)
WebCat2: Formulas.db question (1997)
WC Database Format (1997)
Shipping DB (1999)
[OT] (waaaay OT) (2004)