3

Understanding the Technical Side of SaaS Application Development

 1 year ago
source link: https://www.mindk.com/blog/saas-application-development/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Understanding the Technical Side of SaaS Application Development — Web and Mobile App Development Company — MindK.com

HomeBlogEngineeringUnderstanding the Technical Side of SaaS Application Development

SaaS is booming. GlobeNewswire predicts that the global SaaS market will grow to $720 billion in 2028. This represents a 25.89% CAGR – one of the highest in the IT industry. Such a lucrative opportunity would be pretty much impossible without the amazing tech that powers modern SaaS apps.

As a CTO at a software company, it’s a part of my job to follow the latest SaaS trends. In fact, most of the new projects we build at MindK use this approach. If you want to learn about SaaS application development, you’ve come to the right place. Today, I’ll explain the core concepts behind cloud-based apps to give you a step-by-step plan for your next SaaS product. So let’s get the ball rolling!

Table of contents:

What are SaaS applications: a short primer

In the SaaS business model, users receive access to your software in exchange for a regular payment. For customers, there’s no need to worry about installs, updates, or buying hardware. For businesses, SaaS software development is faster and less expensive. It allows building massive products with smaller teams to succeed in the crowded SaaS market. But that is the boring part everyone knows. Here are all the juicy technical secrets that SaaS developers don’t want you to know (but not really, we’re nice people). 

How to develop a SaaS application?

There are now 337 SaaS unicorns and 15 decacorns. Building each of them involved the 6 basic steps I’ll describe below. 

#1 Define your tech stack 

A tech stack includes all the technologies used in your SaaS project. Choosing an optimal stack will determine the app’s functionality, scalability, and business success. As most modern SaaS projects are Single Page Applications, you can divide such a tech stack into 2 broad categories:

  • Client-side (frontend) tech powers the app’s UI – everything a user can see on their screens. The usual SaaS stack includes JavaScript, CSS, and HTML. 
  • Server-side (backend) technologies are invisible to most users. They include stuff like databases, web servers, hosting, Content Delivery Networks to improve the loading speed, and so on. There’s a much wider range of choices you can make with a SaaS backend. Here’s what you need to consider.

Frontend frameworks and libraries like React and Vue are incredibly useful tools that provide ready-made solutions to common engineering problems. Both are mature and powerful choices for SaaS products. Angular is another great framework we use at MindK. It’s a must-have for large enterprise projects. It has a ready-made project structure and a ton of features right out of the box. This error-proofs your SaaS app from common developer mistakes. You’re updating a single framework instead of a bunch of small libraries. So it’s much easier to migrate your app to the latest version of Angular.

Backend language and frameworks should be up-to-date, powerful, and flexible to meet your business needs. PHP, Java, and Ruby are all backend staples with some fresh rivals in the form of Python and Node.js. The latter is an open-source server environment that uses JavaScript. It is one of the core components of a SaaS tech stack at MindK. Node.js boosts engineer productivity by 68%, cuts SasS development costs, and raises app performance. 

Among the Node.js frameworks, NestJS is our #1 choice for SaaS applications. It’s a very advanced framework that follows the latest web development trends and best practices. Unlike Express.js, it has a lot of features like user authorization right out of the box. It also includes a ton of advanced architectural solutions like CQRS, Event-driven bus, and event sourcing. They are invaluable for complex SaaS apps. What’s more, NestJS authors are huge Angular fans. So the code structure is very similar between the frontend and backend.

Database. Every SaaS application has different requirements. Both functional and non-functional (scalability, reliability, security, and so on). So the choice of a database comes down to the project specifics. For some apps, we recommend relational databases like PostgreSQL. Others might benefit from NoSQL alternatives like MongoDB, ArangoDB. Instead of using the self-hosted solutions I’ve described above, you can also choose a cloud-based database service like Amazon RDS/Aurora. 

Queuing system (for microservice apps). This is a communication protocol that helps microservices exchange messages with other services and third-party applications. Apache Kafka, RabbitMQ, Azure Scheduler, and others are all good choices for a SaaS app in 2022.

How to select an optimal tech stack for your SaaS application?

A few things to consider when choosing the most fitting technology:

  • What languages and frameworks are most familiar to your engineers?
  • Do they have a thriving community? Are they easy to learn? 
  • Do other SaaS applications use this tech?
  • How hard is it to hire engineers that know these technologies?
  • Will you find it easy to maintain the app 5 years in the future?

