Skip to content

ryandotsmith/ddbsync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ddbsync

DynamoDB/sync

This package is designed to emulate the behaviour of pkg/sync on top of Amazon's DynamoDB. If you need a distributed locking mechanism, consider using this package and DynamoDB before standing up paxos or Zookeeper.

GoPkgDoc

Usage

Create a DynamoDB table named Locks.

$ export AWS_ACCESS_KEY=access
$ export AWS_SECRET_KEY=secret
// ./main.go

package main

import(
		"time"
		"github.com/ryandotsmith/ddbsync"
)

func main() {
		m := new(ddbsync.Mutex)
		m.Name = "some-name"
		m.Ttl = 10 * time.Second
		m.Lock()
		defer m.Unlock()
		// do important work here
		return
}
$ go get github.com/ryandotsmith/ddbsync
$ go run main.go

Related

lock-smith

About

DynamoDB Mutual Exclusion Locking for Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages