473,561 Members | 3,684 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

'Pure' client-side javscript database?

cjl
Hey all:

I know that it is silly in the age of Google to 'lose' something on the
internet, but I recently checked out a project that had implemented a
database with a subset of SQL in pure client-side javascript.

I forgot to bookmark it, and now I can't find it.

Anyone?

Thanks in advance,
-CJL

Aug 27 '05 #1
18 7353
cjl
Hey all:

Found it. Dang.

http://trimpath.com/project/wiki/TrimQuery

Thanks,
CJL

Aug 27 '05 #2
"cjl" <cj****@gmail.c om> kirjoitti
viestissä:11*** *************** ****@g44g2000cw a.googlegroups. com...
Hey all:

I know that it is silly in the age of Google to 'lose' something on the
internet, but I recently checked out a project that had implemented a
database with a subset of SQL in pure client-side javascript.

I forgot to bookmark it, and now I can't find it.

I'm glad you found it, but I MUST protest, that revealing the database
structure to end-users (clients) is asking for hacks, especially when the
site also provides the possibility to run queries. That's just like making a
sign for burglar: "Please come here and steal everything we have, we don't
lock doors or have alarms and our dog is actually just a chihuahua." That's
a warm welcome for hackers. What prevents me from running "DROP DATABASE
xyz" from javascript console?

Do pay attention to database security and user rights if and when you
implement that sort of environment. It seems to me a very high risk. Unless
this is for intranet or some sort of restricted user group?

--
SETI @ Home - Donate your cpu's idle time to science.
Further reading at <http://setiweb.ssl.ber keley.edu/>
Kimmo Laine <et************ ****@5P4Mgmail. com>
Aug 27 '05 #3
cjl wrote:
I know that it is silly in the age of Google to 'lose' something on
the internet, but I recently checked out a project that had
implemented a database with a subset of SQL in pure client-side
javascript.


A client-side database? Now there is a spectacularly bad idea. The last
thing you want to do is have the client download an entire database just
so it can extract a tiny part of it. Server-side is where the database
belongs, and where the task of extracting data from it should happen.

Richard.
Aug 27 '05 #4
Hi Kimmo,


I'm glad you found it, but I MUST protest, that revealing the database
structure to end-users (clients) is asking for hacks, especially when the
site also provides the possibility to run queries. That's just like making
a sign for burglar: "Please come here and steal everything we have, we
don't lock doors or have alarms and our dog is actually just a chihuahua."
That's a warm welcome for hackers. What prevents me from running "DROP
DATABASE xyz" from javascript console?


It is a client-side code, whatever you drop, you drop from your
browser/session only.
Nothing affect other users.

It is a mean to store data for the current user. I see this as a nice
companion for DHTML pages.
Do pay attention to database security and user rights if and when you
implement that sort of environment. It seems to me a very high risk.
Unless this is for intranet or some sort of restricted user group?


Elias
Aug 28 '05 #5
Richard Cornford wrote:
A client-side database? Now there is a spectacularly bad idea. The last
thing you want to do is have the client download an entire database just
so it can extract a tiny part of it. Server-side is where the database
belongs, and where the task of extracting data from it should happen.


Well, he didn't say anything about downloading an entire database. He
just wanted a local db interface. Absolutely nothing wrong with that.

There are lots of reasons for wanting local storage. In my own case,
we do a lot of offline processing, due to lack of connection ability in
the field.

For that matter, client-only applications can simply use DHTML as a
display device, and never connect to a server.

Cheers, Kev

Aug 28 '05 #6
Kevin wrote:
Richard Cornford wrote:
A client-side database? Now there is a spectacularly bad idea. The
last thing you want to do is have the client download an entire
database just so it can extract a tiny part of it. Server-side is
where the database belongs, and where the task of extracting data
from it should happen.
Well, he didn't say anything about downloading an entire database.

<snip>

Have you considered the implications of "implemente d a database with a
subset of SQL in pure client-side javascript"? Particularly the words
"in pure client-side javascript". If the only active technology used is
client-side javascript then the data has to go to the client.
For that matter, client-only applications can simply use
DHTML as a display device, and never connect to a server.


Is a browser still a client if there is no server? Without a server
don't you have a stand alone application running in a browser?

Richard.
Aug 29 '05 #7
"Richard Cornford" <Ri*****@litote s.demon.co.uk> wrote in message
news:de******** ***********@new s.demon.co.uk.. .
cjl wrote:
I know that it is silly in the age of Google to 'lose' something on
the internet, but I recently checked out a project that had
implemented a database with a subset of SQL in pure client-side
javascript.