Here’s how a tech stack might look in a SaaS application.

Example #1 (B2C): Canva – an easy-to-use SaaS graphic editor, valued at $40B

Frontend: JavaScript, React, and Typescript, Storybook. 

Backend: Java.

Web server: Amazon EC2, Jetty.

Database: MongoDB.

Content delivery: Amazon CloudFront.

Version Control: Git.

DevOps: Webpack, New Relic, Rollbar, Percy.

Source: StackShare

Example #2 (B2B): CemaSYS – a SaaS environmental reporting software, chosen by Forbes Global 2000 companies

Frontend:

  • Language – Typescript.
  • Framework – Angular.
  • CSS framework – MaterialUI.

Backend:

  • Language – Typescript.
  • Frameworks – Nest.js.
  • Cloud Storage – Azure Blob Storage.
  • Identity and access management – Azure Active Directory B2C.

Web server: Nginx.

Database: PostgreSQL, MySQL, and MongoDB (optimized for each service).

Content delivery: Bitbucket pipelines.

Version Control: Bitbucket.

DevOps: Kubernetes cluster on Azure Kubernetes Service. Grafana and Zabbix for real-time monitoring.

CemaSYS, a SaaS application for sustainability reporting created by MindK [explore the case study]

#2 Select a hosting provider 

The choice of a cloud provider will determine vital parameters like scalability, uptime, or security. 

Most people know that the cloud decreases hosting costs. But modern cloud platforms can also reduce development costs by as much as 20-40% over the project lifecycle. Such platforms provide lots of key features you need in a SaaS app, as services are ready for integration. 

We use a similar concept called MindK Design System. It’s a collection of reusable features like user login and authentication. You can quickly modify them to match your preferred design and save up to 15% of the project’s total cost. 

Anyway, Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform (GPC) are all solid choices for a SaaS app. At MindK, we prefer the AWS platform. Gartner names it the #1 cloud infrastructure and platform provider for 14 years in a row. Amazon is at least 5 years ahead of competitors, who are forced to play catch. So you can’t really go wrong with AWS. 

#3 Design a scalable architecture 

Each project is unique. Yet, several broad trends apply to most SaaS:

  • Microservices.
  • Auto-scaling.
  • Multi-tenancy.

Let’s review each in detail.

Architecture design: monolithic architecture vs microservices 

Here’s a simple example to help you understand the concepts. Imagine a small app that can book flights from a single airline. It has: 

  • Frontend that users can interact with.
  • Database of flights.
  • Search function that looks for flights in a database.
  • Shopping cart function that keeps track of the selected flights.
  • Payment function.

Although there are multiple components in a monolithic app, you place all of them into a single deliverable like a .jar file. The entire codebase is inseparable and has to be deployed in a single go. This approach is generally outdated for SaaS apps, but it also has its benefits. 

Advantages:Disadvantages:
  • Simple to develop.
  • Slow to deploy. Even the smallest changes require you to run the entire codebase through your CI/CD pipeline. 
  • Low costs in the early stages of development.
  • Slow and difficult deployments (see the above).
  • Easy to test and debug.
  • Prone to failure. If a single function like login goes down or starts consuming more resources, the entire app becomes unresponsible. 
  • Simpler to monitor.
  • High likelihood of performance issues down the road. It’s hard to optimize a single database for all types of requests. 
 
  • High infrastructure scaling costs. You can only scale your app by adding more servers, which is expensive.
 
  • Costly to migrate the codebase to newer technologies.

Microservices architecture is a response to the drawbacks of monolithic apps. It breaks the codebase into smaller modules based on their function. So in our flight booking app, you’ll have:

  • Flight search service;.
  • Shopping cart service.
  • Checkout service. 

Each of these microservices has its own business logic. It can also have its own database, best suited to the service’s needs. You can build each service independently of others, using the best technologies for the specific task. These services communicate with the help of Application Programming Interfaces (API instances). The approach has many benefits that make it our go-to choice for SaaS applications.

