go-kivik/memorydb

memorzdb: should/can i use them?

Closed this issue · 4 comments

i want to use this memorydb for testing my kivik application. As i see this features:

memorydb/test/test.go

Lines 70 to 84 in 36bb674

"Stats.skip": true, // FIXME: Unimplemented
"Compact.skip": true, // FIXME: Unimplemented
"DBUpdates.status": kivik.StatusNotImplemented, // FIXME: Unimplemented
"Changes.skip": true, // FIXME: Unimplemented
"Copy.skip": true, // FIXME: Unimplemented, depends on Get/Put or Copy
"GetAttachment.skip": true, // FIXME: Unimplemented
"GetAttachmentMeta.skip": true, // FIXME: Unimplemented
"PutAttachment.skip": true, // FIXME: Unimplemented
"DeleteAttachment.skip": true, // FIXME: Unimplemented
"Query.skip": true, // FIXME: Unimplemented
"CreateIndex.skip": true, // FIXME: Unimplemented
"GetIndexes.skip": true, // FIXME: Unimplemented
"DeleteIndex.skip": true, // FIXME: Unimplemented
"SetSecurity.skip": true, // FIXME: Unimplemented
"ViewCleanup.skip": true, // FIXME: Unimplemented
are not implemented yet but it does not matter for me at the moment!

So my questions:

1.) Should/Can i use them? why I say that? due https://github.com/flimzy/kivik/wiki/Kivik-database-drivers:

MemoryDB github.com/go-kivik/memorydb Memory-only storage, for testing. (Under development)

2.) Is there any documentation for that except the well-written tests :)
3.) how would you test the performance? Setting up a real database but only for testing purposes?
4.) what do I still have to consider

Thank you.

  1. You are of course free to use the memorydb driver for testing. I do this myself. But, as indicated, it's not a complete implementation, so depending on what you need to test, it may or may not match your needs.

  2. The Kivik project compatibility table provides an at-a-glance list of completed functionality for all the official drivers, including this one.

  3. Indeed. The only meaningful way to test performance of any system, is under real-world load.

  4. Go makes it easy to test most systems (such as Kivik) using interfaces and minimal mocks, which may mean you don't need to use the memorydb driver for many of your tests.

Please let me know if I can provide further assistance.

1.)I have to use the testsuite?

memorydb/test/test.go

Lines 13 to 14 in 36bb674

func RegisterMemoryDBSuite() {
kiviktest.RegisterSuite(kiviktest.SuiteKivikMemory, kt.SuiteConfig{

What benefits i have with your Testsuite (https://github.com/go-kivik/kiviktest) (no documentation)?

2.) ... or can i just replace the "couch" driver with the "memorydb" and can use it in any test environment?

client, err := kivik.New(context.TODO(), "memorydb", "http://localhost:5984/")
if err != nil {
	panic(err)
}

You should not have any reason to use the kiviktest test suite. Just load load the memorydb module instead of couchdb:

package main

import (
    "context"

    "github.com/flimzy/kivik"
    _ "github.com/go-kivik/memorydb" // The Memory driver
)

func main() {
    client, err := kivik.New(context.TODO(), "memory", "")
    // ...
}

thank you :)