Best practices: Optimization

To improve the performance of the Member Data Service, keep the following optimization considerations in mind.

Persist mapping of email Member ID in integration flow

Within the flow of your integration, maintain a map of email addresses to memberid values. This saves time on checking to see if a member exists when there is a match based on previously processed data. Saving this lookup to the Member Data Service can greatly reduce overall processing overhead.

Maintain information within the integration flow

Maintain sufficient information within the integration flow to identify when the source information has changed.

This is pertinent when there is a straight poll of the full current data from the source system. If the source system is providing incremental changes, then this will not be helpful or necessary.

When the source information Then
Has changed It needs to be pushed through to the Member Data Service.
Has not changed You will not have to look up the current values.

GET current Member Values for several members at a time

Use a comma-separated list of Member IDs to get the latest information for several members at a time. This will improve efficiency in calling the Member Data Service, but adds complexity in the integration code.

The maximum number of members and Member Variables to request in one call will be limited by URL length restrictions and hence cannot include all members and all Member Variables.

The following example shows a request for 6 members and 3 member variables.

Example

GET /membervalues/asof/9999?memberId=14dfcbeb-b17a-464b-8372-a62c0065a966,96689e68-f64b-42de-a8c6-7e134f490f16,
89cd8c9f-f8de-4437-a8fe-da67c91bed25,499c58ed-3ba9-46c6-966a-4dac2046642e,a3ed0364-4d7b-4609-9507-c983393b0486,
6ba974fd-4f41-4c24-ae8d-0ca9432a02c5&membervariableid=bc55aa95-2a7f-4d75-86b4-a3780118a164,
c5b4fa16-5198-415e-a668-a3780118a070,4f0a5783-8529-4227-94f2-a3780118a106,7a579823-74dd-4a0b-886ea3780118a143&
fields=memberId,memberVariableId,memberVariableValue,effectiveDate

POST new Member Values in batches

Build a set of Member Values and post them together in batches rather than one at a time. The recommended maximum number of Member Values to POST in one call is 500.

Example

Request URL:


POST /membervalues

Request Body:


[
   {
      "memberVariableId": "bc55aa95-2a7f-4d75-86b4-a3780118a164",
      "memberDataSetType": "Live",
      "memberId": "14dfcbeb-b17a-464b-8372-a62c0065a966",
      "memberVariableValue": "Partner"
   },
   {
      "memberVariableId": "bc55aa95-2a7f-4d75-86b4-a3780118a164",
      "memberDataSetType": "Live",
      "memberId": "96689e68-f64b-42de-a8c6-7e134f490f16",
      "memberVariableValue": "Advertisement"
   },
   {
      "memberVariableId": "4f0a5783-8529-4227-94f2-a3780118a106",
      "memberDataSetType": "Live",
      "memberId": "a3ed0364-4d7b-4609-9507-c983393b0486",
      "memberVariableValue": "New York"
   }
]

Look up Member Variable Value IDs for choice variables

When the Member Variable involves a closed set of possible options (for example, type: "singleChoice" or type: "multiChoice") it is more efficient to pre-create / pre-fetch Member Variable Values and then specify those values in the POST calls to create Member Values.

Example: Pre-fetch Member Variable Values

Request URL:


GET /membervariablevalues?memberVariableId=bc55aa95-2a7f-4d75-86b4-a3780118a164&key=partner

Response Content:


{
   "meta": {
      "offset": 0,
      "limit": 20,
      "count": 1
   },
   "items": [
      {
         "id": "5454233f-a6f3-448b-bff0-a62c006c41b2",
         "memberVariableId": "bc55aa95-2a7f-4d75-86b4-a3780118a164",
         "sequenceId": 47679240,
         "key": "partner",
         "description": "",
         "order": -1,
         "value": "Partner",
         "constraints": {
            "disabled": false,
            "hidden": false
         },
         "createDate": "2016-06-21T06:34:08.9527013Z",
         "lastUpdateDate": "2016-06-21T06:34:08.9527013Z",
         "createdBy": "400e61d0-6f4a-48da-859c-a1e3017110de",
         "lastUpdatedBy": "400e61d0-6f4a-48da-859c-a1e3017110de",
         "links": [],
         "href": "https://api.{region}.alida.com/v1/applications/{communityId}/membervariablevalues/5454233f-a6f3-448b-bff0-a62c006c41b2"
      }
   ],
   ...
}
Example: Create Member Values

Request URL:


POST /membervalues

Request Body:


{
   "memberVariableId": "bc55aa95-2a7f-4d75-86b4-a3780118a164",
   "memberDataSetType": "Live",
   "memberId": "14dfcbeb-b17a-464b-8372-a62c0065a966",
   "memberVariableValueId": "5454233f-a6f3-448b-bff0-a62c006c41b2"
}