Home / Companies / Checkly / Blog / March 2019

March 2019 Summaries

3 posts from Checkly

Filter
Month: Year:
Post Summaries Back to Blog
We use Vue.js with Vuex to manage plan limits, features, and user logic in a friendly way. We need to keep track of global variables that change dynamically as the user interacts with the app, but we don't want to clutter our frontend components with this logic. Instead, we expose a dedicated object that encapsulates the current state of all plan and user logic. This object is populated on initial page load using actions and mutations. We transform almost all properties into isSomething or hasSomething forms to make code nicer in components that use it later. We also have a currentAccount object because a user can be a member of multiple accounts and switch between them during a session. The representation is tailored for the frontend, not the backend. We use computed properties to tap into the expiryStatus object and set showUpgradeTeaser and showExpiredTeaser booleans. These booleans determine whether to show upgrade messages or not. We also deal with volume limits by tapping into the isFeatureLimited object and its dynamically generated properties. This pattern can be applied to any SPA framework.
Mar 31, 2019 1,501 words in the original blog post.
This SaaS app has three plans with varying prices and features, including API and browser checks that are volume limited, team members feature that is either enabled or not, and CI/CD trigger feature that is either enabled or not. The app also handles trial users differently, providing them with a trial version of the public dashboard only after they become paying customers. To enforce and keep track of these features and limits, the app categorizes them into four types: trial vs. non-trial, paying vs. lapsing, plan-based feature toggles, and plan-based volume limits. The app uses a data model to store account information and checks for user access rights using a function called `hasAccess`. It also checks for features using another function called `hasFeature`, which returns true if the feature is enabled in the account's set of string constants. The app asserts plan-based volume limits by polling its database and counting specific resources on each request, returning whether the new total amount fits into the plan limit. To be nice about it on the front end, especially in an SPA type setup, the app uses a combination of client-side and server-side logic to check for plan limits before allowing users to create new things.
Mar 24, 2019 1,522 words in the original blog post.
The developers of Checkly, a SaaS company, chose to use PostgreSQL as their database management system due to its excellent engineering and features that meet the needs of their application. They considered using MongoDB or DynamoDB, but ultimately found them unsuitable for their relational data model. The team opted for a single, multi-tenant database with separate schemas for each customer, which provides scalability, security, and ease of migration. Their user and account management system is designed to handle multiple users per account, account settings, and access rights, utilizing an enum field for role-based access control and a string array type for feature toggles. The plans and subscriptions table has a weak relation with the accounts table, but both use the same fields for plan limits and features, allowing for easy customization and experimentation with pricing and plan composition.
Mar 17, 2019 1,349 words in the original blog post.