Advantages:Disadvantages:
  • Smaller and easier deployments. You can deploy each service separately. A smaller codebase equals quicker deployments. 
  • Slower time-to-market for smaller companies. Complexity and orchestration can slow down the initial development speed.
  • Higher fault tolerance. If one of the services has a failure or performance issues, the rest of the app functions just fine.
  • Complex interactions between modules. Your services will have to talk often and quickly. Managing all databases and transactions can become a pain over time. 
  • Easier scaling. You can scale individual services whenever needed (which can save costs).
  • Testing and debugging difficulties. Before you can test the microservice app, you need to confirm each independent module. Every service has its own logs, which makes debugging a pain.
  • Simple to update the tech stack. Microservices don’t lock you into a certain tech stack. Select optimal technologies for each service and migrate them gradually when a better option appears on the horizon.
  • Challenging deploys. Releasing code changes might require more coordination between different modules than with a monolith app. 
  • Reduced hosting costs due to the decoupling of functions.
 
  • Attractive for developers interested in cutting-edge tech.
 

Auto-scaling: container orchestration vs serverless architecture (Function as a Service) 

Scalability is critical for SaaS apps. A traditional enterprise application might have up to 100 users. For such a small number, you could design a single API instance to route requests from the UI to your database and back. 

Now, a successful SaaS product for booking flights can have thousands of users and millions of requests. To support such a scale, you could manually set up a dozen API instances and pay for each of them. 100% of the time. 

But what if you have a sudden spike in requests? Perhaps, your marketing campaign becomes a huge hit among users who start flocking to your app. Now, some of those users will get a disappointing error instead of a plane ticket. After all, no API instance can adequately handle so many requests. But wouldn’t it be awesome if you could dynamically create the exact number of instances you need to satisfy your current needs?

This is called auto-scaling. You can use two approaches for auto-scaling in SaaS apps.

The first one is to package each service in an isolated Docker container. You can think of it as a… container that contains all the stuff you need to run a service – your code, runtime, settings, all the libraries, and other tools. 

With containers, engineers can start up a development environment in just a few seconds. No need to waste 3-4 days installing Linux, Nginx, all the necessary libraries and frameworks, databases, and pulling the latest code from the repository. Containers are portable, lightweight, and easy to deploy. Ideal for microservice SaaS apps. 

But to scale and manage microservices in containers, you’ll need third-party orchestration software like Google’s Kubernetes. It allows you to write the code and rules to determine how many API instances you should run to meet the requirements. 

Kubernetes is now an industry staple. Still, you still have some challenges with a fully containerized architecture. Scaling happens with a slight lag, as you have to wait for the container startup. Security, storage, and networking are also a concern for many SaaS developers.

Your other option is to use the cloud platform’s native capabilities. The serverless approach allows you to only run code when necessary, based on pre-configured rules and triggers. 

When nobody’s booking flights in your app, your checkout service will consume no resources. Neat, isn’t it? In some cases, this allows you to save more money than containers (with few users or wild traffic spikes).

Serverless autoscaling (FaaS)

Container autoscaling (Kubernetes) 

Uses the cloud platform’s native auto-scaling, monitoring, and logging capabilities.

Requires third-party orchestration tools like Kubernetes, as well as solid logging and monitoring.

Relatively easy to learn.

Kubernetes is harder to learn.

Pay as you go. $0 if your services are idle and hefty bills for larger workloads.

Still pay for running the containers, even if your services are idle.

Entirely dependent on the cloud platform that runs your code.

Freedom when choosing infrastructure and full control over the environment.

Can’t choose your infrastructure.

Can use cloud services like Terraform or  AWS CloudFormation to take care of infrastructural overheads like the FaaS approach.

Offers native integration with other AWS services such as S3, SNS, or SQS. 

Ideal for: unpredictable traffic patterns, relatively simple processing of events, large-scale data analytics, and asynchronous communication of IoT devices.

Allows you to use third-party tools and software with specific version requirements.

Ideal for: predictable traffic patterns that still need auto-scaling for sudden spikes; easy cloud migration; Machine Learning, CI/CD pipelines, and multi-cloud applications.

Multi-tenant vs single tenant architecture for better security

A scalable SaaS architecture should support multi-tenancy. What does this mean in practice? Let’s get back to our flight booking app. You could give every user a virtual server when they’re browsing for tickets. But that would be just as exhausting for your computing resources as life is exhausting for your customers. 

This is single-tenant architecture. Now, let’s forget about it!

Multi-tenant architecture is a much better choice for SaaS apps. It gives multiple users the ability to access a common DB using isolated accounts. You can build multi-tenant applications in two ways:

  • Connect each application instance to a single database. This approach is cheap and simple, yet difficult to scale.
  • Connect application instances to a database until it reaches a certain capacity. Then you can route users to a second DB. This is costlier, yet better for scalability. 

