Coder Social home page Coder Social logo

yeqown / cassem Goto Github PK

View Code? Open in Web Editor NEW
24.0 24.0 3.0 2.07 MB

(WIP) A distributed Configuration Center Application.

License: MIT License

Go 95.74% Makefile 1.93% Dockerfile 0.83% Shell 1.50%
configuration-management distributed-systems go raft

cassem's Introduction

Hi, This is yeqown

Welcome to my GitHub profile! I'm a backend software engineer from China πŸ‡¨πŸ‡³, and I'm trying to be a full-stack engineer and a DevOps engineer. I'd like to contribute to open source projects and share my knowledge with others.

About me

  • πŸŽ“ Education: Computer Science and Technology, SouthWest Petroleum University
  • 🌱 Focusing on (now): openresty, lua, LSM, k8s, service mesh
  • πŸ’¬ Topics I like: Microservices, DevOps, Distributed Systems, Linux, Open Source, etc. We can talk these topics together.

Skills

  • Languages: go, python, shell, javascript, c, lua, etc.
  • Frameworks and Libraries: kratos, gin, gorm, asynq etc.
  • Network: tcp/ip, http1/2, grpc, ICMP, etc.
  • Tools: redis, kafka, mysql, rabbitmq, openresty/nginx, k8s, etc.
  • Other Skills: performance tuning, distributed systems design, CI/CD, etc.

I'd using these skills to build a distributed system, and I'm trying to learn more about distributed systems design and implementation.

Open Source Projects

I'd like to contribute to open source projects, you can find them in my GitHub repositories. Such as:

  • kratos - A Go framework for microservices.
  • go-gorm - The fantastic ORM library for Golang, aims to be developer friendly.
  • asynq - Asynq: simple, reliable, and efficient distributed task queue in Go.
  • gocache - A complete Go cache library that brings you multiple ways of managing your caches.
  • go-qrcode - A golang lib to generate QRCode.

Recent Targets or Plans

I'm trying to do these things recently:

Contact me

You can find and get touch with me on these accounts!

If you interested in my projects, you can get in touch with me to discuss more details.

Thanks for visiting my GitHub profile and have a nice day!

cassem's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

cassem's Issues

move `cache` instance from `core.Core`

For now, cache is held by the core.Core, but the cache component is mainly used in the raft.FSM. To close up all of the cache component entries, so move it into FSMWrapper maybe make it cleraly to read.

optimize join action

Background

cassemd must get leader address so that it could join to cluster successfully, this is not easy to use and is unreasonable.

Solution

  • forward join request to the leader while a slave node receives a join request
  • allow cassemd to receive an array of node address so that it could try to join one by one.

replace cache implementation with LRU-K(2) replacement algorithm

now cache components are implemented by go built-in map, it's too simple to manage caches. So that cassemd needs a new version of the cache component to manage caches.

The duty of the cache component includes:

// IStore required ICache to implement persist and restore functions so that the cache could be
// save into file and restore from that.
type IStore interface {
	// Persist serializes cache into []byte data.
	Persist() ([]byte, error)

	// Restore apply data to override all the cache data, data is coming from Persist.
	Restore(data []byte) error
}

// ICache represents the proxy to operate cache data,
// also need to replace data while cache size is over it's limits.
type ICache interface {
	IStore

	// Set returns wasSet means this key needs to synchronous, err means set failed.
	Set(key string, v []byte) SetResult

	// Get
	Get(key string) ([]byte, error)

	// Del if any error is returned, core.Core would not trigger synchronous of the cache.
	Del(key string) SetResult
}

// SetResult represents what operations would be caused by ICache.Set, operations include:
//
// 1. NeedSync tells users that them should trigger setting apply.
// 2. NeedDeleteKey should be set while Cache-Replacing happened or core need to delete cache by itself.
//
type SetResult struct {
	err           error
	NeedSync      bool
	NeedDeleteKey string
}

Remove pair concepts from cassem

  • Redesign the concepts of config container.
  • Focus on the edge problems in the situation of config center.
  • The reuse of pair maybe not the main issue on which the config center should take care.

REFACTOR: cassemdb bootstrap procedure refactoring

Now, cassemdb bootstrapped with fixed configuration of cassemdb cluster and it's members. But it should be another way:

  1. root node1 bootstrap or recover the cluster.
  2. node-2 to node-n join to the cluster which contains node1 only.

persistence refactor

Background

Need a distributed persistence component to support what helps cassem become a system satisfied CP and provide available as much as possible. On another way, DO NOT want to import another dependency to make the save procedure complicated.

Risk

What is a risk is that would changes the cassem software architecture, even makes HTTP API changes.

Thoughts

bbolt would be used to replace mysql.

develop `cassemctl` command

features:

  1. genconf generates the default config file for users.
  2. migrate command to initialize persistence component (for now, DB support).
  3. basic resource managing commands (CURD) + watch. Maybe, this would build on the client SDK ...
  4. health diagnosis (TODO). metrics and cluster infos.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.