locked
boundary between services RRS feed

  • Question

  • Hello,

    I have a simple question to ask, but I do not find any tutorial or subjects on this topic.
    Let's take an example where you have 2 services providing 2 specific business, and you are willing to clearly separate these business even in the relationnal database.
    One service could be a "Customer service" that will handle the customer creation for instance.
    It can be used from a FrontOffice reception in order to register the customers.

    Now you want to invest in Marketing, so you buy another module that is deployed as a Service: "Marketing Service".
    With it, you can for instance give "points" to your best customers (that they could exchange against gifts", you can also create campaigns with a substet of your customers, you can also associate a "customer level" (like GOLD SILVER and so on) to each customer according to the number of points they win and so on.
    This service can be used by a BackOffice Marketing Management application.

    Each service has its own data model in the DB, one for the Marketing, one for the Customers.
    The Marketing datamodel is a kind of extension of the customer datamodel.
    Applications are rich client applications connected to services.

    Now start the very basics questions (I am looking for the best patterns):
    1) in which  datamodel shall be stored the "Customer Level"?
    => Is it:
        a) the Customer that is linked to a "customer level" in the Customer DataModel
        b) or a Customer Level that is linked to a list of customers in the Marketing DataModel?
    From a performance point of view, we could vote A, but if we want to define a clear border between the business, it shall be B right? The Customer datamodel has nothing to do with the Customer Level as it is a marketing information handled by Marketing rules. Performance are impacted because if I need to get the list of GOLD customers, I have to go throught both services. Let's see the queries problem with the next question below.

    2) if I need a report that shows only GOLD Customer, but only men (not wooman). I need this from the Backoffice application (Marketing Management).
    My application conects to the Marketing service and provides my criteria (GOLD, MEN). How shall I implement the query?
       a) The Marketing service does the whole query in the DB (in its own datamodel in order to know which customer is GOLD and in the Customer datamodel in order to know who is men and their name in order to dispaly the list of customers)
       b) The "Marketing service" gets the list of GOLD customers from its own datamodel, then it sends this list to the "Customer service" and request this service to return only men from the list with more information (like the name). Then only the "Marketing can return the list to the application.
    => Advantage of option A is performance, but there is no border. The Marketing is directly getting data in the Customer dataModel
    => Advantage of option B is the clear border between the services, each business retreives the customers accordig to its responsibility

    WHat is your opinion in a kind of SOA? 
    The idea is to prevent a service to do a query in a datamodel that is not its own datamodel.
    Maybe one option could be the creation of a view sharing all the data? This view could be used by both data...

    Where can I find tutorials or any thread on this topics??

    thanks for your help
    Rod

    Thursday, March 4, 2010 3:47 PM

All replies

  • Hi Webrod,

    I will try and answer this to the best of my knowledge and how I would implement this.

    * though the marketing module is the front end for giving out the gifts and points, it would at the end of the day need a customer object\data reference. I would incline towards storing this in the customer DB and add an operation on the customer service to assign points. Some of the advantages I can see are

    * If tomorrow, another module needs access, then it is easily extensible
    * You put it forward perfectly. A reporting module need not be dependent on marketing
    * By putting this in customer module, I would not be duplicating the data model
    * In terms of SOA, you do process de-composition and component de-composition precisely for this.

    Do let me know if you need any further clarifications

    HTH
    Technocrat_aspire
    Thursday, March 4, 2010 5:41 PM
  • Hello,

    thanks for your answer.

    Just to be sure to understand.
    Which information would you exactly put in the Customer datamodel and in the Marketing datamodel?
    Do you only speak about the "Customer Level" that shall be in the Customer datamodel, or also all the Marketing information like "Number of points" and so on?

    Thx
    Rod

    Friday, March 5, 2010 7:49 AM