﻿ Best Practices for Scaling with Messaging Services - Twilio


Rate this page:

Best Practices for Scaling with Messaging Services

When you’re ready to scale messaging for your application, you should keep a few best practices and key questions in mind as you build and work with Twilio.

This guide presents common use cases and location-specific complexities that can affect your messaging application. Knowing how, where, and to whom you plan to send messages will help you avoid some common pitfalls while scaling.

Use a Messaging Service to send messages

Perhaps you built out your messaging application’s proof of concept by sending messages from a single long-code phone number. However, as you scale, your application may rely on different types of senders, such as short codes, Alpha Sender ID, WhatsApp senders, and phone numbers. You will also want to use features such Advanced Opt-Out for compliance management and Smart Encoding to catch those segment-gobbling Unicode symbols.

Intrigued? Check out the full list of Messaging Service features.

You can think of a Messaging Service as a container to hold all of your sender IDs and to manage the configuration affecting the delivery of your messages. For example, you could put your short code and local numbers in one Messaging Service sender pool and configure them to point to the same webhook URL to respond to incoming messages. You could also define the same set of Stop words per country for all of the senders in your sender pool using the Messaging Service Advanced Opt-Out feature.

When sending messages from a Messaging Service, you can set the From parameter to your Messaging Service SID, instead of a specific phone number. This not only provides intelligent routing for the senders in your Sender Pool, but also gives you access to the various Messaging Service Features, like Advanced Opt-Out, Sticky Sender, Shortcode Reroute, Smart Encoding and more.


        Figure out which senders work best for your use case

        If your messaging use case is Two-Factor Authentication (2FA) codes, you’ll want to use Authy or Verify, rather than Programmable Messaging.

        Depending on what you build with Twilio Programmable Messaging, you will use a sender as the primary way that customers interact with your business’ application. There are different sender types to choose from:

        • Local and international long code numbers
        • Short code numbers
        • Toll-free numbers
        • Alphanumeric sender IDs
        • WhatsApp senders

        The answers to the following questions will determine what kind(s) of senders you should select and include in your Messaging Service’s Sender Pool.

        1) Are you sending one-way or two-way messages?

        Consider your use case: do you need your recipients to be able to reply to your messages? If so, that is called “two-way messaging."

        More modern messaging channels like WhatsApp, always support two-way messaging. With SMS, however, two-way messaging is not always supported; you’ll need to make sure that you use the correct number type if available or consider an alternative such as WhatsApp.

        Check out our two-way SMS FAQ for more information, or read about WhatsApp here.

        If you only need to send one-way messages to your recipients, you generally have more options for sender types. However, you still should consider the countries to which you are sending and your use case, so read on.

        2) Where are you sending messages?

        Regulations vary by country, so make sure to check out country-specific guidelines for the countries in which you plan to send SMS.

        Not all sender types work in every country, so you should determine in advance where you want to send messages:

        If you’re sending in the US and Canada:

        In the United States and Canada, you can send messages from a few types of numbers.

        • US 10DLC long code phone numbers
        • Canada long code phone numbers (recommended for testing only)
        • Short code phone numbers
        • US (Canada) Toll-Free numbers
        • WhatsApp-enabled numbers

        As of Q3 2021, US carriers are onboarding customers to Long Code 10DLC A2P routes. Canadian mobile carriers forbid sending application-to-person (A2P) messaging using long code phone numbers but US toll free numbers can be used for sending A2P traffic on most Canadian carriers. For a comparison of number types for the US and Canada, see here.

        If you’re sending outside the US and Canada:

        Outside of the United States and Canada, your possible sender types include:

        • Alphanumeric Sender IDs
        • Long code phone numbers
        • Short code phone numbers
        • Toll-free numbers*
        • WhatsApp-enabled numbers

        *Please note that only US (Canadian) Toll-free numbers can send A2P SMS. When sending messages to non-US countries, carriers treat US Toll-Free numbers just like any other non-local long code phone number.

        Consider in-country phone numbers for messaging globally

        In some countries, using a local, familiar phone number can improve the read and response rate of your messages. You may want to add in-country numbers to your Messaging Service for each country you want to send SMS to.

        3) What kind of content are you sending?

        When selecting senders for your Messaging Service, also consider the flow of content that you’ll send to your customers. Message content affects which sender types are available for you to include in your Messaging Service.

        There are two main types of messaging to consider:

        One-way messaging

        Common examples of one-way messaging include marketing messages, delivery alerts and other informational messages.

        If you plan to send one-way traffic through your application, we recommend including the following sender types in your Messaging Service’s Sender Pool:

        • Short Codes
        • Alphanumeric sender IDs
        • Non-local long code numbers
        • Country local long code phone numbers
        • WhatsApp

        Two-way messaging

        Common examples of two-way messaging are chat bots, virtual assistants, and appointment reminders.

        For two-way, back-and-forth messaging, you should include one or more of the following in your Messaging Service’s Sender Pool:

        • Country local long code phone numbers
        • Short codes
        • WhatsApp

        Determine your messaging throughput needs

        Message throughput, measured in MSPS (“Messages Segments per Second”) or often abreviated as MPS, affects which types and how many senders you should add to your Messaging Service’s Sender Pool.

        MPS varies by country and by sender type. In the US, it’s approximately 1 (one) message per second over a regular long code phone number. Outside of the US, it’s typically 10 (ten) messages per second.

        MPS Considerations for the US and Canada

        Using multiple long code or Toll-Free numbers to increase your message throughput to the US or Canada is strongly discouraged as it will result in carrier filtering.

        For the US, you can get a short code number, which can send messages at 100 MPS or more. Or you can use a single Toll-Free number and talk to Sales about upgrading the number for high-throughput of 25+ MPS.

        For Canada, short codes (offering 100+ MPS) and TF are the only permitted ways to send A2P traffic. Using long codes to send A2P messaging traffic will result in increased carrier filtering.

        MPS Considerations for the rest of the world

        Your options for increasing MPS depend on your traffic type (one-way vs. two-way and A2P vs. P2P, discussed above) and the type of sender(s) you’ve decided to use.

        Alphanumeric Sender ID: by default, Alphanumeric Sender ID offers 10 MPS and its use is country specific. To increase MPS on an Alphanumeric Sender ID, talk to Sales or submit a Support request. Include your expected message volume to the country or countries to which you will send messages.

        Long code numbers: by default, long code numbers sending to non-US/Canada countries offer 10 MPS. The MPS on an individual number cannot be increased, but you can add more numbers.

        Twilio has built a highly available, distributed queue, so you don’t have to worry about these limits. Your application can send Twilio’s Programmable Messaging API requests as quickly as you’d like. We’ll queue your messages for you and send them out at the appropriate rate for your senders. This keeps your application in compliance, but this can delay the delivery of your messages.

        To find out more details, read this article about Twilio Rate Limits and Message Queues.

        Use a short code or toll-free number for higher throughput

        We caution against simply adding more long code phone numbers to your Messaging Service’s Sender Pool to distribute the load, a practice known as “snowshoeing.” Instead, consider upgrading to a sender type with higher throughput, such as a toll-free number or short code, if available in your area.

        If you’re in the United States, United Kingdom, or Canada: Apply for a Short Code to take advantage of a higher throughput rate, starting at 100 messages per second. Short codes have the added advantage of carrier pre-approval. This means that they can send much higher volume per day without being subject to filtering in the same way that long code phone numbers are.

        If you’re outside the United States, United Kingdom, and Canada: Add long codes to improve deliverability, even when using short codes in your Messaging Service’s Sender Pool.

        Short codes are broadly supported in the US, Canada, and the UK, but some smaller carriers may not support short code messages. To achieve the highest levels of deliverability you should add a few long codes to your messaging service. In the US and Canada, the Short Code Reroute feature will send from a long code phone number when a short code is not supported.

        Short codes can only be used to send domestic traffic (e.g., Canadian short codes can only send SMS in Canada.). In addition to using short codes, you should add long code numbers if you plan to send international SMS.

        Alphanumeric Sender IDs and Throughput

        If you are using an alphanumeric sender ID, it will take precedence over the other phone numbers in your Messaging Service sender pool, even if it has queued messages. Message delivery does not fall back from alphanumeric sender IDs to the long code phone numbers in your sender pool.

        If you are planning to use an alphanumeric sender ID in a supported country, make sure that you get the right MPS rate for it. You can request higher throughput on your alphanumeric sender ID through Support.

        Time to get scaling

        When you’re ready to scale with Twilio Programmable Messaging, we highly recommend moving your application to a Messaging Service, if you have not already done so. That way, you’ll have access to all of the built-in features that help you send messages globally and at high-volume, all while managing a single sender pool.

        The fastest way to scale your messaging application is to identify your use case and messaging needs from the start. Knowing where you’ll be sending messages, what type of content you’ll send to customers, and how quickly you need those messages to be sent will point you to the right sender types to include in your Messaging Service.

        Also check out:

        Rate this page:

        Need some help?



              Thank you for your feedback!


              Sending your feedback...
              🎉 Thank you for your feedback!
              Something went wrong. Please try again.

              Thanks for your feedback!

              Refer us and get $10 in 3 simple steps!

              Step 1

              Get link

              Get a free personal referral link here

              Step 2

              Give $10

              Your user signs up and upgrade using link

              Step 3

              Get $10

              1,250 free SMSes
              OR 1,000 free voice mins
              OR 12,000 chats
              OR more