Micro service frame

Overview

MicroFrame

MicroFrame是基于go-micro结合go的plugin(需要go1.8或以上)开发的一个微服务框架。

go-micro本身已经做了非常好的抽象和插件化。MicroFrame没有直接采用go-micro,而是在它的基础上重新开发有下面一些原因。

  1. 对纯粹的业务开发屏蔽掉掉所有服务本身的代码(当时也有考虑过使用生成代码)
  2. go-micro使用命令行参数设置启动状态,MicroFrame则依据配置文件
  3. 统一微服务节点结构
  4. 统计提供日志收集,状态监控,PV统计,性能统计,请求跟踪调试的服务。
  5. 所有节点可以通过配置,直接使用以上这些公共服务

微服务架构设计

MicroFrame

节点设计

  1. 每个微服务节点为一个MicroFrame框架服务实例(包括API、WEB、SRV、Worker、数据库代理、配置中心节点、日志收集节点)
  2. MicroFrame通过配置选择加载需要公共插件和业务插件,而成为不同的功能节点
  3. 对于一个新的业务功能,我们只需要为其开发相应的微服务Handle业务插件即可

MicroFrame框架运行流程

  1. 框架读取配置文件
  2. 框架根据配置文件加载插件(当内部插件与外部插件同名时,会加载外部插件)
  3. 调用已经加载插件的NewPlugin函数新建插件结构体(插件的NewPlugin调用无序)
  4. 对插件按插件本身阶段类型以及在配置文件中的位置进行排序
  5. 顺序依次调用插件的Preinit函数(wrap操作需要在这一步增加)
  6. 框架初始化自己的Service
  7. 顺序依次调用插件的Init函数(这一步注册业务Handle)
  8. 顺序依次调用插件的Start函数
  9. 逆序依次调用插件的Stop函数
  10. 逆序依次调用插件的Uninit函数

微服务技术选型示例

  • 服务发现 consul(优先考虑)
  • 服务保护 hystrix
  • 服务通信 protobuf(优先), jsonrpc(兼容)
  • 框架 microframe(基于go-micro)
  • 部署方案 kubernetes,docker swarm
  • 监控报警 influxdb, telegraf, hrafana
  • 日志收集 fluentd(ELK)
  • 配置文件格式 yaml(优先),toml
  • 日志格式 xclog
Owner
never lee
never lee
Sample full stack micro services application built using the go-Micro framework.

goTemp goTemp is a full stack Golang microservices sample application built using go-micro. The application is built as a series of services that prov

null 56 Apr 17, 2022
Micro-service framework in Go

Kite Micro-Service Framework Kite is a framework for developing micro-services in Go. Kite is both the name of the framework and the micro-service tha

Koding, Inc. 3.1k May 15, 2022
NewSQL distributed storage database based on micro service framework

QLite 是基于微服务的 NewSQL 型数据库系统,与传统的一体化数据库不同,该系统将本该内置的多种数据结构(STL)拆分成多个服务模块,每个模块都是独立的一个节点,每个节点都与其主网关进行连接,从而形成分布式存储结构。

null 30 Mar 25, 2022
Automatic Service Mesh and RPC generation for Go micro services, it's a humble alternative to gRPC with Istio.

Mesh RPC MeshRPC provides automatic Service Mesh and RPC generation for Go micro services, it's a humble alternative to gRPC with Istio. In a nutshell

AstraNet Toolkit 68 Apr 19, 2022
🦄🌈 YoyoGo is a simple, light and fast , dependency injection based micro-service framework written in Go.

???? YoyoGo is a simple, light and fast , dependency injection based micro-service framework written in Go. Support Nacos ,Consoul ,Etcd ,Eureka ,kubernetes.

YoyoFx 533 May 1, 2022
Another excellent micro service framework

xservice [WIP] Another excellent micro service framework Features RESTful API (base on echo/v4) gRPC & gRPC gateway service & Swagger document generat

新片场 8 Apr 27, 2022
White Matrix Micro Service Generate CLI Tool

micro-service-gen-tool White Matrix Micro Service Generate CLI Tool usage templa

null 5 Jan 5, 2022
Zdpgo micro service inventory - Golang开发的库存微服务

zdpgo_micro_service_goods Golang开发的商品微服务service层 生成proto 安装插件 go install google.

张大鹏 0 Feb 3, 2022
Rpcx-framework - An RPC microservices framework based on rpcx, simple and easy to use, ultra fast and efficient, powerful, service discovery, service governance, service layering, version control, routing label registration.

RPCX Framework An RPC microservices framework based on rpcx. Features: simple and easy to use, ultra fast and efficient, powerful, service discovery,

ZYallers 1 Jan 5, 2022
Go Micro is a framework for distributed systems development

Go Micro Go Micro is a framework for distributed systems development. Overview Go Micro provides the core requirements for distributed systems develop

Asim Aslam 18.2k May 15, 2022
A code generator that turns plain old Go services into RPC-enabled (micro)services with robust HTTP APIs.

Frodo is a code generator and runtime library that helps you write RPC-enabled (micro) services and APIs.

Monadic 17 Apr 21, 2022
Micro is a platform for cloud native development

Micro Overview Micro addresses the key requirements for building services in the cloud. It leverages the microservices architecture pattern and provid

Micro 11.1k May 15, 2022
goTempM is a full stack Golang microservices sample application built on top of the Micro platform.

goTempM is a full stack Golang microservices sample application built on top of the Micro platform.

null 25 Apr 28, 2022
a microservice framework for rapid development of micro services in Go with rich eco-system

中文版README Go-Chassis is a microservice framework for rapid development of microservices in Go. it focus on helping developer to deliver cloud native a

null 2.5k May 9, 2022
Fastglue is an opinionated, bare bones wrapper that glues together fasthttp and fasthttprouter to act as a micro HTTP framework.

fastglue Overview fastglue is an opinionated, bare bones wrapper that glues together fasthttp and fasthttprouter to act as a micro HTTP framework. It

Zerodha Technology 70 Apr 7, 2022
微服务架构-micro-基于go-zero zrpc etcd 单独集成orm-gorm 日志-uber/zap

micro目录结构 pkg ├── api 业务接口逻辑层 所有的业务逻辑存放目录。 │ ├── model 数据模型 数据管理层,仅用于操作管理数据,如数据库操作 ├── assets

jiwei 8 Apr 26, 2022
A Micro-UTP, plug-able sanity checker for any on-prem JFrog platform instance

hello-frog About this plugin This plugin is a template and a functioning example for a basic JFrog CLI plugin. This README shows the expected structur

rdar 0 Dec 7, 2021
An open network for Micro services.

Micro Network The micro network is an open network for Micro services. Note: The network is still in early development. This document serves as a star

Micro 10 May 10, 2022
micro-draft-manager is a microservice that helps you to manage unstructured data in your application with sorting and full-text search

micro-draft-manager is a microservice that helps you to manage unstructured data in your application with sorting and full-text search. For example, y

Hamed Abdollahpour 1 Nov 24, 2021