Comments (1)
In the NF examples, some functions, such as VerifyAccount, accept only the string strAccount, and not
strAccount + "_AccountInfo "
----------------Just a name to remember it easier, you can change as you like.
virtual NFListstd::string GetDriverIdList() = 0;
virtual NF_SHARE_PTR GetDriver(const std::string& strID) = 0;
virtual NF_SHARE_PTR GetDriverBySuitRandom() = 0;
virtual NF_SHARE_PTR GetDriverBySuitConsistent() = 0;
virtual NF_SHARE_PTR GetDriverBySuit(const std::string& strHash) = 0;
Imagine that you want to create a scalable database backend with "n" database servers for your application or a distributed system with a cluster of servers. To meet the goal we would meet the rules below:
a. We should be able to distribute the incoming queries uniformly among the set of "n" database servers
b. We should be able to dynamically add or remove a database server
c. When we add/remove a database server, we need to move the minimal amount of data between the servers
//get redis driver by consistent hashing, normally we use this one
virtual NF_SHARE_PTR<NFIRedisClient> GetDriverBySuitRandom() = 0;
//some special features that we want the data away store in a special database we use this one
virtual NF_SHARE_PTR<NFIRedisClient> GetDriverBySuitConsistent() = 0;
//get redis driver by the hash value that you pass
virtual NF_SHARE_PTR<NFIRedisClient> GetDriverBySuit(const std::string& strHash) = 0;
References below:
https://www.acodersjourney.com/system-design-interview-consistent-hashing/
https://en.wikipedia.org/wiki/Consistent_hashing
from noahgameframe.
Related Issues (20)
- Where can I find / place matchmaker plugin? HOT 4
- CUP 占用率异常 HOT 2
- NFWSModule::AddReceiveCallBack 绑定的pb消息回调无法触发 HOT 2
- Not building for Windows HOT 2
- Cant run cmake.... HOT 7
- 有没有打算做一个UE4的客户端 HOT 1
- does this wonderful framework support seemless big world like wow? HOT 1
- Compile error in dev studio 2019 HOT 2
- vs2019 编译错误 HOT 2
- VS2019 can't build with lua error HOT 4
- Make a game like bomberman clone HOT 3
- 祝安好! 好走!
- 一切安康,好走,天堂上有美丽的大海,有你梦想中的小船。 HOT 7
- God wanted to understand this framework, so he was invited
- 2021.7.9 在新西兰奥克兰的一场车祸中,ketoo 永远离开了我们。 HOT 2
- 走好,RIP。 逝者已矣,生者如斯,目前已发起对Ketoo家庭的援助,望大家伸出援手。Donations is needed to support Ketoo's family. HOT 9
- Anybody will continue Ketoo's work on "blueprint" Branch? HOT 1
- How to add a new project in NFExamples folder? HOT 2
- 这个框架当前还维护么? HOT 2
- 逻辑线程是单线程的情况下,io建议考虑使用非阻塞来提高吞吐量
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from noahgameframe.