Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Sonyflake | 3,271 | 31 | 243 | a month ago | 3 | August 13, 2023 | 5 | mit | Go | |
A distributed unique ID generator inspired by Twitter's Snowflake | ||||||||||
Yuniql | 292 | 1 | 7 | a year ago | 25 | May 25, 2022 | 65 | apache-2.0 | C# | |
Free and open source schema versioning and database migration made natively with .NET/6. NEW THIS MAY 2022! v1.3.15 released! | ||||||||||
Piicatcher | 195 | 1 | 1 | 2 months ago | 51 | December 21, 2022 | 12 | apache-2.0 | Python | |
Scan databases and data warehouses for PII data. Tag tables and columns in data catalogs like Amundsen and Datahub | ||||||||||
Locopy | 98 | 6 days ago | 16 | April 19, 2022 | 4 | apache-2.0 | Python | |||
locopy: Loading/Unloading to Redshift and Snowflake using Python. | ||||||||||
Analyticswithanand | 32 | a month ago | 1 | |||||||
This repository contains all the codes,ppts,project & interview questions which I have used in my LIVE CLASS on YouTube and any other relevant documents and assignments related to the course. | ||||||||||
Flaker | 29 | 9 months ago | apache-2.0 | |||||||
Faker for Snowflake! | ||||||||||
Dbcat | 23 | 3 months ago | 2 | mit | Python | |||||
Data Catalog for Databases and Data Warehouses | ||||||||||
Terraform Snowflake Api Integration With Geff Aws | 21 | 4 months ago | 13 | apache-2.0 | HCL | |||||
Terraform module to create resources across the Snowflake and AWS providers and establish proper relationships within those resources. | ||||||||||
Dot Connect | 11 | 10 days ago | 5 | apache-2.0 | Python | |||||
Improve your workflow efficiency by connecting to databases and cloud systems effortlessly. | ||||||||||
Serverless Snowflake External Function Plugin | 10 | 3 months ago | 6 | November 23, 2021 | 1 | bsd-3-clause | JavaScript | |||
Serverless Plugin for deploying Snowflake External Functions to AWS |
Sonyflake is a distributed unique ID generator inspired by Twitter's Snowflake.
Sonyflake focuses on lifetime and performance on many host/core environment. So it has a different bit assignment from Snowflake. A Sonyflake ID is composed of
39 bits for time in units of 10 msec
8 bits for a sequence number
16 bits for a machine id
As a result, Sonyflake has the following advantages and disadvantages:
However, if you want more generation rate in a single host, you can easily run multiple Sonyflake ID generators concurrently using goroutines.
go get github.com/sony/sonyflake
The function New creates a new Sonyflake instance.
func New(st Settings) (*Sonyflake, error)
You can configure Sonyflake by the struct Settings:
type Settings struct {
StartTime time.Time
MachineID func() (uint16, error)
CheckMachineID func(uint16) bool
}
StartTime is the time since which the Sonyflake time is defined as the elapsed time. If StartTime is 0, the start time of the Sonyflake is set to "2014-09-01 00:00:00 +0000 UTC". If StartTime is ahead of the current time, Sonyflake is not created.
MachineID returns the unique ID of the Sonyflake instance. If MachineID returns an error, Sonyflake is not created. If MachineID is nil, default MachineID is used. Default MachineID returns the lower 16 bits of the private IP address.
CheckMachineID validates the uniqueness of the machine ID. If CheckMachineID returns false, Sonyflake is not created. If CheckMachineID is nil, no validation is done.
In order to get a new unique ID, you just have to call the method NextID.
func (sf *Sonyflake) NextID() (uint64, error)
NextID can continue to generate IDs for about 174 years from StartTime. But after the Sonyflake time is over the limit, NextID returns an error.
Note: Sonyflake currently does not use the most significant bit of IDs, so you can convert Sonyflake IDs from
uint64
toint64
safely.
The awsutil package provides the function AmazonEC2MachineID that returns the lower 16-bit private IP address of the Amazon EC2 instance. It also works correctly on Docker by retrieving instance metadata.
AWS VPC is assigned a single CIDR with a netmask between /28 and /16. So if each EC2 instance has a unique private IP address in AWS VPC, the lower 16 bits of the address is also unique. In this common case, you can use AmazonEC2MachineID as Settings.MachineID.
See example that runs Sonyflake on AWS Elastic Beanstalk.
The MIT License (MIT)
See LICENSE for details.