{"id":15292560,"url":"https://github.com/ahoo-wang/cosky","last_synced_at":"2026-03-01T14:07:49.826Z","repository":{"id":38127754,"uuid":"360576464","full_name":"Ahoo-Wang/CoSky","owner":"Ahoo-Wang","description":"High-performance, low-cost microservice governance platform. Service Discovery and Configuration Service | 高性能、低成本微服务治理平台","archived":false,"fork":false,"pushed_at":"2025-04-09T15:06:27.000Z","size":10050,"stargazers_count":82,"open_issues_count":13,"forks_count":21,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-09T15:38:33.640Z","etag":null,"topics":["cloud","cloud-native","configuration","configuration-management","dashboard","eureka","kotlin","microservice","microservices","nacos","native","redis","service","service-discovery","service-registry","spring","spring-boot","spring-cloud","spring-cloud-config","spring-cloud-eureka"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ahoo-Wang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-22T15:59:29.000Z","updated_at":"2025-04-09T15:06:29.000Z","dependencies_parsed_at":"2023-10-17T05:03:33.082Z","dependency_job_id":"493b52a7-bbd4-4a0c-a44b-192b1c7c91dc","html_url":"https://github.com/Ahoo-Wang/CoSky","commit_stats":{"total_commits":470,"total_committers":4,"mean_commits":117.5,"dds":0.4936170212765958,"last_synced_commit":"bf25c350ec5426ad2d2d57a266a02e8081e292ad"},"previous_names":["ahoo-wang/govern-service"],"tags_count":95,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ahoo-Wang%2FCoSky","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ahoo-Wang%2FCoSky/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ahoo-Wang%2FCoSky/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ahoo-Wang%2FCoSky/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ahoo-Wang","download_url":"https://codeload.github.com/Ahoo-Wang/CoSky/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248384037,"owners_count":21094659,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloud","cloud-native","configuration","configuration-management","dashboard","eureka","kotlin","microservice","microservices","nacos","native","redis","service","service-discovery","service-registry","spring","spring-boot","spring-cloud","spring-cloud-config","spring-cloud-eureka"],"created_at":"2024-09-30T16:18:47.219Z","updated_at":"2026-03-01T14:07:49.814Z","avatar_url":"https://github.com/Ahoo-Wang.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [CoSky](https://github.com/Ahoo-Wang/CoSky) - High-Performance Microservice Governance Platform\n\n[![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)\n[![GitHub release](https://img.shields.io/github/release/Ahoo-Wang/CoSky.svg)](https://github.com/Ahoo-Wang/CoSky/releases)\n[![Maven Central Version](https://img.shields.io/maven-central/v/me.ahoo.cosky/cosky-core)](https://central.sonatype.com/artifact/me.ahoo.cosky/cosky-core)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/9e31358946b645abb283e83b10e85e2d)](https://www.codacy.com/gh/Ahoo-Wang/CoSky/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=Ahoo-Wang/CoSky\u0026amp;utm_campaign=Badge_Grade)\n[![codecov](https://codecov.io/gh/Ahoo-Wang/CoSky/branch/main/graph/badge.svg?token=N114DHHBUI)](https://codecov.io/gh/Ahoo-Wang/CoSky)\n[![Integration Test Status](https://github.com/Ahoo-Wang/CoSky/actions/workflows/integration-test.yml/badge.svg)](https://github.com/Ahoo-Wang/CoSky)\n[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/Ahoo-Wang/CoSky)\n\n\u003e [中文文档](https://github.com/Ahoo-Wang/CoSky/blob/main/README.zh-CN.md)\n\n*[CoSky](https://github.com/Ahoo-Wang/CoSky)* is a lightweight, low-cost service registration, service discovery, and\nconfiguration service SDK. By leveraging Redis in your existing infrastructure (which you've likely already deployed),\nCoSky eliminates additional operational costs and deployment burdens. Powered by Redis's high performance, CoSky\ndelivers exceptional TPS\u0026QPS (100,000+/s [JMH Benchmark](#jmh-benchmark)). Through its combination of local process\ncaching strategies and *Redis PubSub*, CoSky achieves real-time cache refreshing with outstanding QPS performance (\n70,000,000+/s [JMH Benchmark](#jmh-benchmark)) and maintains real-time consistency between process cache and Redis.\n\n## Service Discovery\n\n\u003cp align=\"center\"\u003e\n     \u003cimg src=\"./docs/CoSky-Discovery.png\" alt=\"CoSky-Discovery\"/\u003e\n\u003c/p\u003e\n\n## Configuration\n\n\u003cp align=\"center\"\u003e\n     \u003cimg src=\"./docs/CoSky-Configuration.png\" alt=\"CoSky-Configuration\"/\u003e\n\u003c/p\u003e\n\n## Examples\n\n[Service Consumer --RPC--\u003e Service Provider Examples](https://github.com/Ahoo-Wang/CoSky/tree/main/examples)\n\n## Installation\n\n### Gradle\n\n\u003e Kotlin DSL\n\n``` kotlin\n    val coskyVersion = \"lastVersion\";\n    implementation(\"me.ahoo.cosky:spring-cloud-starter-cosky-config:${coskyVersion}\")\n    implementation(\"me.ahoo.cosky:spring-cloud-starter-cosky-discovery:${coskyVersion}\")\n    implementation(\"org.springframework.cloud:spring-cloud-starter-loadbalancer:3.0.3\")\n```\n\n### Maven\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\n\u003cproject xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\"\u003e\n\n    \u003cmodelVersion\u003e4.0.0\u003c/modelVersion\u003e\n    \u003cartifactId\u003edemo\u003c/artifactId\u003e\n    \u003cproperties\u003e\n        \u003ccosky.version\u003elastVersion\u003c/cosky.version\u003e\n    \u003c/properties\u003e\n\n    \u003cdependencies\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003eme.ahoo.cosky\u003c/groupId\u003e\n            \u003cartifactId\u003espring-cloud-starter-cosky-config\u003c/artifactId\u003e\n            \u003cversion\u003e${cosky.version}\u003c/version\u003e\n        \u003c/dependency\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003eme.ahoo.cosky\u003c/groupId\u003e\n            \u003cartifactId\u003espring-cloud-starter-cosky-discovery\u003c/artifactId\u003e\n            \u003cversion\u003e${cosky.version}\u003c/version\u003e\n        \u003c/dependency\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003eorg.springframework.cloud\u003c/groupId\u003e\n            \u003cartifactId\u003espring-cloud-starter-loadbalancer\u003c/artifactId\u003e\n            \u003cversion\u003e3.0.3\u003c/version\u003e\n        \u003c/dependency\u003e\n    \u003c/dependencies\u003e\n\n\u003c/project\u003e\n```\n\n### bootstrap.yaml (Spring-Cloud-Config)\n\n```yaml\nspring:\n  application:\n    name: ${service.name:cosky}\n  data:\n    redis:\n      url: redis://localhost:6379\n  cloud:\n    cosky:\n      namespace: ${cosky.namespace:cosky-{system}}\n      config:\n        config-id: ${spring.application.name}.yaml\n    service-registry:\n      auto-registration:\n        enabled: ${cosky.auto-registry:true}\nlogging:\n  file:\n    name: logs/${spring.application.name}.log\n```\n\n## 🌐 REST-API Server (Optional)\n\nChoose from three deployment options based on your environment:\n\n### 🖥️ Option 1: Standalone Executable\n\nDownload the latest release and run directly:\n\n```shell\n# Download cosky-server\nwget https://github.com/Ahoo-Wang/cosky/releases/latest/download/cosky-server.tar\n\n# Extract and run\ntar -xvf cosky-server.tar\ncd cosky-server\nbin/cosky --server.port=8080 --spring.data.redis.url=redis://localhost:6379\n```\n\n### 🐳 Option 2: Docker Deployment\n\nQuick deployment with Docker:\n\n```shell\ndocker pull ahoowang/cosky:latest\ndocker run --name cosky -d -p 8080:8080 \\\n  -e SPRING_DATA_REDIS_URL=redis://your-redis-host:6379 \\\n  ahoowang/cosky:latest\n```\n\n### ☸️ Option 3: Kubernetes Deployment\n\nDeploy in your Kubernetes cluster:\n\n```yaml\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: cosky\n  labels:\n    app: cosky\nspec:\n  replicas: 1\n  selector:\n    matchLabels:\n      app: cosky\n  template:\n    metadata:\n      labels:\n        app: cosky\n    spec:\n      containers:\n        - name: cosky\n          image: ahoowang/cosky:latest\n          ports:\n            - containerPort: 8080\n              protocol: TCP\n          env:\n            - name: SPRING_DATA_REDIS_URL\n              value: redis://your-redis-host:6379\n          resources:\n            requests:\n              cpu: 250m\n              memory: 1024Mi\n            limits:\n              cpu: \"1\"\n              memory: 1280Mi\n          volumeMounts:\n            - name: volume-localtime\n              mountPath: /etc/localtime\n      volumes:\n        - name: volume-localtime\n          hostPath:\n            path: /etc/localtime\n            type: \"\"\n\n---\napiVersion: v1\nkind: Service\nmetadata:\n  name: cosky\n  labels:\n    app: cosky\nspec:\n  selector:\n    app: cosky\n  ports:\n    - name: rest\n      port: 80\n      protocol: TCP\n      targetPort: 8080\n```\n\n### 🎨 Dashboard\n\nAccess the web-based management interface at:\n\u003e [http://localhost:8080](http://localhost:8080)\n\n\u003cp align=\"center\"\u003e\n     \u003cimg src=\"./docs/dashboard-dashboard.png\" alt=\"CoSky-Dashboard\"/\u003e\n\u003c/p\u003e\n\nThe CoSky Dashboard provides:\n\n- Real-time service monitoring and management\n- Configuration management with version control\n- Namespace isolation and management\n- Role-based access control (RBAC)\n- Audit logging for compliance\n- Service topology visualization\n- Easy import/export functionality\n\n### Login\n\n\u003cp align=\"center\"\u003e\n      \u003cimg src=\"./docs/dashboard-login.png\" alt=\"CoSky-Dashboard-login\"/\u003e\n\u003c/p\u003e\n\n### Service dependent topology\n\n\u003cp align=\"center\"\u003e\n     \u003cimg src=\"./docs/dashboard-topology.png\" alt=\"CoSky-Dashboard-topology\"/\u003e\n\u003c/p\u003e\n\n### Role-based access control(RBAC)\n\n- cosky: Reserved username, super user, with the highest authority. When the application is launched for the first time,\n  the super user (cosky) password will be initialized and printed on the console. Don't worry if you forget your\n  password, you can configure `enforce-init-super-user: true`, *CoSky* will help you reinitialize the password and print\n  it on the console.\n\n```log\n---------------- ****** CoSky -  init super user:[cosky] password:[6TrmOux4Oj] ****** ----------------\n```\n\n- admin: Reserved roles, super administrator roles, have all permissions, a user can be bound to multiple roles, and a\n  role can be bound to multiple resource operation permissions.\n- Permission control granularity is namespace, read and write operations\n\n#### Role Permissions\n\n\u003cp align=\"center\"\u003e\n     \u003cimg src=\"./docs/dashboard-role.png\" alt=\"CoSky-Dashboard-role\"/\u003e\n\u003c/p\u003e\n\n##### Add Role\n\n\u003cp align=\"center\"\u003e\n     \u003cimg src=\"./docs/dashboard-role-add.png\" alt=\"CoSky-Dashboard-role-add\"/\u003e\n\u003c/p\u003e\n\n#### User Management\n\n\u003cp align=\"center\"\u003e\n     \u003cimg src=\"./docs/dashboard-user.png\" alt=\"CoSky-Dashboard-user\"/\u003e\n\u003c/p\u003e\n\n##### Add User\n\n\u003cp align=\"center\"\u003e\n     \u003cimg src=\"./docs/dashboard-user-add.png\" alt=\"CoSky-Dashboard-user-add\"/\u003e\n\u003c/p\u003e\n\n#### Audit Log\n\n\u003cp align=\"center\"\u003e\n     \u003cimg src=\"./docs/dashboard-audit-log.png\" alt=\"CoSky-Dashboard-audit-log\"/\u003e\n\u003c/p\u003e\n\n#### Namespace\n\n\u003cp align=\"center\"\u003e\n     \u003cimg src=\"./docs/dashboard-namespace.png\" alt=\"CoSky-Dashboard-namespace\"/\u003e\n\u003c/p\u003e\n\n#### Config\n\n\u003cp align=\"center\"\u003e\n     \u003cimg src=\"./docs/dashboard-config.png\" alt=\"CoSky-Dashboard-config\"/\u003e\n\u003c/p\u003e\n\n##### Edit configuration\n\n\u003cp align=\"center\"\u003e\n     \u003cimg src=\"./docs/dashboard-config-edit.png\" alt=\"CoSky-Dashboard-config-edit\"/\u003e\n\u003c/p\u003e\n\n##### Rollback configuration\n\n\u003cp align=\"center\"\u003e\n     \u003cimg src=\"./docs/dashboard-config-rollback.png\" alt=\"CoSky-Dashboard-config-rollback\"/\u003e\n\u003c/p\u003e\n\n##### Import configuration from Nacos\n\n\u003cp align=\"center\"\u003e\n     \u003cimg src=\"./docs/dashboard-config-import.png\" alt=\"CoSky-Dashboard-config-rollback\"/\u003e\n\u003c/p\u003e\n\n#### Service\n\n\u003cp align=\"center\"\u003e\n     \u003cimg src=\"./docs/dashboard-service.png\" alt=\"CoSky-Dashboard-service\"/\u003e\n\u003c/p\u003e\n\n##### Edit Service Instance\n\n\u003cp align=\"center\"\u003e\n     \u003cimg src=\"./docs/dashboard-service-edit.png\" alt=\"CoSky-Dashboard-service-edit\"/\u003e\n\u003c/p\u003e\n\n### REST-API\n\n\u003e https://ahoo-cosky.apifox.cn/\n\n## 🚀 Performance Benchmarks\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eCoSky delivers exceptional performance, outperforming alternatives by orders of magnitude\u003c/strong\u003e\n\u003c/p\u003e\n\n### Test Environment\n\n- **Hardware**: MacBook Pro (M1)\n- **Redis**: Deployed locally on the same machine\n- **Methodology**: All benchmarks conducted using JMH (Java Microbenchmark Harness)\n\n### Config Service Performance\n\n```shell\ngradle cosky-config:jmh\n# or\njava -jar cosky-config/build/libs/cosky-config-lastVersion-jmh.jar -bm thrpt -t 25 -wi 1 -rf json -f 1\n```\n\n#### Results\n\n```\nBenchmark                                          Mode  Cnt          Score   Error  Units\nConsistencyRedisConfigServiceBenchmark.getConfig  thrpt       256733987.827          ops/s\nRedisConfigServiceBenchmark.getConfig             thrpt          241787.679          ops/s\nRedisConfigServiceBenchmark.setConfig             thrpt          140461.112          ops/s\n```\n\n### Service Discovery Performance\n\n```shell\ngradle cosky-discovery:jmh\n# or\njava -jar cosky-discovery/build/libs/cosky-discovery-lastVersion-jmh.jar -bm thrpt -t 25 -wi 1 -rf json -f 1\n```\n\n#### Results\n\n```\nBenchmark                                                Mode  Cnt          Score   Error  Units\nConsistencyRedisServiceDiscoveryBenchmark.getInstances  thrpt        76621729.048          ops/s\nConsistencyRedisServiceDiscoveryBenchmark.getServices   thrpt       455760632.346          ops/s\nRedisServiceDiscoveryBenchmark.getInstances             thrpt          226909.985          ops/s\nRedisServiceDiscoveryBenchmark.getServices              thrpt          304979.150          ops/s\nRedisServiceRegistryBenchmark.deregister                thrpt          255305.648          ops/s\nRedisServiceRegistryBenchmark.register                  thrpt          110664.160          ops/s\nRedisServiceRegistryBenchmark.renew                     thrpt          210960.325          ops/s\n```\n\n\u003e 🔥 **Key Insight**: CoSky's consistency layer provides over 800x performance improvement for configuration retrieval\n\u003e and over 250x for service discovery compared to standard Redis operations.\n\n## 🔁 CoSky-Mirror (Real-time synchronization of service instance change status)\n\n\u003e CoSky-Mirror acts as a bridge between Nacos and CoSky, creating a unified service discovery platform that enables\n\u003e seamless integration.\n\n\u003cp align=\"center\"\u003e\n     \u003cimg src=\"./docs/CoSky-Mirror.png\" alt=\"CoSky-Mirror\"/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n     \u003cimg src=\"./docs/CoSky-Mirror-Unified.png\" alt=\"CoSky-Mirror-Unified\"/\u003e\n\u003c/p\u003e\n\nWith CoSky-Mirror, you can:\n\n- Synchronize service instances between Nacos and CoSky in real-time\n- Maintain consistency across different service registries\n- Migrate from Nacos to CoSky with zero downtime\n- Build a hybrid service discovery architecture\n\n## 📊 Feature Comparison\n\n| Feature                     | CoSky           | Eureka      | Consul            | CoreDNS    | Zookeeper  | Nacos                      | Apollo      |\n|-----------------------------|-----------------|-------------|-------------------|------------|------------|----------------------------|-------------|\n| **CAP**                     | CP+AP           | AP          | CP                | CP         | CP         | CP+AP                      | CP+AP       |\n| **Health Check**            | Client Beat     | Client Beat | TCP/HTTP/gRPC/Cmd | Keep Alive | Keep Alive | TCP/HTTP/Client Beat       | Client Beat |\n| **Load Balancing**          | Weight/Selector | Ribbon      | Fabio             | RoundRobin | RoundRobin | Weight/metadata/RoundRobin | RoundRobin  |\n| **Avalanche Protection**    | ❌               | ✅           | ❌                 | ❌          | ❌          | ✅                          | ❌           |\n| **Auto Logoff Instance**    | ✅               | ✅           | ❌                 | ❌          | ✅          | ✅                          | ✅           |\n| **Access Protocol**         | HTTP/Redis      | HTTP        | HTTP/DNS          | DNS        | TCP        | HTTP/DNS                   | HTTP        |\n| **Listening Support**       | ✅               | ✅           | ✅                 | ❌          | ✅          | ✅                          | ✅           |\n| **Multi-data Center**       | ✅               | ✅           | ✅                 | ❌          | ❌          | ✅                          | ✅           |\n| **Cross Registry Sync**     | ✅               | ❌           | ✅                 | ❌          | ❌          | ✅                          | ❌           |\n| **SpringCloud Integration** | ✅               | ✅           | ✅                 | ❌          | ❌          | ✅                          | ✅           |\n| **Dubbo Integration**       | ✅               | ❌           | ❌                 | ❌          | ✅          | ✅                          | ✅           |\n| **K8S Integration**         | ✅               | ❌           | ✅                 | ✅          | ❌          | ✅                          | ❌           |\n| **Persistence**             | Redis           | -           | -                 | -          | -          | MySql                      | MySql       |\n\n\u003e ✅ **Key Advantages of CoSky**:\n\u003e - **Hybrid CP+AP model** for both consistency and availability\n\u003e - **Ultra-high performance** with Redis backend (100K+ QPS)\n\u003e - **Cross registry synchronization** capability\n\u003e - **Lightweight deployment** with minimal operational overhead\n\u003e - **Comprehensive ecosystem integration** (Spring Cloud, Dubbo, K8S)\n\n---\n\n## 🤝 Contributing\n\nWe welcome contributions from the community! Whether it's reporting bugs, suggesting features, or submitting pull\nrequests, your input helps make CoSky better for everyone.\n\n## 📄 License\n\nCoSky is open-sourced software licensed under\nthe [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahoo-wang%2Fcosky","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahoo-wang%2Fcosky","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahoo-wang%2Fcosky/lists"}