Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backend: Add scalable PostgreSQL backend #74

Closed
wants to merge 66 commits into from

Conversation

amass01
Copy link
Member

@amass01 amass01 commented Aug 5, 2020

This diff adds PostgreSQL implementation of dcrtimed's Backend interface.
Additionally, It extends dcrtime_fsck, dcrtime_dumpdb & dcrtime_dumpdb -restore to
support postgres backend as well.
The mentioned cmd tools dig in dcrtimed.conf to determine which backend to
run and to find out the db connection params.

Closes #24

@@ -934,33 +934,34 @@ func (fs *FileSystem) LastAnchor() (*backend.LastAnchorResult, error) {
var fr *backend.FlushRecord
var me backend.LastAnchorResult
payload, err := db.Get([]byte(flushedKey), nil)
if err == nil {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed from:

if err == nil {

} else {

}

to:

if err != nil {

}

the else logic here...

dcrtimed/backend/postgres/sql.go Outdated Show resolved Hide resolved
dcrtimed/backend/postgres/schema.md Outdated Show resolved Hide resolved
dcrtimed/backend/postgres/schema.md Show resolved Hide resolved
cmd/dcrtime_fsck/fsck.log Outdated Show resolved Hide resolved
@amass01 amass01 changed the title [wip] backend: Add scalable PostgreSQL backend backend: Add scalable PostgreSQL backend Aug 30, 2020
//
// See loadConfig for details on the configuration load process.
type config struct {
HomeDir string `short:"A" long:"appdata" description:"Path to application home directory"`
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we avoid listing all dcrtimed params here and use only the subset we need ? 🤔

@amass01 amass01 closed this May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add redis or similar scalable backend
3 participants