Re: [go-nuts] [ANN] - BoltHold - An embeddable NOSQL store for Go Types built on BoltDB

2017-01-17 Thread Tim Shannon
FYI, I've just released a new version which adds things like Skip and Limit 
to queries so you can have proper pagination now, and You can now create 
Aggregate queries to find things like Min, Max or group records.

https://github.com/timshannon/bolthold

On Thursday, November 17, 2016 at 3:55:27 PM UTC-6, Tim Shannon wrote:
>
> This is the first I've heard of storm, looks like it currently has more 
> features (some I think I might try and implement in bolthold).  I think 
> bolthold's querying is a bit simpler to understand, but I may be biased in 
> that regard.
>
> Storm definitely has the better name though :)
>
> On Thursday, November 17, 2016 at 8:52:53 AM UTC-6, Diep Pham wrote:
>>
>> This looks very interesting. How does it compare to 
>> https://github.com/asdine/storm? 
>>
>> Tim Shannon wrote: 
>> > I've used BoltDB  in a quite a few 
>> > projects, and have found it to be fast and very reliable.  But I've 
>> > found that I was writing the same serialization and filtering code for 
>> > each project, so I thought I'd try and build a more generic, reusable 
>> > solution for storing and retrieving Go Types in a BoltDB file. 
>> > 
>> > https://github.com/timshannon/bolthold 
>> > 
>> > You simply open a BoltHold file and start inserting Go types: 
>> > 
>> > store, err := bolthold.Open(filename, 0666, nil) 
>> > if err != nil { 
>> > //handle error 
>> > } 
>> > err = store.Insert("key", { 
>> > Name:"Test Name", 
>> > Created: time.Now(), 
>> > }) 
>> > 
>> > 
>> > If you add the boltHoldIndex struct tag to your type, BoltHold will 
>> > automatically add and update an index for that field: 
>> > 
>> > type Person struct { 
>> > Name string 
>> > Division string `boltholdIndex:"Division"` 
>> > } 
>> > 
>> > 
>> > You can use chainable queries to retrieve, delete, or update records in 
>> > the BoltHold database. 
>> > 
>> > 
>> bolthold.Where("FieldName").Eq(value).And("AnotherField").Lt(AnotherValue).Or(bolthold.Where("FieldName").Eq(anotherValue))
>>  
>>
>> > 
>> > 
>> > In my preliminary benchmarks, I'm finding that the cost of 
>> serialization 
>> > plus index updates don't add any significant overhead compared to disk 
>> > access (which is to be expected), and adding indexes can significant 
>> > improve read speed because you can avoid unnecessary disk accesses, 
>> > however, I haven't written a lot of benchmarks, so any feedback you 
>> guys 
>> > have on how they can be improved to be more accurate, I'd love to hear. 
>> > 
>> > || 
>> > BenchmarkRawInsert-4  300  5351308ns/op 
>> > BenchmarkNoIndexInsert-4  300  5421718ns/op 
>> > BenchmarkIndexedInsert-4  300  5360532ns/op 
>> > BenchmarkNoIndexUpsert-4  300  5468971ns/op 
>> > BenchmarkIndexedUpsert-4  200  5700991ns/op 
>> > BenchmarkNoIndexInsertJSON-4  300  565ns/op 
>> > BenchmarkFindNoIndex-4 50 27340697ns/op 
>> > BenchmarkFindIndexed-4   3000   368265ns/op 
>> > 
>> > It's a first release and the indexing and querying implementation is 
>> > definitely what I would consider naive at this point, and I'm sure 
>> there 
>> > are several improvements that can be made, however it's already proving 
>> > to be a useful tool to me, and I'd love any feedback the community has 
>> > to offer. 
>> > 
>> > There's lots more information in the README at 
>> > https://github.com/timshannon/bolthold 
>> > 
>> > Thanks, 
>> > 
>> > -- 
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] [ANN] - BoltHold - An embeddable NOSQL store for Go Types built on BoltDB