A client-side database? Now there is a spectacularly bad idea. The last
thing you want to do is have the client download an entire database just
so it can extract a tiny part of it. Server-side is where the database
belongs, and where the task of extracting data from it should happen.


Although I agree with you in general I think there are many scenarios where
this could be useful. It really depends on the data in question and the
circumstances of its use, I think.

For example I've worked for the past 10 years or so on a large public
festival here in Boston. The one-day long event features about 200 artists
appearing at 60 or so venues. The basic data set: Artist, a short
description, performance times, categories and venues is, perhaps, 75-100kb.
Here's the page from last year's event:

http://www.firstnight.org/Content/Ne...lore/Index.cfm

Now in this case the site is a non-profit and the server is slow (donated).
However the event is popular: we get several hundred thousand requests
between 10 and 12 on the morning of the event - this can start to drag
things down. The most popular way to search is to visit several slices
(certain categories, times or venues) and create a list of those things
you're interested in.

Now... downloading just the data and client-side application to display
would be larger than downloading just those pages: but when compared to two
or three requests for subsections of data (which our metrics show is
average) it would be smaller and much, much faster. The server would also
be getting a much desired break because it would be, essentially, passing
down static content which would enable much the same functionality.

Of course there's also no reason that the database has to be "whole"...
passing down predicitve data can make for a much more usuable interface.
For example a site which displays television schedules might actually
display only a two hour slice of data... but passing down four hours in the
assumption that the users will want to see "what's on next" seems a safe
bet. In this case the two hours worth of data could be passed down and page
displayed. However, in the background the next two hours could be getting
fetched and added to the client-side database.

At the very least, even without predictive caching, the data already
displayed could be maintained in the client-side database in case the user
wants to go back to it (not uncommon, I would think, for television
listings).

Now I wouldn't consider doing this on the site I referenced - there's just
too much need for support across browsers and situations. However as an
example I think it holds. I could see other situations where it would be
useful: trade show schedules (where saving the web page would allow for
offline use of that version of the schedule) and other small datasets.

However there are definately some intranet projects that this would fit
excellently in.

But it's definately not for everything. In my mind the dataset would have
to be small enough such that the whole dataset and all the code to
manipulate it would be smaller than the total amount of code passed down in
a session of using the server-side data. It would also have to data that
will most likely be used as a whole - as you said there's no sense in
passing down a whole rabbit if you just want that lucky foot.

I think, like anything, the descision to add this complexity to the
client-side would have to logically defensible - and in most cases it just
isn't.

Jim Davis
Aug 29 '05 #8
"Richard Cornford" <Ri*****@litote s.demon.co.uk> wrote in message
news:de******** ***********@new s.demon.co.uk.. .
Kevin wrote:
Richard Cornford wrote:
A client-side database? Now there is a spectacularly bad idea. The
last thing you want to do is have the client download an entire
database just so it can extract a tiny part of it. Server-side is
where the database belongs, and where the task of extracting data
from it should happen.
Well, he didn't say anything about downloading an entire database.

<snip>


Well - it doesn't really matter... if it makes sense to download your entire
database, do it. "Database" says nothing about size: the databases for many
applications are only a few kb, if that.
Have you considered the implications of "implemente d a database with a
subset of SQL in pure client-side javascript"? Particularly the words
"in pure client-side javascript". If the only active technology used is
client-side javascript then the data has to go to the client.


That's the way I read it too... data and the code to manipulate it on the
client.

I see absolutely no benefit to be had in doing client-side SQL against a
server-side database... although I could be convinced I suppose it'll be a
damn hard sell.

It seems to me, unless I'm missing something, that the argument is rather
silly. Whatever you call it storing data on the client has been shown to be
incredibly useful in a tremendous number of applications. However most
applications just call it caching - you can call it a "database" if you like
but data sent the client but not displayed... well, damn - that's a cache.

I see no reason that a client-side cache couldn't be managed with
client-side SQL if it made sense to do so.
For that matter, client-only applications can simply use
DHTML as a display device, and never connect to a server.


Is a browser still a client if there is no server? Without a server
don't you have a stand alone application running in a browser?


Well, yes. Perhaps not a "client-server" application but you still have a
JavaScript application in a browser container of some kind which might just
need a client-side database to manage... something or other.

There are many good uses for a browser-client obtaining application code
from a server and then running that code "off-line". I've built a few
complex HTA's that do just that: the application is delivered via HTTP (and
thus always up to date) but actually runs soley on the client. Granted most
requested further information from the server... but some don't.

