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:
Lines 70 to 84 in 36bb674
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.
-
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.
-
The Kivik project compatibility table provides an at-a-glance list of completed functionality for all the official drivers, including this one.
-
Indeed. The only meaningful way to test performance of any system, is under real-world load.
-
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?
Lines 13 to 14 in 36bb674
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 :)