h1. Request Details
h2. Background
We will have two new accommodation affiliation partners: Ctrip (#1 Chinese OTA) and Fliggy (Alibaba's rapidly growing online travel platform)
As inbound traffic from China to Southeast Asia is massive (~USD 7-8 billion accom spending per annum) and growing at a rapid pace, the potential value from these 2 partnerships is expected to be significant (est. 1st year GBV contribution; ~USD 50M)
Ctrip have a standard API that we should follow in order to connect with them. For now, we already have APRAFSA as a service to handle search API. All the logic, validation, and tracking are stored in this layer. When ctrip comes, we need to create a separate api because they have different API format. There are many similar function and logic that can be used by both CTRIP and existing affiliate that can make many duplication in our code. To handle this, we decide to take out all the common logic and function from APRAFSA (leaving only tracking process related), and move it to a new layer called APRAFS.
For FLIGGY, althought we dont need to create a separated API for them, we still need some adjustment in our service to support their commission system (that might be similar with other affiliate too).
We planned to have a soft launch on 3rd Sept with CTRIP and on third week of Sept for Fliggy.
We want to go live before the golden week (1st oct) in order to know how much traffic we can get from CTRIP at peak season. To achieve this we need already open our API to ctrip 2-3 weeks before that. So we plan to do the soft launch on 3rd September.
We will also open our hotel to CTRIP gradually. This will make sure the stability on our internal service in case traffic from CTRIP is too high.
h2. Purpose
To handle common function and logic used by all affiliate API. So, if there are changes in the existing search process, the api layer will not be affected directly. With this we also support our system toward microservices.
h2. Impact
With CTRIP connect with us, we can expand our affiliation partner in China. This can bring us a bunch of new customer and revenue as well, since CTRIP has a very good market in there.
h2. Risk
Expect a slight increase in search latency since we add some new layer between API and HINV.
There will be additional load in the internal service and database that will be called by this service, such as hinv, aprnes, aprhd, ne, etc.
This service also still need dependency to old servcice, ne-app. Because some of the inner service such as 'HotelAPIHelperServiceImpl' still need to retrieve hotelAssetData
from it and this service is still embedded in some of existing API.
This service also need to connect to db directly such as data-mongod to get affiliateMasterData
and to hdata-mongod to get 'priceFilterData' and 'hotelUrgencyData'.
her
Traffic estimation:
Incoming Request:
Average : ~110 qps
Peak : ~140 qps
h3. EC2
h4. Configuration
{code}
count = "2"
instance_type = "m4.large"
ebs_optimized = "false"
disable_api_termination = "false"
root_block_device = {
volume_type = "gp2"
volume_size = "8"
delete_on_termination = "true"
}
tags = {
Service = "aprafs"
Cluster = "aprafs-app"
ProductDomain = "apr"
Application = "java-7"
Environment = "production"
Description = "Accomodation Product Affiliation Search"
}
{code}
h3. ALB
h4. Configuration
{code}
name = "aprafs-lbint-01"
security_groups = "aprafs-lbint"
internal = "true"
idle_timeout = "60"
enable_deletion_protection = "false"
tags = {
Name = "aprafs-lbint-01"
Service = "aprafs"
ProductDomain = "apr"
Environment = "production"
Description = "Application Load Balancer for Accomodation Product Affiliation Search"
}
{code}
h4. Listener
{code}
port = "443"
protocol = "HTTPS"
default_action {
target_group_arn = "aprafs-app"
type = "forward"
}
{code}
h4. Target Group
{code}
name = "aprafs-app"
port = "61066"
protocol = "HTTP"
deregistration_delay = "300"
tags = {
Name = "aprafs-app"
Service = "aprafs"
ProductDomain = "apr"
Environment = "production"
Description = "Target Group for Accomodation Product Affiliation Search"
}
health_check = {
interval = "10"
path = "/healthcheck"
port = "traffic-port"
protocol = "HTTP"
timeout = "5"
healthy_threshold = "5"
unhealthy_threshold = "2"
matcher = "200"
}
{code}
h4. DNS Record
aprafs.main.tvlk.cloud
h3. Connectivity
https://docs.google.com/spreadsheets/d/1Ian0EUhQY8KG5WhzD9_hccmYpZPvgVk1DhsTuTcRLRU/edit#gid=0
h4. Rules
SourceId Destination from_port to_p
aprafsa-app aprafs-lbint 443
aprafs-lbint aprafs-app 61066
aprafs-app aprafsd-memcached 11211
aprafs-app data-mongod 27017
aprafs-app hdata-mongod 27017
aprafs-app aprhd-lbint 443
aprafs-app ne-app 61004
aprafs-app trpdata-lbint 443
aprafs-app contentapp-lbint 443
aprafs-app hinv-lbint 443
aprafs-app aprnes-lbint 443
aprafs-app locgs-lbint 443
aprafs-app prp-lbint 443