For example I've got a simple HTA which loops through my Windows Media
Player library and creates relatively-linked playlists for all the albums it
finds in there. (The playlists make things easier for my older PocketPC.)
The application runs off-line, does not connect to an HTTP server at all but
is still a JavaScript application.

Of course it doesn't need a database... but dammit, something might! ;^)

Jim Davis
Aug 29 '05 #9
Jim Davis wrote:
"Richard Cornford" <Ri*****@litote s.demon.co.uk> wrote in message
news:de******** ***********@new s.demon.co.uk.. .
cjl wrote:
I know that it is silly in the age of Google to 'lose' something on
the internet, but I recently checked out a project that had
implemente d a database with a subset of SQL in pure client-side
javascript .


A client-side database? Now there is a spectacularly bad idea. The last
thing you want to do is have the client download an entire database just
so it can extract a tiny part of it. Server-side is where the database
belongs, and where the task of extracting data from it should happen.

Although I agree with you in general I think there are many scenarios where
this could be useful. It really depends on the data in question and the
circumstances of its use, I think.


You raise some interesting scenarios, but in how many of those would you
use SQL to extract and format data from the database/cache rather than
use purpose built routines?

The concept of building a client-side database and SQL-based API is an
interesting exercise, but it's unlikely to have any real use. The main
purposes of SQL are standardisation of a query interface and portability
between database implementations , neither of which seem to be problems
worth fixing in a client-side JavaScript database.

[...]
--
Rob
Aug 29 '05 #10

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

Similar topics

12
13439
by: cppaddict | last post by:
Hi, I know that it is illegal in C++ to have a static pure virtual method, but it seems something like this would be useful when the following 2 conditions hold: 1. You know that every one of your Derived classes will need to implement some method, but implement it differently, and that the base class cannot implement it. This is where...
2
1705
by: IK | last post by:
Hello All, Please excuse me for posting this here, but I don't find any other group where I will get a proper answer. This is about clarifying the C++ part of COM. I understand that COM is a mechanism by which interface and implementation is seperated. A basic com implementation in c++ can be as follows. // Dev-CPP // interface
4
6044
by: R. Rajesh Jeba Anbiah | last post by:
I'm searching for a pure svn client in PHP, but didn't find one yet. Also, I see many Wiki system designs are somewhat flawed as they didn't use incremental diff. Is there anyone who is aware of either such one? TIA -- <?php echo 'Just another PHP saint'; ?> Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com
10
2963
by: PengYu.UT | last post by:
Hi, A pure function is called in the base function constructor. It generate a run time error: "pure virtual method called". My problem is that class A have some derived classes. I want A's constructor change its behaviour accounting to the derived class. I tried to make A::fun() not pure virtual but virtual. It doesn't generate any...
8
4705
by: Uttam | last post by:
Hello, I am currently in the process of developing an application in a pure desktop world using Access 2000. I am intending to convert this pure desktop application into a Client Server application with Access 2000 as the front end and the each of the following as the backend: 1) Oracle
9
2575
by: Edward Diener | last post by:
I received no answers about this the first time I posted, so I will try again. My inability to decipher an MSDN topic may find others who have the same inability and someone who can decipher and explain it. I have some questions about the instructions for creating a mixed mode DLL in the MSDN topic "Converting Managed Extensions for C++...
0
841
by: Halimaji Nijazi | last post by:
Hi newsgroup I need some conceptional help. I am planning a Application which fullfills following requirements: I have several Locations, every Location with its own server. I reside on the main location. What I am trying to do now is to write an application which gives me the
1
1188
by: Halimaji Nijazi | last post by:
(Already posted on vb-group, but don't get any answers) Hi newsgroup I need some conceptional help. I am planning a Application which fullfills following requirements: I have several Locations, every Location with its own server. I reside on the main location.
2
1773
by: Rob McMullen | last post by:
Wheel reinvention preemption question: is there an existing pure- python library with functionality similar to KDE's kio/kioslave implementation? A multi-protocol, extensible library based on URLs that abstracts directory listing and file read/write? I'm looking to use it in client code, not server, so it doesn't have to be asynchronous...
2
4160
by: =?Utf-8?B?R2hhbmFzaHlhbQ==?= | last post by:
I am using the COM object in .NET C# Client and I am getting an error "R6025 Pure Virtual function called".While running the application in the debugger also I noticed the error but call stack did not provide any clue.It pointed me to few system libraries.Any help in this regard will be of great help. Thanks. Shyam
0
7637
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...
1
7605
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7924
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6195
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...
1
5462
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5177
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3609
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...
0
3591
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2055
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

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.