2016-11-17 Thread Tim Shannon
This is the first I've heard of storm, looks like it currently has more 
features (some I think I might try and implement in bolthold).  I think 
bolthold's querying is a bit simpler to understand, but I may be biased in 
that regard.

Storm definitely has the better name though :)

On Thursday, November 17, 2016 at 8:52:53 AM UTC-6, Diep Pham wrote:
>
> This looks very interesting. How does it compare to 
> https://github.com/asdine/storm? 
>
> Tim Shannon wrote: 
> > I've used BoltDB  in a quite a few 
> > projects, and have found it to be fast and very reliable.  But I've 
> > found that I was writing the same serialization and filtering code for 
> > each project, so I thought I'd try and build a more generic, reusable 
> > solution for storing and retrieving Go Types in a BoltDB file. 
> > 
> > https://github.com/timshannon/bolthold 
> > 
> > You simply open a BoltHold file and start inserting Go types: 
> > 
> > store, err := bolthold.Open(filename, 0666, nil) 
> > if err != nil { 
> > //handle error 
> > } 
> > err = store.Insert("key", { 
> > Name:"Test Name", 
> > Created: time.Now(), 
> > }) 
> > 
> > 
> > If you add the boltHoldIndex struct tag to your type, BoltHold will 
> > automatically add and update an index for that field: 
> > 
> > type Person struct { 
> > Name string 
> > Division string `boltholdIndex:"Division"` 
> > } 
> > 
> > 
> > You can use chainable queries to retrieve, delete, or update records in 
> > the BoltHold database. 
> > 
> > 
> bolthold.Where("FieldName").Eq(value).And("AnotherField").Lt(AnotherValue).Or(bolthold.Where("FieldName").Eq(anotherValue))
>  
>
> > 
> > 
> > In my preliminary benchmarks, I'm finding that the cost of serialization 
> > plus index updates don't add any significant overhead compared to disk 
> > access (which is to be expected), and adding indexes can significant 
> > improve read speed because you can avoid unnecessary disk accesses, 
> > however, I haven't written a lot of benchmarks, so any feedback you guys 
> > have on how they can be improved to be more accurate, I'd love to hear. 
> > 
> > || 
> > BenchmarkRawInsert-4  300  5351308ns/op 
> > BenchmarkNoIndexInsert-4  300  5421718ns/op 
> > BenchmarkIndexedInsert-4  300  5360532ns/op 
> > BenchmarkNoIndexUpsert-4  300  5468971ns/op 
> > BenchmarkIndexedUpsert-4  200  5700991ns/op 
> > BenchmarkNoIndexInsertJSON-4  300  565ns/op 
> > BenchmarkFindNoIndex-4 50 27340697ns/op 
> > BenchmarkFindIndexed-4   3000   368265ns/op 
> > 
> > It's a first release and the indexing and querying implementation is 
> > definitely what I would consider naive at this point, and I'm sure there 
> > are several improvements that can be made, however it's already proving 
> > to be a useful tool to me, and I'd love any feedback the community has 
> > to offer. 
> > 
> > There's lots more information in the README at 
> > https://github.com/timshannon/bolthold 
> > 
> > Thanks, 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "golang-nuts" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> > an email to golang-nuts...@googlegroups.com  
> > . 
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] [ANN] - BoltHold - An embeddable NOSQL store for Go Types built on BoltDB

2016-11-17 Thread Diep Pham
This looks very interesting. How does it compare to
https://github.com/asdine/storm?

