h1. Request Details
h2. Background
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.
h2. Purpose
h2. Impact
We can sell our inventories to our 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)
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 for CTRIP and third week of Sept for Fliggy.
Failing to deliver this service on time will cost several aspect as below :
h2. Risk
data-mongod
to get affiliateInfo
data and to hdata-mongod
to get priceFilter
data.
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-<random_id>"
security_groups = "aprafs-lbint"
internal = "true"
idle_timeout = "60"
enable_deletion_protection = "false"
tags = {
Name = "aprafs-lbint-<random_id>"
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-<random_id>"
port = "61066"
protocol = "HTTP"
deregistration_delay = "300"
tags = {
Name = "aprafs-app-<random_id>"
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 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