github.com/ronaksoft/rony@v0.16.26-0.20230807065236-1743dbfe6959/README.MD (about) 1 # Rony (Fast and Scalable RPC Framework) 2 3 ![](https://img.shields.io/github/stars/ronaksoft/rony?color=808080) 4 ![](https://img.shields.io/github/license/ronaksoft/rony?color=808080) 5 6 ![GitHub release (latest SemVer including pre-releases)](https://img.shields.io/github/v/release/ronaksoft/rony?include_prereleases&logoColor=808080) 7 ![](https://github.com/ronaksoft/rony/actions/workflows/go.yml/badge.svg?color=379c9c&style=flat-square) 8 ![](https://github.com/ronaksoft/rony/actions/workflows/devskim-analysis.yml/badge.svg?color=379c9c&style=flat-square) 9 ![](https://github.com/ronaksoft/rony/actions/workflows/codacy-analysis.yml/badge.svg?color=379c9c&style=flat-square) 10 11 ## About 12 13 **Rony** lets you create a clustered aware service easily. Checkout [Wiki](https://rony.ronaksoft.com) 14 15 ### Performance 16 17 Rony is very fast and with very low overhead. In a non-raft environment it adds < 25us latency, and in raft-enabled scenario around 1ms 18 latency. 19 20 Rony has negligible memory footprint by reusing buffers and pooling. 21 22 ```commandline 23 BenchmarkEdgeServerMessageSerial 24 BenchmarkEdgeServerMessageSerial-16 901370 1195 ns/op 87 B/op 2 allocs/op 25 BenchmarkEdgeServerMessageParallel 26 BenchmarkEdgeServerMessageParallel-16 4521645 272 ns/op 83 B/op 2 allocs/op 27 BenchmarkEdgeServerWithRaftMessageSerial 28 BenchmarkEdgeServerWithRaftMessageSerial-16 9541 132065 ns/op 5034 B/op 116 allocs/op 29 BenchmarkEdgeServerWithRaftMessageParallel 30 BenchmarkEdgeServerWithRaftMessageParallel-16 124658 8438 ns/op 4462 B/op 51 allocs/op 31 32 BenchmarkServerWithWebsocket-16 46514 25138 ns/op 691 B/op 19 allocs/op 33 ``` 34 35 --- 36 37 ### Easy Setup for advanced scenarios 38 39 ```go 40 package main 41 42 import ( 43 "github.com/ronaksoft/rony" 44 "github.com/ronaksoft/rony/edge" 45 "os" 46 ) 47 48 func main() { 49 serverID := "UniqueServerID" 50 edgeServer := edge.NewServer(serverID, 51 edge.WithTcpGateway(edge.TcpGatewayConfig{ 52 Concurrency: 1000, 53 MaxIdleTime: 0, 54 ListenAddress: "0.0.0.0:80", 55 ExternalAddrs: []string{"127.0.0.1:80"}, // ExternalAddr could be used when the server is behind proxy or nats 56 }), 57 edge.WithUdpTunnel(edge.UdpTunnelConfig{ 58 ListenAddress: "0.0.0.0:8080", 59 MaxBodySize: 0, 60 ExternalAddrs: nil, 61 }), 62 edge.WithGossipCluster(edge.GossipClusterConfig{ 63 Bootstrap: true, 64 ReplicaSet: 1, 65 GossipPort: 7091, 66 }), 67 ) 68 69 service.RegisterSampleService(&service.SampleService{}, edgeServer) 70 edgeServer.Start() 71 72 edgeServer.ShutdownWithSignal(os.Kill) 73 } 74 ``` 75 76 **This code does not run, please check example directory for working examples** 77 78 79 --- 80 81 ## Shoulders 82 83 Rony is made of big and popular packages. Without these great libraries building Rony was not possible. 84 85 * [Hashicorp MemberList](https://github.com/hashicorp/memberlist) 86 * [SPF13 Cobra](https://github.com/spf13/cobra) 87 * [SPF13 Viper](https://github.com/spf13/viper) 88 * [Valyala FastHttp](https://github.com/valyala/fasthttp) 89 * [Uber Zap](https://go.uber.org/zap) 90 * [Uber Dig](https://go.uber.org/dig) 91 * [Gobwas Websocket](https://github.com/gobwas/ws) 92 * [Allegro BigCache](https://github.com/allegro/bigcache) 93 * [GoBuffalo Genny](https://github.com/gobuffalo/genny) 94 * [GoBuffalo Plush](https://github.com/gobuffalo/plush) 95 96 ### Contribution 97 98 We need to make a clear and understandable documentation for Rony, so any help would be appreciated. We also appreciate benchmarking Rony 99 against other platforms for common scenarios and will be cited. 100 101 ### TODOs 102 103 - [x] Auto-generate REST handlers 104 - [ ] Auto-generate test units 105 - [x] Implement scenario tests using `edgetest` framework 106 - [x] Write Examples and Tutorials 107 - [x] Helper functions for dependency injection 108 - [ ] Update constructors to use full name (breaks backward compatibility) 109 - [ ] implement RAFT enabled store