Tim Shannon wrote:
> I've used BoltDB  in a quite a few
> projects, and have found it to be fast and very reliable.  But I've
> found that I was writing the same serialization and filtering code for
> each project, so I thought I'd try and build a more generic, reusable
> solution for storing and retrieving Go Types in a BoltDB file.
> 
> https://github.com/timshannon/bolthold
> 
> You simply open a BoltHold file and start inserting Go types:
> 
> store, err := bolthold.Open(filename, 0666, nil)
> if err != nil {
> //handle error
> }
> err = store.Insert("key", {
> Name:"Test Name",
> Created: time.Now(),
> })
> 
> 
> If you add the boltHoldIndex struct tag to your type, BoltHold will
> automatically add and update an index for that field:
> 
> type Person struct {
> Name string
> Division string `boltholdIndex:"Division"`
> }
> 
> 
> You can use chainable queries to retrieve, delete, or update records in
> the BoltHold database.
> 
> bolthold.Where("FieldName").Eq(value).And("AnotherField").Lt(AnotherValue).Or(bolthold.Where("FieldName").Eq(anotherValue))
> 
> 
> In my preliminary benchmarks, I'm finding that the cost of serialization
> plus index updates don't add any significant overhead compared to disk
> access (which is to be expected), and adding indexes can significant
> improve read speed because you can avoid unnecessary disk accesses,
> however, I haven't written a lot of benchmarks, so any feedback you guys
> have on how they can be improved to be more accurate, I'd love to hear.
> 
> ||
> BenchmarkRawInsert-4  300  5351308ns/op
> BenchmarkNoIndexInsert-4  300  5421718ns/op
> BenchmarkIndexedInsert-4  300  5360532ns/op
> BenchmarkNoIndexUpsert-4  300  5468971ns/op
> BenchmarkIndexedUpsert-4  200  5700991ns/op
> BenchmarkNoIndexInsertJSON-4  300  565ns/op
> BenchmarkFindNoIndex-4 50 27340697ns/op
> BenchmarkFindIndexed-4   3000   368265ns/op
> 
> It's a first release and the indexing and querying implementation is
> definitely what I would consider naive at this point, and I'm sure there
> are several improvements that can be made, however it's already proving
> to be a useful tool to me, and I'd love any feedback the community has
> to offer.
> 
> There's lots more information in the README at
> https://github.com/timshannon/bolthold
> 
> Thanks,
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to golang-nuts+unsubscr...@googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] [ANN] - BoltHold - An embeddable NOSQL store for Go Types built on BoltDB

2016-11-16 Thread Tim Shannon
I've used BoltDB  in a quite a few 
projects, and have found it to be fast and very reliable.  But I've found 
that I was writing the same serialization and filtering code for each 
project, so I thought I'd try and build a more generic, reusable solution 
for storing and retrieving Go Types in a BoltDB file.

https://github.com/timshannon/bolthold

You simply open a BoltHold file and start inserting Go types:

store, err := bolthold.Open(filename, 0666, nil)if err != nil {
//handle error
}
err = store.Insert("key", {
Name:"Test Name",
Created: time.Now(),
})


If you add the boltHoldIndex struct tag to your type, BoltHold will 
automatically add and update an index for that field:

type Person struct {
Name string
Division string `boltholdIndex:"Division"`
}


You can use chainable queries to retrieve, delete, or update records in the 
BoltHold database.

bolthold.Where("FieldName").Eq(value).And("AnotherField").Lt(AnotherValue).Or(bolthold.Where("FieldName").Eq(anotherValue))


In my preliminary benchmarks, I'm finding that the cost of serialization 
plus index updates don't add any significant overhead compared to disk 
access (which is to be expected), and adding indexes can significant 
improve read speed because you can avoid unnecessary disk accesses, 
however, I haven't written a lot of benchmarks, so any feedback you guys 
have on how they can be improved to be more accurate, I'd love to hear.

BenchmarkRawInsert-4   300   5351308 ns/op
BenchmarkNoIndexInsert-4   300   5421718 ns/op
BenchmarkIndexedInsert-4   300   5360532 ns/op
BenchmarkNoIndexUpsert-4   300   5468971 ns/op
BenchmarkIndexedUpsert-4   200   5700991 ns/op
BenchmarkNoIndexInsertJSON-4   300   565 ns/op
BenchmarkFindNoIndex-4  50  27340697 ns/op
BenchmarkFindIndexed-43000368265 ns/op

It's a first release and the indexing and querying implementation is 
definitely what I would consider naive at this point, and I'm sure there 
are several improvements that can be made, however it's already proving to 
be a useful tool to me, and I'd love any feedback the community has to 
offer.

There's lots more information in the README at 
https://github.com/timshannon/bolthold

Thanks,

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.