GithubHelp home page GithubHelp logo

brijeshlakkad / delinkcious Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 337 KB

Delinkcious Microservices with Kubernetes

Go 76.58% Shell 3.75% Dockerfile 2.39% Python 16.29% Starlark 0.99%
golang kubernetes microservices

delinkcious's Introduction

Delinkcious

A delicious-like link management platform implemented using Go microservices

Why build this? What's new here?

  • I attempt to cover the development of a real-world product end to end. I have learned a lot while working on this, and I expect that to continue.
  • A bigger goal is to have good onboarding documentation, and videos so that new devs benefit from it. I want them to have access to a fully working, thoroughly tested and complex product running in production. Open access to knowledge is my top priority.

Why choose Go?

  • Simplicity
  • Strongly typed and compiled
  • Compiles to a single binary with no external dependencies.
  • Fast and lightweight
  • Encourages good coding practices
  • Excellent support for network programming and concurrency.
  • Easy to deploy, implementation language of many cloud-native data stores, queues, and frameworks (including Docker and Kubernetes).

Prerequisites

Why CircleCI for Continuous Integration (completely Kubernetes-agnostic)?

  • Free CI services for open source projects.
  • Feature-complete and has a nicer UI, which is important.

Why ArgoCD for Continuous Delivery?

  • Kubernetes-aware
  • Implemented on top of a general-purpose workflow engine (Argo)
  • Great UI
  • Runs on your Kubernetes cluster
  • Implemented in Go (not important, but I like it)

Other options for CI/CD

  • Travis CI (free for open source projects)
  • Jenkins X
  • Spinnaker
  • Tekton
  • ArgoCD
  • Roll your own pipeline

Where is it deployed?

It’s not deployed anywhere right now, I’m still coding the services. It’s a work in progress.

Directory Structure

  • pkg - The core logic is implemented by libraries in this directory

  • svc - The microservices are in this directory. They use the excellent gokit microservice framework.

  • cmd - Various utilities and one-time commands live here

  • pb - Stands for protobuf. Contains gRPC contracts and generated code.

  • fun - Serverless functions (Nuclio)

What's the high level architecture?

  • API Gateway service - Ingress and a Python-based API gateway service, and exposes Delinkcious to the world.
    • Provides SSL termination, authentication, and routing to multiple services.
  • NewsService - Collects the news of newly created links from NATS and stores the key-value pairs (hot data) in an in-memory data store, Redis.
  • LinkService - Manages links. Upon creating a new link, it triggers LinkChecker to verify the link. The successfully verified links are sent to the NATS server as an event notification to notify about the newly created link. Requests SocialGraphservice for the followers of this user.
  • LinkChecker - Serverless function, to verify links from LinkService and pushes the status of the link to the message queue system, NATS server.
  • SocialGraphService - Manages the followers and followings for the user.
  • UserService - Handles users and its session.

Architecture

The message queue system makes two services loosely coupled. The services are all independent of each other, each keeps doing its job regardless of what the other services do.

Deployment strategy

  • Blue-green deployment strategy fits well to deploy services where we cannot have the same service with different versions co-exist.
  • Canary deployment can work if the versions of the same service can co-exist.

Unit testing

Go to Delinkcious root directory and type: ginkgo -r

You should see something like:

[1556557699] LinkChecker Suite - 2/2 specs •• SUCCESS! 1.57716233s PASS
[1556557699] LinkManager Suite - 8/8 specs 2019/04/29 10:08:30 DB host: localhost DB port: 5432
•••••••• SUCCESS! 95.435161ms PASS
[1556557699] NewsManager Suite - 1/1 specs • SUCCESS! 322.678µs PASS
[1556557699] SocialGraphManager Suite - 6/6 specs 2019/04/29 10:08:30 DB host: localhost DB port: 5432
•••••• SUCCESS! 402.274617ms PASS
[1556557699] UserManager Suite - 6/6 specs 2019/04/29 10:08:31 DB host: localhost DB port: 5432
•••••• SUCCESS! 396.859071ms PASS

Ginkgo ran 5 suites in 11.589104359s
Test Suite Passed

CI/CD

For CI check out the .circleci file and build.sh

See https://circleci.com/gh/Brijeshlakkad/delinkcious/tree/master for status

For CD type: kubectl port-forward -n argocd svc/argocd-server 8080:443

Then browse to: https://localhost:8080

How can I run this locally?

Yes, go ahead and install prerequisites, clone the repo and deploy on your own Kubernetes cluster.

Can I contribute to this project?

Feel free to create a PR, I’m more than happy to review and merge it.

What's the long term goal for this link management?

  • Onboarding videos and documentation
  • Clean code, full test coverage and minimal tech debt
  • Autocomplete
  • Use AWS for hosting all services
  • Replace existing HTTP with gRPC
  • Istio, an open source service mesh provides a coherent model with a control and data plane
  • Support for indexing and search
  • Terraform support
  • User Activity Tracking using URLs
  • React Frontend

delinkcious's People

Contributors

brijeshlakkad avatar

Watchers

 avatar  avatar

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.