Re: Web-based Application in Revolution
i guess problem with multiple instances can be solved by using Apache sqlite module modsqlite which adds db server functionality to the Apache web server. It resides in memory all the time, so no new instances are initiated, no application startup overheads and cash is not stressed... What rocks is the possibility to access sqlite databases directly over HTTP like http://localhost/test?db=/tmp/foo.dbq=select+*+from+test However because of the security issues database access is possible only from and on the localhost. This means that you will not be able to do http://mysite.com/test?db=..., but you can easily do http://localhost/test?db=... from any cgi application without running an external database server. More info on http://modsqlite.sourceforge.net/ Viktoras ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Web-based Application in Revolution
Ruslan, usually when building Revolution web aps, people use apache cgi interface, so for each web request, apache will launch an instance of the revolution engine. If you have two concurrent requests, you will have two instances running. Each with their own V4REV external loaded. What happens if they both try to access the same Valentina database. SQLite have built in methods for locking the file if they are opened by more than one application at the same time, so all transactions are atomic. You still have the problem of one instance overwritting the changes of the other instances, but you can guarantee that both accessess will happen and will go thru without file corruption. What I am to say is that using SQLite you can build a minimal web application if you're clever enough to build a locking mechanism to prevent overwritting other users changes. My SQLite will guarantee the transactions or in other words, the multiple client access to the file. Now, since I really like Valentina, can we do something similar with V4REV, can more than one application access the same database file without using Valentina Server? Cheers andre Ruslan On 10/5/07, Ruslan Zasukhin [EMAIL PROTECTED] wrote: On 5/10/07 9:14 PM, Andre Garzia [EMAIL PROTECTED] wrote: Hi Andre, Ruslan, but what happens if two engine instances launched by apache try to access the same database? Assuming the user is using V4REV external and not Valentina Server. I think nothing good :-) Do you mean launched by apache == starting from Valentina.Init() ? This is bad idea I think. -- 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] ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Web-based Application in Revolution
On 7/10/07 11:07 PM, Andre Garzia [EMAIL PROTECTED] wrote: Hi Andre, usually when building Revolution web aps, people use apache cgi interface, so for each web request, apache will launch an instance of the revolution engine. If you have two concurrent requests, you will have two instances running. Each with their own V4REV external loaded. What happens if they both try to access the same Valentina database. SQLite have built in methods for locking the file if they are opened by more than one application at the same time, so all transactions are atomic. You still have the problem of one instance overwritting the changes of the other instances, but you can guarantee that both accessess will happen and will go thru without file corruption. What I am to say is that using SQLite you can build a minimal web application if you're clever enough to build a locking mechanism to prevent overwritting other users changes. My SQLite will guarantee the transactions or in other words, the multiple client access to the file. Now, since I really like Valentina, can we do something similar with V4REV, can more than one application access the same database file without using Valentina Server? Short answer: YES. Long Answer: * History: MAC OS 9 - did have exclusive open for files Windows also did have it and DO have it. OS X like linux - do not have it. * Unix world and APPLE on its site recommend fight with this using LOCK FILE. For example, When app opens a Valentina db, you check if exists in the same disk location dbname.lock file. If not exists - you make it and open db. So other user will see file and will wait until it go away. Yes more headache for developers thanks to *nix way. How hard make it for you in REV? 5-6 lines of code? * Should I explain how much better to use VSERVER instead of such way? :-) I sure you understand that loading of V4REV or SqlLite plugin in each Apache copy means init/kill each time cache. Working with Valentina Server cache not dies. Also time on open/close of db file. ... -- 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] ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Web-based Application in Revolution
Hi Andre, obviously I'm not Ruslan, but I build web-apps for over 10 years and I used Valentina in many apps. On 2007-10-07, at 22:07, Andre Garzia wrote: usually when building Revolution web aps, people use apache cgi interface, so for each web request, apache will launch an instance of the revolution engine. If you have two concurrent requests, you will have two instances running. Yes, this is the common way for most of the dev-environments and for small solutions. If you really expect high number of concurrent users you perhaps should think about using a real web-application server. Each with their own V4REV external loaded. What happens if they both try to access the same Valentina database. Nothing good. SQLite have built in methods for locking the file if they are opened by more than one application at the same time, so all transactions are atomic. You still have the problem of one instance overwritting the changes of the other instances, but you can guarantee that both accessess will happen and will go thru without file corruption. SQLLite with the given standard set of functions is only able to be opened from one client. There are some extensions trying to go around this, but the common lock is a full file lock of the db-file. So using any extension to go around it and looking at you scenario, what happened if you need a real transaction? Then there is nothing atomic left. Or what happened if an unexpected complex operation took several minutes, should all the other users wait? What I am to say is that using SQLite you can build a minimal web application if you're clever enough to build a locking mechanism to prevent overwritting other users changes. But then you could do the same with V4Rev. Build a file locking mechanism (or use on WIndows the system mechanism) for the used db- files and use V4Rev. But I didn't know any real world web app that's usable with such a mechanism in background. Now, since I really like Valentina, can we do something similar with V4REV, can more than one application access the same database file without using Valentina Server? If you're talking about a server appm then I'm afraid you should use a db-server, in this case the VServer. There are several more advantages, then only have parallel access for several web-sessions. IMHO the most important word is CACHE! Using a file based DB solution with a file locking scenario the db is loaded again and again for every web-request! For most real db's this would be ways longer then the web-request will need to be executed. So each web-request will lock the db for even longer time and even less web-request are possible per second. Using a VServer the requested data is loaded into the cache, given you set a propitiate size, and all other reqeust are answered from cache, THIS is real speed improvement for a web app. When you now start using a db server you can use several more common patterns, i.e. store session information inside the db and only handle a id in the cookie. There is only one known exception. When you think of a CMS then you can set the Valentina-DB to read only and THEN you can open this db with several V4REV sessions at the same time. HTH, regards Thorsten Hohage -- objectmanufactur.com - Hamburg,Germany ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Web-based Application in Revolution
Hello Thorsten and Ruslan, thanks for the quick and detailed reply. The question was a rethorical one, I am not building a web app like that, I just wanted to know what would happen if someone did. The original poster was planning to use Valentina for web apps with revolution, so I wanted to know what would happen if two engine instances tried to access the same database. I usually try to make web services so that my cgis poll for the service for its query needs, or I simply use postgreSQL. Again, I always learn more from such nice replies, even as I agree with you guys from the start. I think Valentina Server is a very nice tool and as soon as we can use it effectivily from Rev cgi apps it will be a major tool for us. Cheers andre Hello On 10/7/07, Thorsten Hohage [EMAIL PROTECTED] wrote: Hi Andre, obviously I'm not Ruslan, but I build web-apps for over 10 years and I used Valentina in many apps. On 2007-10-07, at 22:07, Andre Garzia wrote: usually when building Revolution web aps, people use apache cgi interface, so for each web request, apache will launch an instance of the revolution engine. If you have two concurrent requests, you will have two instances running. Yes, this is the common way for most of the dev-environments and for small solutions. If you really expect high number of concurrent users you perhaps should think about using a real web-application server. Each with their own V4REV external loaded. What happens if they both try to access the same Valentina database. Nothing good. SQLite have built in methods for locking the file if they are opened by more than one application at the same time, so all transactions are atomic. You still have the problem of one instance overwritting the changes of the other instances, but you can guarantee that both accessess will happen and will go thru without file corruption. SQLLite with the given standard set of functions is only able to be opened from one client. There are some extensions trying to go around this, but the common lock is a full file lock of the db-file. So using any extension to go around it and looking at you scenario, what happened if you need a real transaction? Then there is nothing atomic left. Or what happened if an unexpected complex operation took several minutes, should all the other users wait? What I am to say is that using SQLite you can build a minimal web application if you're clever enough to build a locking mechanism to prevent overwritting other users changes. But then you could do the same with V4Rev. Build a file locking mechanism (or use on WIndows the system mechanism) for the used db- files and use V4Rev. But I didn't know any real world web app that's usable with such a mechanism in background. Now, since I really like Valentina, can we do something similar with V4REV, can more than one application access the same database file without using Valentina Server? If you're talking about a server appm then I'm afraid you should use a db-server, in this case the VServer. There are several more advantages, then only have parallel access for several web-sessions. IMHO the most important word is CACHE! Using a file based DB solution with a file locking scenario the db is loaded again and again for every web-request! For most real db's this would be ways longer then the web-request will need to be executed. So each web-request will lock the db for even longer time and even less web-request are possible per second. Using a VServer the requested data is loaded into the cache, given you set a propitiate size, and all other reqeust are answered from cache, THIS is real speed improvement for a web app. When you now start using a db server you can use several more common patterns, i.e. store session information inside the db and only handle a id in the cookie. There is only one known exception. When you think of a CMS then you can set the Valentina-DB to read only and THEN you can open this db with several V4REV sessions at the same time. HTH, regards Thorsten Hohage -- objectmanufactur.com - Hamburg,Germany ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Web-based Application in Revolution
Hi,I am a newbie to revolution. I have developed simple programs involving database like Valentina. Where can I find information for developing web-based application in revolution with valentina as database.Thank youKavitha ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Web-based Application in Revolution
On 5/10/07 5:22 PM, Kavitha [EMAIL PROTECTED] wrote: Hi Kavitha, Hi,I am a newbie to revolution. I have developed simple programs involving database like Valentina. Where can I find information for developing web-based application in revolution with valentina as database.Thank youKavitha Well, I do not think that Valentina somehow differ from using of e.g. MySQL + REV. You just do query some database and get data. Then its up to you how you use them, for desktop app or for dynamic HTML generation. -- 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] ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Web-based Application in Revolution
Ruslan, but what happens if two engine instances launched by apache try to access the same database? Assuming the user is using V4REV external and not Valentina Server. Andre On 10/5/07, Ruslan Zasukhin [EMAIL PROTECTED] wrote: On 5/10/07 5:22 PM, Kavitha [EMAIL PROTECTED] wrote: Hi Kavitha, Hi,I am a newbie to revolution. I have developed simple programs involving database like Valentina. Where can I find information for developing web-based application in revolution with valentina as database.Thank youKavitha Well, I do not think that Valentina somehow differ from using of e.g. MySQL + REV. You just do query some database and get data. Then its up to you how you use them, for desktop app or for dynamic HTML generation. -- 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] ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Web-based Application in Revolution
On 5/10/07 9:14 PM, Andre Garzia [EMAIL PROTECTED] wrote: Hi Andre, Ruslan, but what happens if two engine instances launched by apache try to access the same database? Assuming the user is using V4REV external and not Valentina Server. I think nothing good :-) Do you mean launched by apache == starting from Valentina.Init() ? This is bad idea I think. -- 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] ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution