Git Product home page Git Product logo

Comments (6)

StarpTech avatar StarpTech commented on May 26, 2024 1

At first I recommend you to get familiar with NATS https://nats.io/documentation/
NATS is pub/sub system. In hemera every service is located by his topic name. If you want provide a service with different versions you can represent it with the topic name

On service level:

hemera.add({ topic: "math:v1.0" })

or with a wildcard

hemera.add({ topic: "math:v1.*" })

Wildcards in Nats: https://nats.io/documentation/internals/nats-protocol/

On application level

You can also express you different version with a different pattern so that your service is always accessible via the same topic. I prefer this solution because you have the most flexbility and less effort but this orientates on the complexity of both versions.

hemera.add({
topic: "math",
cmd:" add", 
version: "1"
})

or with regex

hemera.add({
topic: "math",
cmd:" add", 
version: /1\.[0-9]/
})

On server level

E.g different regions should only have access to api version 1.0. You can connect those clients with a different NATS server which exposed a restricted set of services. After a certain period of time you can also combine both server to a cluster. This use case is very special but possible.

You have three options how to deal with versioning.

from hemera.

StarpTech avatar StarpTech commented on May 26, 2024

One way is to archive it with a suffix in the topic name e.g

topic:math:v1

or in the pattern of your Server Methods

{
topic: "math",
cmd:" add", 
Version: "1"
}

or you have different NATS Server for different API Version.

from hemera.

StarpTech avatar StarpTech commented on May 26, 2024

It's up to the use case.

from hemera.

pocesar avatar pocesar commented on May 26, 2024

right now I use semver for services (without the patch), and my service locator can deal with version pinning or version ranges, like '<=1.1' or '^1.1', so, asking for a version '^1.0' would yield access to any available 1.0 and 1.1 versions, could this be done?

just to explain why I use semver, since minor versions are backward compatible always, I can use blue/green without having to worry older services breaking when 1.0 goes offline and replaced by 1.1 for example

from hemera.

StarpTech avatar StarpTech commented on May 26, 2024

I will update the docs with this topic

from hemera.

StarpTech avatar StarpTech commented on May 26, 2024

Update the docs I close this issue.

from hemera.

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.