Giter Club home page Giter Club logo

Comments (2)

JamesChenX avatar JamesChenX commented on September 25, 2024

These are good questions, and I will write a detailed doc for them later (not that quickly as I am busy).

Does this mean that Redis must be persisted instead of just using Redis as a temporary cache?

Yes. Turms servers need Redis to persist data, e.g. share the information of online sessions in the cluster.
You can uncomment the following lines to support data persistence in docker-compose.standalone.yml:

#    volumes:
#      - "./redis/data:/data"

Note that Turms servers are design to try to recover from any disaster, which means even if Redis servers crash and lose all data, Turms servers will try to register all online sessions into Redis again.

I also saw that ShardingAlgorithm is sharding based on user ID.

The ShardingAlgorithm is mainly designed for Turms to work with multiple Redis clusters (Yes, I mean Redis clusters, not Redis instances), so you don't need to consider it until one robust Redis cluster is not enough for your use cases.

If my Redis is a single node in the early stage and a cluster is built later, do I need to design a migration strategy?

Redis has its own migration strategy, and Turms isn't special and has nothing to do with it.
So you can search something like Redis migrate from one instance to cluster on the Internet, and they should work for Turms too as Turms servers are not special.

btw, if you use Redis server from cloud providers, they should provide related migration guide for users. If not, you need to consider whether these cloud providers are professional and worthy to try.

Or I can only use the master-slave mode, always exposing only one node to Turms?

Yes. Turms are designed for extreme cases, and that's why Turms servers support working with multiple Redis clusters, but it's recommended to use only one Redis instance, or one Redis cluster (you can configure Turms servers to work with the master node) at first.

Does this mean that if I need to expand the Mongo cluster later, I don't need to pay attention to the business logic like Redis and just operate the Mongo cluster directly?

Turms is not special, and when you scale MongoDB cluster, you need to do nothing with Turms servers and Redis servers.

btw, scaling MongoDB cluster is quite easy, and you just input one command in fact, e.g.: sh.addShard("rs1/mongodb0.example.net:27018"). That's also why I like to cooperate with MongoDB because of their professional skills.

Reference: Add Shards to a Cluster

from turms.

FantaZZ avatar FantaZZ commented on September 25, 2024

Thanks for your answer.

from turms.

Related Issues (20)

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.