[ad_1]
Grammarly is an AI-powered communication assistant that helps greater than 30 million customers day by day with each free and premium product choices. This implies we want a strong Billing and Cost platform to serve these totally different choices, deal with native currencies and cost strategies, and combine with Cost Service Suppliers (PSPs) and orchestrators. On this article, we’ll present an outline of Grammarly’s Billing and Cost platform. We’ll cowl the necessities, give a chook’s-eye view of how the system works, and checklist the patterns used to make sure excessive efficiency, scalability, and reliability.
Grammarly presents pricing plans to cater to the wants and budgets of various customers:
- Grammarly Free. Anybody who has signed up for Grammarly will get grammar and spelling checks, tone detection, and punctuation ideas.
- Grammarly Premium. This providing provides a full-fledged AI-powered assistant, offering options like full-sentence rewrites and generative AI, together with ideas for tone and vocabulary. It additionally features a wealthy set of superior grammar and magnificence enhancements that target readability, inclusive language, and plagiarism detection.
- Grammarly Enterprise is designed for groups and organizations. This product providing contains all of the options of Grammarly Premium, plus extra instruments for workforce administration and collaboration: account roles and permissions, SAML single sign-on assist, workforce model guides, model tones, and organizational snippets.
The Billing and Cost platform goals to assist all choices supplied by the totally different Grammarly strains of enterprise. Moreover, we design the system to be versatile and scalable to accommodate any new product packages the corporate might develop for our customers.
The Billing and Cost platform has inside and exterior customers that differ of their wants.
For our exterior customers, transparency, safety, and reliability are paramount. Having a reliable platform is particularly essential as we develop into areas the place client protections might should be stronger, belief in banks and retailers could also be low, or each.
Our inside customers primarily want configurable and automatic tooling accessible through a self-service mannequin.
To serve these two kinds of customers, the Billing portion of our platform contains the next options:
- Packaging: Defining a product or bundle to promote
- Billing fashions: Defining when the client is charged (pre- or post-purchase, one-time or on a recurring foundation, and so on.) in addition to customized eligibility for particular billing fashions
- Pricing and discounting: Figuring out how a lot to cost in addition to deciding buyer eligibility for explicit pricing or promos
- Invoicing: Dealing with taxes and producing and delivering a compliant and auditable set of paperwork acceptable for the client sort and site
- Accounting: Compliantly recognizing income and prices in keeping with the billing mannequin and the native monetary guidelines
The Funds scope contains:
- Cost strategies. Particularly, the platform is answerable for constructing and sustaining cost methodology choices, corresponding to:
- Buyer-facing UI
- Vendor connections, routing, and retries
- Inner-facing tooling
- Settlements and cash motion with processing distributors
- Establishing and managing authorized entities to allow native cost strategies or native card-acquiring
- Managing required compliance and licensing duties
- Cost fraud. This contains constructing and sustaining instruments and processes to detect, forestall, and handle first-, second-, and third-party fraud.
The Billing and Cost platform is a part of a broader ecosystem of Grammarly companies. The platform is decoupled from different parts however nonetheless tightly built-in into inside and exterior consumer flows to supply a set of self-service APIs and automatic configuration instruments.
To get a extra concrete concept of how these parts match collectively, the diagram beneath illustrates how totally different companies work together throughout a checkout circulation.
Grammarly has a worldwide attain, serving tens of tens of millions of day by day lively customers—a determine that’s constantly rising. For all our customers, we attempt to supply one of the best billing and cost expertise. So we assist a number of native currencies, together with USD, EUR, GBP, and INR. To attenuate cost friction and guarantee excessive authorization charges (the share of efficiently permitted transactions), our Billing and Cost platform helps a wide range of cost strategies and has integrations with a number of main PSPs and orchestrators. Moreover, the platform depends on third-party companies to ensure compliance with native monetary guidelines and laws relating to taxation, accounting, and invoicing.
To deal with our efficiency and scalability wants, we use totally different patterns:
- Concurrent and parallel processing to deal with the inner and exterior load
- Impartial scaling of companies to flexibly handle wanted capability
- Optimistic locking to forestall conflicts between concurrent enterprise transactions by detecting a battle and rolling again the enterprise transaction
- Occasion-driven interservice communication and backpressure to keep away from overloading downstream companies and guarantee scalability
As well as, the system should be each extremely accessible and fault-tolerant. To attain this, we use a variety of mechanisms and patterns. Listed here are some examples:
- A transactional outbox to atomically replace the database and ship messages to keep away from knowledge inconsistencies
- Circuit breakers to forestall a community or service failure from cascading to different companies
- A Useless Letter Queue (DLQ) to observe and examine/repair failed messages
- Idempotent message dealing with to retry requests with out extra negative effects
- Charge limiting to forestall one service from taking down Billing and Cost options for all companies
- Timeouts to forestall long-term system overloading (with exterior and inside programs)
- Retrying in case an error could be self-healing (e.g., community failure, third-party service outage)
Lastly, it’s vital to have a quick and up-to-date understanding of the system’s standing and have the power to troubleshoot any points. For these functions, we use metrics, alerting, tracing, and logging:
- Metrics are important in monitoring the system’s state and understanding habits patterns. We use a variety of technical and enterprise indicators to create personalized dashboards that permit us to observe the system’s efficiency in actual time and discover short- and long-term developments.
- We depend on technical and enterprise alerts. Each varieties have totally different ranges and use circumstances. For instance, technical alerts might activate when a PSP turns into unavailable. Equally, uncommon modifications in cost authorization charges will set off enterprise alerts.
- Traces and logs are indispensable for troubleshooting. Particularly, we use log tracing to rapidly grasp what occurs for particular requests, even when they have been executed asynchronously in a number of threads and totally different companies.
It’s a problem to handle funds at a worldwide scale for a wide range of currencies, cost strategies, and product choices. Grammarly’s Billing and Cost platform serves the wants of our customers and supplies tooling, widgets, and APIs to different Grammarly groups and companies.
We use totally different patterns to deal with our efficiency and scalability wants. Amongst them are concurrent and parallel processing, auto-scaling, optimistic locking, and backpressure. Moreover, numerous mechanisms and patterns are employed to make sure system availability and fault tolerance: transactional outbox, circuit breakers, idempotent message dealing with, rate-limiting, timeouts, retries, and extra.
We rely closely on various kinds of metrics and alerting. This permits us to have a quick and up-to-date understanding of the system’s state, in addition to make data-informed selections.
In case you take pleasure in tackling advanced challenges and need to be part of our workforce to assist scale our quickly rising platform, we’re hiring!
[ad_2]