With multi-tenant SaaS, it’s important to pay attention to security at different levels:

  • Application-level with security and policy as code tools like Synk;
  • Network level security: and
  • Infrastructure-level security, supplied by cloud providers like AWS.

By taking care of security, you’ll be able to collect massive amounts of data without the threat of lawsuits and lost reputation. 

#4 Don’t forget about integrations

The SaaS market is competitive. Like the NFL. Or dating after 30. You have to build fast, fail fast, and learn to succeed. It’s not enough to have great developers to move at market speed. Fortunately, you can often integrate third-party features into your SaaS app with the help of an API. No need to reinvent the wheel. API integrations can range from simple eSignatures to AI-based resume screening we integrated on one of our projects. In fact, the Canva app I mentioned earlier features over 100 integrations

Source: Canva

Building an ecosystem of apps and integrations for your product is one of the top 3 competitive defenses. Gartner Research VP Massimo Pezzini considers integration infrastructure a major advantage for SaaS businesses.

Salesforce, for example, won almost ¼ of the CRM market by allowing developers to build specialized apps on top of its platform. The success of its partners contributes to the CRM’s success. As of 2021, over 90% of the company’s revenue comes from APIs. 

Integrations are even more important for vertical SaaS. Unlike Salesforce, these products are aimed at one particular industry. To succeed in the market, they need integrations with industry-specific data and software services. 

Take, for example, CINX – a SaaS app for suppliers of US construction companies. To satisfy user needs, our team had to integrate the app with over 20 services (including CAD tools like Quickbooks). We designed the APIs before the rest of the application to simplify integrations. This is called the API-first approach. We recommend it for all SaaS apps at MindK. To learn more about integrations and the API-first approach, check our detailed article on API development

CINX, a vertical SaaS application for the US construction industry [read the case study]

Data warehousing is another approach you can use to integrate heterogeneous systems. One of our clients is a leading construction company in the Nordics region. They had over a dozen client-facing and internal enterprise systems like ERP and CRM software. All of them used different technologies and data formats. To connect all these systems, we developed a data warehousing solution with a microservice event-driven architecture. It supports high data consistency, availability, reliability, scalability, and load tolerance. This reduced the efforts needed to integrate new components by a factor of 10.

#5 Find a SaaS development team 

A common misconception I hear from startup founders is that they only need a handful of developers to succeed in the market. Yet, releasing a great product requires more than just coding skills. A skilled engineer will write an efficient method in no time. But make them create a beautiful UI – and nine times out of ten you’ll get something that looks straight out of the nineties.

The reason is simple. Most professionals tend to focus on a pretty narrow skillset so they can do their part of the job quickly and more efficiently. Experience shows that involving narrow specialists can save both time and money for your company. So, who should be on your SaaS development team?

  • Product Owner/Business Analyst

Every project has requirements. Yet, not everyone can identify these requirements and turn them into user stories for the development team. On Agile projects, this role belongs to a Product Owner.

Usually, this is somebody who knows everything about the target users and their needs. Founders often try to juggle this role while overseeing the go-to-market, managing the team, budgets, risks, and schedules. It’s easy to see how one person might lack the time or experience to fill all these different roles.

That’s why we recommend a professional Business Analyst for most of our clients. They can quickly identify customer needs, document them as user stories, and efficiently plan the project.

  • UI/UX designer

An average user will need just 0.05 seconds to form an opinion about your product. And this first impression will be almost entirely based on visuals. Good design is also about efficient and delightful user journeys. 

UI/UX designers can work with the team to define user personas, identify their needs, and design interactions in your app. Their job is to make sure your SaaS app is pleasing to the eye and a joy to use.

  • Software engineers

A SaaS application development team won’t be complete without programmers. You’ll need both backend developers and people who know front-end technologies like JavaScript, HTML, and CSS. 

  • Quality Assurance (QA) specialists

In 2012, Knight Capital Group lost 460 million USD in just half an hour due to an error in its stock trading software. And while most SaaS bugs aren’t so dramatic, they create a bad user experience.

Developers should indeed write automated tests (namely, at the Unit level). Yet, this is not enough for high product quality. Professional QA engineers will ensure you have complete requirements, identify areas of risk, devise testing strategies, and run all kinds of functional and non-functional tests.

