what we have learned about api scaling throughout messente's international sms traffic growth
TRANSCRIPT
![Page 1: What we have learned about API scaling throughout Messente's international SMS traffic growth](https://reader031.vdocuments.mx/reader031/viewer/2022021917/589d1aa21a28ab61128b64e7/html5/thumbnails/1.jpg)
What we have learned about
API scaling throughout Messente's
international SMS traffic growth
![Page 2: What we have learned about API scaling throughout Messente's international SMS traffic growth](https://reader031.vdocuments.mx/reader031/viewer/2022021917/589d1aa21a28ab61128b64e7/html5/thumbnails/2.jpg)
Build Working Product• SMS Sending API
• Delivery Report API
• Backend services
• Public website
• Admin interface
![Page 3: What we have learned about API scaling throughout Messente's international SMS traffic growth](https://reader031.vdocuments.mx/reader031/viewer/2022021917/589d1aa21a28ab61128b64e7/html5/thumbnails/3.jpg)
22,5
45
67,5
90
2011 2012 2013 2014 2015 2016
![Page 4: What we have learned about API scaling throughout Messente's international SMS traffic growth](https://reader031.vdocuments.mx/reader031/viewer/2022021917/589d1aa21a28ab61128b64e7/html5/thumbnails/4.jpg)
SMS Sending API$ curl 'https://messente.com/api/send_sms/' \-d 'user=hnoac48nta938ynvas039n04972' \-d 'api_key=023fjhwlekhf023ihf2poi3hf23' \-d 'from=Test' \-d 'to=%2B37251916062' \-d 'text=Hi+There!' \-d 'dlr_url=http%3A%2F%2Fmyshop.com%2Fmessente-dlr%2F'
OK slkdlskndflkdnflksdnflksdnl 0.056
ERROR 101ERROR 102....
![Page 5: What we have learned about API scaling throughout Messente's international SMS traffic growth](https://reader031.vdocuments.mx/reader031/viewer/2022021917/589d1aa21a28ab61128b64e7/html5/thumbnails/5.jpg)
Delivery Report Requesthttp://myshop.com/messente-dlr/?message_unique_id=slkdlskndflkdnflksdnflksdnl&status=DELIVERED
![Page 6: What we have learned about API scaling throughout Messente's international SMS traffic growth](https://reader031.vdocuments.mx/reader031/viewer/2022021917/589d1aa21a28ab61128b64e7/html5/thumbnails/6.jpg)
SMS Sending API• connect to database
• validate account credentials
• validate sender name
• determine country and operator
• calculate the message price
• account crediting
• unique message ID generation
• save all this data to database
![Page 7: What we have learned about API scaling throughout Messente's international SMS traffic growth](https://reader031.vdocuments.mx/reader031/viewer/2022021917/589d1aa21a28ab61128b64e7/html5/thumbnails/7.jpg)
SMS Sending API• connect to database
• validate account credentials
• validate sender name
• determine country and operator of the number
• determine the message price
• account crediting
• unique message ID generation
• save all this data to database
![Page 8: What we have learned about API scaling throughout Messente's international SMS traffic growth](https://reader031.vdocuments.mx/reader031/viewer/2022021917/589d1aa21a28ab61128b64e7/html5/thumbnails/8.jpg)
SMS Sending API$ curl 'https://messente.com/api/send_sms/' \-d 'user=hnoac48nta938ynvas039n04972' \-d 'api_key=023fjhwlekhf023ihf2poi3hf23' \-d 'from=Test' \-d 'to=%2B37251916062' \-d 'text=Hi+There!' \-d 'dlr_url=http%3A%2F%2Fmyshop.com%2Fmessente-dlr%2F'
OK slkdlskndflkdnflksdnflksdnl 0.056
bottleneck
![Page 9: What we have learned about API scaling throughout Messente's international SMS traffic growth](https://reader031.vdocuments.mx/reader031/viewer/2022021917/589d1aa21a28ab61128b64e7/html5/thumbnails/9.jpg)
“Build now. Scale later.”
![Page 10: What we have learned about API scaling throughout Messente's international SMS traffic growth](https://reader031.vdocuments.mx/reader031/viewer/2022021917/589d1aa21a28ab61128b64e7/html5/thumbnails/10.jpg)
SMS Sending API - v2$ curl 'https://api2.messente.com/send_sms/' \-d 'username=hnoac48nta938ynvas039n04972' \-d 'password=023fjhwlekhf023ihf2poi3hf23' \-d 'from=Test' \-d 'to=%2B37251916062' \-d 'text=Hi+There!' \-d 'dlr_url=http%3A%2F%2Fmyshop.com%2Fmessente-dlr%2F'
OK slkdlskndflkdnflksdnflksdnl
bottleneck
![Page 11: What we have learned about API scaling throughout Messente's international SMS traffic growth](https://reader031.vdocuments.mx/reader031/viewer/2022021917/589d1aa21a28ab61128b64e7/html5/thumbnails/11.jpg)
Delivery Report Requesthttp://myshop.com/messente-dlr/?message_unique_id=slkdlskndflkdnflksdnflksdnl&stat=DELIVRD&err=000
error parameter added
![Page 12: What we have learned about API scaling throughout Messente's international SMS traffic growth](https://reader031.vdocuments.mx/reader031/viewer/2022021917/589d1aa21a28ab61128b64e7/html5/thumbnails/12.jpg)
SMS Sending API - v2• extremely fast API response
• handle hundreds of req/sec
• return error codes asynchronously
• offloaded processing to backend service
![Page 13: What we have learned about API scaling throughout Messente's international SMS traffic growth](https://reader031.vdocuments.mx/reader031/viewer/2022021917/589d1aa21a28ab61128b64e7/html5/thumbnails/13.jpg)
SMS Processing FlowClient
Messente HTTP API
Operator
Messages Queue
Backend Service
![Page 14: What we have learned about API scaling throughout Messente's international SMS traffic growth](https://reader031.vdocuments.mx/reader031/viewer/2022021917/589d1aa21a28ab61128b64e7/html5/thumbnails/14.jpg)
Backend Service - v2• determine the country &
operator
• check the roaming and portability information from HLR service
• determine the route
• calculate the price of the message
• credit account
• check for number in blacklist
• verify sender name
• auto-convert text if required
• update statistics
• save message to database
![Page 15: What we have learned about API scaling throughout Messente's international SMS traffic growth](https://reader031.vdocuments.mx/reader031/viewer/2022021917/589d1aa21a28ab61128b64e7/html5/thumbnails/15.jpg)
Backend Service - v2• determine the country &
operator
• check the roaming and portability information from HLR service
• determine the route
• calculate the price of the message
• credit account
• check for number in blacklist
• verify sender name
• auto-convert text if required
• update statistics
• save message to database
![Page 16: What we have learned about API scaling throughout Messente's international SMS traffic growth](https://reader031.vdocuments.mx/reader031/viewer/2022021917/589d1aa21a28ab61128b64e7/html5/thumbnails/16.jpg)
SMS Processing FlowClient
Messente HTTP API
Operator
Messages Queue
Backend Daemon
![Page 17: What we have learned about API scaling throughout Messente's international SMS traffic growth](https://reader031.vdocuments.mx/reader031/viewer/2022021917/589d1aa21a28ab61128b64e7/html5/thumbnails/17.jpg)
SMS Processing FlowClient
Messente HTTP API
Backend Daemon
Operator
Messages Queue
Backend DaemonBackend Daemon
![Page 18: What we have learned about API scaling throughout Messente's international SMS traffic growth](https://reader031.vdocuments.mx/reader031/viewer/2022021917/589d1aa21a28ab61128b64e7/html5/thumbnails/18.jpg)
SMS Processing FlowClient
Messente HTTP API
Backend Daemon
Operator
Messages Queue
Backend DaemonBackend DaemonBackend Daemon
Backend Daemon
Backend DaemonBackend Daemon
Backend Daemon
Backend Daemon
![Page 19: What we have learned about API scaling throughout Messente's international SMS traffic growth](https://reader031.vdocuments.mx/reader031/viewer/2022021917/589d1aa21a28ab61128b64e7/html5/thumbnails/19.jpg)
SMS Processing FlowClient
Messente HTTP API
Operator
Messages Queue
SMS Processing Pipeline
![Page 20: What we have learned about API scaling throughout Messente's international SMS traffic growth](https://reader031.vdocuments.mx/reader031/viewer/2022021917/589d1aa21a28ab61128b64e7/html5/thumbnails/20.jpg)
SMS Processing PipelineSMS
Determine Operator & MNP
Pricing & Account Crediting
Validator
Send SMS to Operator
Statistics
![Page 21: What we have learned about API scaling throughout Messente's international SMS traffic growth](https://reader031.vdocuments.mx/reader031/viewer/2022021917/589d1aa21a28ab61128b64e7/html5/thumbnails/21.jpg)
SMS Processing PipelineSMS
Determine Operator & MNP(Multi-threaded HLR service)
Pricing & Account Crediting
Validator
Send SMS to Operator
Statistics
![Page 22: What we have learned about API scaling throughout Messente's international SMS traffic growth](https://reader031.vdocuments.mx/reader031/viewer/2022021917/589d1aa21a28ab61128b64e7/html5/thumbnails/22.jpg)
Handling Database Size Growth
Multiple GB of data added every month
![Page 23: What we have learned about API scaling throughout Messente's international SMS traffic growth](https://reader031.vdocuments.mx/reader031/viewer/2022021917/589d1aa21a28ab61128b64e7/html5/thumbnails/23.jpg)
Handling Database Size Growth
SMS DLR
![Page 24: What we have learned about API scaling throughout Messente's international SMS traffic growth](https://reader031.vdocuments.mx/reader031/viewer/2022021917/589d1aa21a28ab61128b64e7/html5/thumbnails/24.jpg)
Handling Database Size Growth
SMS_2016_01 DLR_2016_01
SMS_2015_12 DLR_2015_12
SMS_2015_11 DLR_2015_11
![Page 25: What we have learned about API scaling throughout Messente's international SMS traffic growth](https://reader031.vdocuments.mx/reader031/viewer/2022021917/589d1aa21a28ab61128b64e7/html5/thumbnails/25.jpg)
Handling Database Size Growth
SMS DLR
ARCHIVE_2016_01
ARCHIVE_2015_12
ARCHIVE_2015_11
![Page 26: What we have learned about API scaling throughout Messente's international SMS traffic growth](https://reader031.vdocuments.mx/reader031/viewer/2022021917/589d1aa21a28ab61128b64e7/html5/thumbnails/26.jpg)
Backup Servers• Multiple API nodes
• api2.messente.com
• api3.messente.com
• Database Replication
• Server monitoring
![Page 27: What we have learned about API scaling throughout Messente's international SMS traffic growth](https://reader031.vdocuments.mx/reader031/viewer/2022021917/589d1aa21a28ab61128b64e7/html5/thumbnails/27.jpg)
Quick Takeaways• Don't be afraid to scale later
• API will evolve - be prepared to handle different versions
• Always have a backup