GithubHelp home page GithubHelp logo

zhangwei5095 / 58code.oceanus Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wuba/oceanus

0.0 2.0 0.0 5.55 MB

58同城数据库中间件

License: Apache License 2.0

Java 99.96% JavaScript 0.03% SQLPL 0.01% PLpgSQL 0.01%

58code.oceanus's Introduction

Oceanus

Oceanus - 58同城数据库中间件

关于DB中间件

在DB存储需求中,尽管业务不同,技术难点还是类似的,开源世界有很多DB中间件,解决方案也以通用方案为主,满足业务需要为前提,支持各种类型的需求。

Oceanus致力于打造一个功能简单、可依赖、易于上手、易于扩展、易于集成的解决方案,甚至是平台化系统。拥抱开源,提供各类插件机制集成其他开源项目,新手可以在几分钟内上手编程,分库分表逻辑不再与业务紧密耦合,扩容有标准模式,减少意外错误的发生。

Oceanus内部名词定义

  • datanode:数据源节点。为一个数据源命名,配置链接属性、报警实现
  • namenode:数据源的簇。为一组数据源命名,指定这组数据源的负载方式、访问模式、权重
  • table:映射表。匹配解析sql中的table名称,命中table标签的name属性值后,会执行约定的路由逻辑
  • bean:实体。由其他标签引用,实体类必须有无参的构造函数
  • tracker:监控埋点。涉及到计算和IO的功能点都有监控点,自定义一个埋点实现类,当功能耗时超出预期时会执行其中的回调函数,便于监控和优化系统

为什么说Oceanus是非常易用的

Oceanus在设计时非常注重使用者的评价,配置结构近乎于和使用者交流约定业务规则,便于不同的人看同一套配置,互相理解流程。当配置文件编写完成后,编码就变得更加简单,只调用Oceanus客户端的几个方法就可以实现数据库操作,不再关心HA、报警、负载均衡、性能监控等问题。良好的用户视觉减少了分库分表在业务场景中的耦合度,对于编码者就像只对一个table操作,Oceanus负责进行sql解析、路由、sql重写。

如提交:	select * from user;

改写成:	select * from user0;
		   select * from user1;
		   select * from user2;
		   select * from user3;

分发给不同的库(或者同库)执行,用户视觉如图: github

开源集成

“接地气,拥抱开源” 是Oceanus的设计原则之一,可以很好的集成到mybatis和hibernate中,只要引用其中的插件,编写Oceanus配置文件,然后改写各自的DataSource实现或ConnectionProvider即可做到集成。这样既用到了熟悉的ORM,又借助Oceanus实现了分库分表等功能。

待开发

不得不说Oceanus在设计上非常灵活,使得每一个细小的功能点都有极高的切入价值,比如Cache机制、全局的ID生成规则、资源可视化监控等等,把其中某一个点做得足够好,都会为整体产品带来质的提升,简化实际生产环境中的配套系统研发维护成本。

wiki

https://github.com/58code/Oceanus/wiki

58同城开源技术交流群:427359544

58code.oceanus's People

Contributors

58code avatar biocy avatar hailinzeng 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.