Source: deppsource.io

  • DevOps/cloud engineers

SaaS application development requires advanced knowledge of cloud platforms. DevOps engineers can provide the necessary expertise to build scalable cloud infrastructure. They can also create automated CI/CD pipelines, automate configuration management, and organize continuous monitoring. This will save your developers hundreds of person-hours and ensure the smooth delivery of your product.

When searching for a development team, you generally have 3 options. You can hire all the people in-house, use freelancers, or contact a company that provides SaaS application development services. All three have their advantages and drawbacks:

In-house developers

SaaS development companies like MindK

Freelancers
+ Full control over the project and the team+ Access the full range of services needed to build and support your SaaS app+ Cheaper than other methods (no overhead, benefits package, or office expenses; an option to offshore your development)
+ Focus on your project alone and care about your company’s success+ Upscale or downscale your team on-demand. Benefit from well-developed recruiting processes to quickly augment your team with missing specialists+ Might be easier (in some cases) to find an engineer with a specific skill set in a global market
+Can benefit from co-location in a single office+ The company’s reputation depends on your success. So the focus is on long-term partnerships+Less legal hassle
– Most expensive option when you add up all the benefits and hire/retention costs+ Vendor takes care of project management, employee training, motivation, and retention.– Might be unreliable and disappear in the middle of a project
– Might be hard to find the necessary specialists locally+ Middle+ engineers who have worked together on multiple projects – Not all freelancers have a good work ethic or adequate skills (so you need strong candidate vetting)
– Can be difficult to retain, as the tech sector has the highest turnover in the US– Working across time zones requires strict communication guidelines for the development team– Have never worked together as a team 
– Takes time to hire and build the team into a cohesive unit– More expensive than freelancers due to the company’s premium– Might work on multiple projects simultaneously
– Need management and motivation– You need to ensure the team has good English and soft skills with a quick interview– Can have communication issues due to different time zones. Need careful management

#6 Never stop improving 

Building a SaaS product in a never-ending race. Market leaders keep introducing new features and integrations to stay ahead of competitors. Yet, functionality improvements are just a part of the post-release optimization:

Technology optimization. Updating your tech stack is a natural part of the SaaS lifecycle. Over time, your application might get too slow, illogical, or poorly scalable to satisfy users. In such cases, the team has to make a hard decision. They can continue accumulating technical debt or re-engineer the solution with newer technologies (as was the case of Uber and Pinterest).

CemaSYS – a sustainability reporting software I discussed earlier – was initially written in Ember.js and PHP7. As the client has an ambitious plan for new features, they needed technology we could support for years to come. That’s why, the team decided to migrate the project to Angular, Nest.js, and Azure Blob Storage. The Angular team releases improvements twice a year, which is great for maintenance and security.

Analytics dashboard in the CemaSYS application by MindK

Pricing optimization. SaaS pricing is both an art and a science. According to Harvard Business School, a 1% improvement in pricing can yield you 11% more revenue. The Anatomy of SaaS pricing strategy says that users often don’t care about the price of your product or its rivals. They do, however, care about the value they get at the price you offer. Value-based pricing allows you to continue optimizing SaaS pricing based on people’s willingness to pay.

Source: priceintelligently.com

Cloud cost optimization. Cloud platforms have a lot of cost-saving features you can use depending on the nature of your application. On one of our projects, Amazon’s built-in capabilities allowed our client to save $14K/month on infrastructure costs. On another SaaS project, our DevOps team has recently reduced the monthly bills from $5K to $2K. This shows there’s always a way to pay less for your cloud infrastructure. The trick is to use just enough resources for a great UX but not too much to save costs.

Optimized infrastructure costs and better scalability with a microservice architecture [explore the case study]

At the end of the day, SaaS app development is similar to releasing a successful product in other niches. You must test your assumptions as quickly as possible with an MVP, collect feedback, and continuously improve the application. 

Conclusion

SaaS-based application development is a challenge, both from business and engineering standpoints. But with the right tech stack, powered by a modern cloud platform and scalable microservices, you’ve got half of the winning recipe. The other half is, of course, having the right team for the task.

MindK has been building cloud-based applications for more than 5 years. We’ve helped dozens of companies at various points in their product development journey. So if you need any help with your custom SaaS application, don’t hesitate to drop us a message. We’ll get back to you in a few days to arrange a free consultation with our cloud experts.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK