Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Piotr Gankiewicz
    @spetz
    Would you like to have an async integration & local data (so no temporal coupling, internal calls etc.) but sacrifice the possible data consistency, or the other way around?
    So for things that dont have to be immediately consistent, like facebook likes and such that makes sense
    But when you think about things like "storing the information about patients injection" in the medical system, you'd probably prefer immediate consistency instead of eventual
    In your scenario, when you add a new microservices to the overall solution, it's quite often, that for the first time, you need to initialize your local data, given that you actually have your "local copies" of the data coming from other services
    whether via HTTP or some other methods, that's what you'd do only once at the beginning
    or you could skip that part, and just change the event handler behaviors into the following: DiscountCreated -> Find the customer in Local DB -> IF NOT exists -> Call customers service -> Save into Local DB -> Apply Discount
    hope that helps, feel free to ask :)
    Anders Wiberg Olsen
    @algorythm

    @spetz Thanks for your reply. Your last solution was my initial thought too. To sort of using the local database as a cache for faster lookups, though you'd still have the risk of the customer being removed. I guess for discounts it wouldn't matter much, except for the fact you would take up storage for unsued data. I guess when the coupling between two entities have to be ensured, you are required to check up with the other service every time.

    For your Facebook like example. I guess you'd still want the data to be reflected immidiately for the user's perspective in order to not confuse the user, when it then looks like he haven't liked a post when he infact already have. The user would probably try to like the post again, in which shouldn't be a problem if the endpoint is idempotent, however seen from the user's perspective, the platform feels slow / broken

    Piotr Gankiewicz
    @spetz
    Speaking of FB likes, or Tweeters likes, Reddits votes, etc. - but that's how it works, even with comments the same happens. Most of the time, the data is there, and it's consistent very fast, but sometimes, you might see different numbers and its totally fine, since it's not that relevant, and most users are not really aware of what's going on under the hood. It's definitely not broken, it just takes some delta(t) to reflect the final results :) which is why it's very important to discuss the data consistency with the business people, as its really their responsibility to define what could be eventually consistent.
    The customer being removed - at first, you need to also subscribe CustomerRemoved event, and even if there's some incosistency, it still shouldn't matter, cause you won't be able to apply the discount, since the customer no longer exists in the customers' microservice being the only source of truth.
    Anders Wiberg Olsen
    @algorythm
    This message was deleted
    So in other words, it it's decided that data must be consistent between two entities in separate services, we need to either make a tight coupling between these services by making the HTTP request, or have a background service that synchronizes data? I'm just curious how I'd implement it the best way if it came to it
    Piotr Gankiewicz
    @spetz
    I probably wouldnt use the background service, just call the other app if immediate consistency is required (and yes, thats a temporal coupling, but can be done with HTTP, gRPC etc.), but its really something that needs to be discussed as part of business requirements :)
    Piotr Gankiewicz
    @spetz
    Also, when talking about consistency - it's usually a good practice to keep the version number within your entities (aggregate roots) since it might happen that within an event you received the data related to the version X, while after fetching the data via HTTP call it might be already in version X+1
    Roman Marusyk
    @Marusyk

    Hi guys,
    I have a question about secretKey value from appsettings.json jwt section ("secretKey": "JLBMU2VbJZmt42sUwByUpJJF6Y5mG2gPNU9sQFUpJFcGFJdyKxskR3bxh527kax2UcXHvB").

    Could you please suggest how did you generate this key?

    Piotr Gankiewicz
    @spetz
    you could generate a key e.g. with pwd command or some online tools such as https://passwordsgenerator.net/
    you could also generate a private key in a hex format using crypto libraries like BouncyCastle
    Roman Marusyk
    @Marusyk
    thank you, but what did you use?
    in your case, is it just randon characters and numbers?
    Piotr Gankiewicz
    @spetz
    I think it could be the beforementioned website
    Sebastian
    @vuchl
    Is Convey .NEt Core 3.1 compatible?
    Piotr Gankiewicz
    @spetz
    We will update it to 3.1 in the upcoming days
    Sebastian
    @vuchl

    I get an
    "System.ArgumentOutOfRangeException: "startIndex cannot be larger than length of string. "

    When my App name contains a dot

    "app": {
        "name": "ERP.OrdersService",
        "displayBanner":  true
      }
    Piotr Gankiewicz
    @spetz
    without it works just fine?
    If you set displayBanner false will it also work?
    Could be an issue with FiggleFont
    Sebastian
    @vuchl
    yeah it depends on the displayBanner setting
    adding a dot and not displaying the banner is one way or removing the dot and having the banner
    but I like the banner
    Piotr Gankiewicz
    @spetz
    Ok, so the dot breaks the things, will check it out
    Sebastian
    @vuchl
    :thumbsup:
    what object mapper would you recommend when dealing with non-english db entities? I would like to map Db entities to english DTOs
    Piotr Gankiewicz
    @spetz
    Do you mean globalization / translation?
    Sebastian
    @vuchl
    not really
    Piotr Gankiewicz
    @spetz
    Could you explain a little bit?
    BTW just checked it out, turns out that an upper case character dot breaks the banner
    e.g. ERp.OrdersService is fine, but erP.OrdersService not
    so uppercase + dot = error
    Sebastian
    @vuchl

    let's say I have a german db table staedte

    ref | num | text
    ---------------
      1 | A01 | Kiel
      2 | A02 | Bonn

    And I would tro fransform that to entities like

    class City {
      public int Id {get; set;}
      public string Code  {get; set;}
      public string Name {get; set;}
    }

    And later

    class CityDto {
      public string Code  {get; set;}
      public string Name {get; set;}
    }
    My Domain model would be the table blue print. but the DTOs would be in English
    Funny thing with the upper case + dot
    what is the reasoning behid that?
    Sebastian
    @vuchl
    I setup a convey webapi. my service has 1 route. I added Swagger like in the docs with redoc
    I can see my route in there
    how can I add a summary and some more information?
    I use CQRS query and Query handler
    Piotr Gankiewicz
    @spetz
    I'd define these mappings in Infrastructure layer, either as fluent api or other type of mapping depending on ORM
    dot issue - no idea, has to be something wrong with Figgle Font library
    Speaking of Swagger, normally you would use e.g. [Produces] attribute etc. https://docs.microsoft.com/pl-pl/aspnet/core/tutorials/getting-started-with-swashbuckle?view=aspnetcore-3.1&tabs=visual-studio but I'm not sure yet about the routing