dbTalk Databases Forums  

Ensure uniqueness without installing DB

comp.databases comp.databases


Discuss Ensure uniqueness without installing DB in the comp.databases forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Leeh
 
Posts: n/a

Default Ensure uniqueness without installing DB - 05-17-2007 , 09:00 PM






Hi,

I'd like to log some data to a log file (could be any format), the
goal to make the entry unique (for example, each entry in the file
have an unique address). Can I accomplish this without installing any
database in the machine that collecting these logs? This is on Windows
Server platform.
Thanks!

Leeh


Reply With Quote
  #2  
Old   
Jan M. Nelken
 
Posts: n/a

Default Re: Ensure uniqueness without installing DB - 05-17-2007 , 11:21 PM






Leeh wrote:
Quote:
Hi,

I'd like to log some data to a log file (could be any format), the
goal to make the entry unique (for example, each entry in the file
have an unique address). Can I accomplish this without installing any
database in the machine that collecting these logs? This is on Windows
Server platform.
Thanks!

Leeh

Perhaps you could use Microsoft Log Parser?

Jan M. Nelken


Reply With Quote
  #3  
Old   
David Segall
 
Posts: n/a

Default Re: Ensure uniqueness without installing DB - 05-18-2007 , 10:40 AM



Leeh <Leeh.chen (AT) gmail (DOT) com> wrote:

Quote:
Hi,

I'd like to log some data to a log file (could be any format), the
goal to make the entry unique (for example, each entry in the file
have an unique address). Can I accomplish this without installing any
database in the machine that collecting these logs? This is on Windows
Server platform.
Thanks!

Leeh
A [G|U]UID http://www.ietf.org/rfc/rfc4122.txt ?


Reply With Quote
  #4  
Old   
toby
 
Posts: n/a

Default Re: Ensure uniqueness without installing DB - 05-19-2007 , 09:02 PM



On May 18, 10:40 am, David Segall <d... (AT) address (DOT) invalid> wrote:
Quote:
Leeh <Leeh.c... (AT) gmail (DOT) com> wrote:
Hi,

I'd like to log some data to a log file (could be any format), the
goal to make the entry unique (for example, each entry in the file
have an unique address). Can I accomplish this without installing any
database in the machine that collecting these logs? This is on Windows
Server platform.
Thanks!

Leeh

A [G|U]UIDhttp://www.ietf.org/rfc/rfc4122.txt?
Yeah, or you can use a serial number/timestamp/hash, or, if it's an
append only log file, each entry already has a unique 'address': its
file position.

It would be nice to know the circumstances this data is consumed/
queried.



Reply With Quote
  #5  
Old   
Ed Prochak
 
Posts: n/a

Default Re: Ensure uniqueness without installing DB - 05-21-2007 , 03:32 PM



On May 18, 10:40 am, David Segall <d... (AT) address (DOT) invalid> wrote:
Quote:
Leeh <Leeh.c... (AT) gmail (DOT) com> wrote:
Hi,

I'd like to log some data to a log file (could be any format), the
goal to make the entry unique (for example, each entry in the file
have an unique address). Can I accomplish this without installing any
database in the machine that collecting these logs? This is on Windows
Server platform.
Thanks!

Leeh

A [G|U]UIDhttp://www.ietf.org/rfc/rfc4122.txt?


Leeh,

What makes your data unique? Is it time? people's names? addresses?
the entire instance of data?

Possible solutions:
a flat file scanned linearly.
- good for small amounts of data, works with variable length log
entries

a sorted file scanned in binary search,
- good for medium amounts of data, and works best for fixed length log
entries

a hashed file
- good for larger still amounts of data. Then depending on the hash
function and the data, you may or may not have collision logic). It
can work for fixed and variable length data.

Those assume a given log entry is unique due to the contents of the
entry. If not, you can use

a timestamp
- this works with out lookups in the previous data, but requires a
clock source with finer resolution than the data coming into the log
or finer than active thread/process swap time (to avoid collisions of
two events happening "at the same time".)

a "ticket" system. this is like the ticket you get at the deli counter
to basically record your place in line.
- This works very well if you have only one program actually writing
to the log. Otherwise you need a monitor program to assign new
"ticket" values (i.e., possible bottleneck)

a UID
- this is similar to a hash and a timestamp.

For logging a simple timestamp usually suffices. Easy to implement and
fast to use.
Ed





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.