Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Understanding CEDB and EDB

50 views
Skip to first unread message

Oliver Schenk

unread,
Sep 25, 2008, 5:31:47 AM9/25/08
to
Hi,

I have a few questions regarding databases in Windows Embedded CE 6.0. I
am currently reading chapter 11 in Douglas Boling's "Programming Windows
Embedded CE 6.0 Developer Reference". There are a number of things I am
not too clear about.

Just so you have some idea of my requirements, they are approximately as
follows (I am still researching and playing around with different ideas
and I'm quite new to windows ce programming):

- Speed.
- Multiple processes/threads accessing database.
- Storing only booleans and numbers (shorts up to longs).
- Over 10000 data points for say booleans and numbers.
- Data retention when rebooting.


1. Is it true that if I wish to have multiple processes or threads
interact with the database all at the same time I pretty much need to
use EDB?

2. Is there maybe an alternative option than EDB or CEDB or does
everyone pretty much use one of these two for any project? (Of course
keeping in mind question 1.)

3. As far as I understand both CEDB and EDB can be stored as volumes.
These are files in the filesystem. Each volume can have multiple
databases. It is also possible to use CEDB directly within the object
store.

What benefits does using the object store provide?

When using the object store method, is everything lost when power is lost?

To use the object store do I simply use CREATE_SYSTEMGUID(PCEGUID
pguid); when createing a GUID?


4. I come from an (My)SQL background. Just need to get my terms right:

(C)EDB => (My)SQL
-------------------
Database => Database
Record => Table
Property => Column

or is it...

(C)EDB => (My)SQL
-------------------
Database => Database
Record => Row
Property => Column

... in which case a database in WinCE only has one "table"?

I'm a bit confused here, also because of question 5.


5. I'm having trouble understanding the limitations on each database type.

The book says that "an individual property can't exceed the constant
CEDB_MAXPROPDATASIZE which is set to 8,192 for an embedded database and
65,471 for the CE database." Does that mean whatever the value is inside
a property it must be <= 8,192 bytes for EDB?

The book then says that "A single record can't exceed
CEDB_MAXRECORDSIZE, defined as 8,192 for EDB and 131,072 for CEDB." So
does that mean the size of all property values added together must be <=
8,192 bytes for EDB?


6. If I say use a large cbBufferPool so that the database is cached in
RAM for speed optimisation does that mean data can be lost if power is
suddenly lost? How would one manage this?


7. I intend to make a database available to a number of applications
ranging from os services (such as access through a tcp port or Modbus
protocol over tcp) to managed applications written in .NET.

Would it make sense to design and implement a driver as part of the OS
that other applications can then work with? Something that will then be
part of the SDK?

I'm quite new to all this so I'm not sure what best practice methods are
when something like a database needs to be accessible to any application
at any time. It should also be on two different priority levels. For
example some applications will need to be almost instant at reading or
writing, whereas managed applications can have a lower priority.

I have yet to go deeper into actually using a database, so far I just
need to be clear on my choices and the pros and cons of each type (or
even alternatives).

Thanks heaps!

Oliver

Paul G. Tobey [eMVP]

unread,
Sep 25, 2008, 11:36:12 AM9/25/08
to
Look at SQL Server Compact, rather than CEDB or EDB. For a relatively large
database, you'll be better-off using a full strength data engine. The same
engine can also be used on desktop Windows, so you don't have to do anything
other than copy the database file to review your data on a PC. You can
download it from www.microsoft.com/downloads (the current version is 3.5SP1;
note that there are two downloads, one for "Mobile", CE and Windows Mobile,
and one for the desktop), and install it on your Windows CE-based device,
or, if you're using Platform Builder and building the operating system for
your own device, you can build it directly into ROM. There is a significant
amount of documentation for SQL Server Compact, also, which should be able
to answer most of your questions (a whole set of books online should be
linked from the download page for the engine).

Paul T.

"Oliver Schenk" <oliver...@ii.net> wrote in message
news:u%23%23fIGvH...@TK2MSFTNGP05.phx.gbl...

Oliver Schenk

unread,
Sep 25, 2008, 10:12:32 PM9/25/08
to
Hi Paul,

Thanks for that.

At first I did not realise that you could also talk to an SQL Server CE
database using native code; I thought everything had to be done in .NET
3.5 but then I would have had problems with real-time performance. Those
online books are great thanks for the tip!


Oliver

Paul G. Tobey [eMVP]

unread,
Sep 29, 2008, 12:13:57 PM9/29/08
to
You won't want to be doing database access in your data acquisition threads,
anyway. Send the data, once you've got it, to a second, lower-priority
thread to put it into the database.

Paul T.

"Oliver Schenk" <oliver...@ii.net> wrote in message

news:O4o9U13H...@TK2MSFTNGP05.phx.gbl...

0 new messages