Your Startup Will (Probably) Fail, So Choose Simplicity
You really need to start with simplicity in mind and see if the market likes your idea
Today…
we will explore the fundamentals of system design. We'll begin by designing a basic system, and in future blog posts, we'll examine how to evolve and scale this system as it gains more users and faces increasing demands.
The big idea behind this blog post is not just the technical aspect, but rather the importance of simplicity and speed when launching a startup. I really want to emphasize how crucial it is to keep things as simple as possible and not get dragged into complexity, just because you want to solve a problem that you might never even have it in the future or because it’s just super cool.
I truly believe in the wisdom attributed to Leonardo da Vinci:
“Simplicity is the ultimate sophistication.”
Intro to PetAway
Imagine we are a startup, let’s call it PetAway, aiming to create an app where users can arrange for others to walk their pets while they are at work. This application will serve as our foundation, and in future posts, we will explore how to evolve and scale our system as our user base grows and demand increases.
Our goal is to make it easy for pet owners to find reliable individuals to walk their pets while they are at work or otherwise occupied.
Here's a brief overview of the core features of PetAway:
User Registration and Authentication: Users can quickly create accounts and securely log in to access the app's features.
Pet Profiles: Owners can create detailed profiles for their pets, including information such as breed, age, preferences, and any special walking requirements.
Walker Profiles: Pet walkers can create their own profiles, showcasing their experience, availability, and user reviews to build trust with pet owners.
Booking System: A streamlined scheduling system allows pet owners to book walking appointments, manage bookings, and view walker availability in real-time.
Notifications: Both pet owners and walkers receive timely notifications about bookings, cancellations, and updates to ensure smooth communication.
Payments: Secure in-app payment processing makes it easy to handle transactions between pet owners and walkers, ensuring a hassle-free experience.
Keep in Mind: Your App Will (Probably) Fail
Since this is a startup, I truly believe that the most important thing at this stage is to have your product in the hands of users as quickly as possible. Unlike large companies with deep pockets, a startup usually faces tight constraints in terms of money and time. You need to be fast to market because, at this stage, you don't even know if anyone will be interested in your product.
You need to build a minimum viable product (MVP), which is a simplified version of your app that includes only the most essential features to solve the core problem. In our case, this means focusing on booking pet walking appointments. The MVP allows you to launch quickly, gather user feedback, and iterate based on real-world usage to ensure you are building something that truly meets your users' needs.
With that said, we should aim at building a robust yet flexible architecture that can scale as needed if we are fortunate enough to attract a substantial user base. Given that more than 90% of startups fail, it's crucial to strike a balance between creating a functional product and planning for scalability.
Our goal is to design an architecture that meets our current needs while being adaptable to future growth, ensuring we are prepared for success without over-investing in premature optimization.
Remember, at this stage, time is of the utmost importance. Don’t spend months building features that the market might not even be interested in. Focus on developing only the essential parts of your product and ship them as quickly as possible. This approach allows you to test if your product meets market demand and gather valuable user feedback to guide further development.
Tools & Frameworks
Since we want to ship fast, we'll start with a simple monolithic architecture with layers. This approach allows us to quickly develop and deploy our minimum viable product (MVP) while maintaining a clear and organized structure. Later on, as we refactor and improve our architecture as demand increases (in future blog posts), we’ll take a look at modular monoliths - something that would prepare us for microservices architecture later on. The idea here is to try to mimic the real life software development and architecture decisions as much as possible.
Now, a quick tour at the tools we’re going to use to build our app.
Front-end (UI) and Back-End (Business Logic):
We’re going with ASP.NET Core MVC for our front-end and back-end development. ASP.NET Core MVC is a popular, cross-platform framework maintained by Microsoft and a large, active community. It’s well-suited for building dynamic and responsive web applications, making it a reliable choice for our startup. By choosing ASP.NET Core MVC, we leverage a proven technology with extensive community support, reducing the risk associated with using newer or less popular frameworks.
Single Project Architecture:
Both the front-end (UI) and back-end (Business Logic) will reside in the same ASP.NET Core project. This unified approach allows for a single deployable unit, streamlining the development and deployment processes. By having both layers in the same project, we can simplify our architecture, reduce overhead, and speed up our development cycle, which is crucial for our startup’s success.
Database:
We'll use PostgreSQL, a powerful, open-source relational database system. PostgreSQL is known for its reliability, feature robustness, and performance. It supports advanced data types and performance optimization features that will be essential as we scale.
Additionally, since it’s open-source, it is free, which is crucial for us as a startup with limited resources. Unlike commercial databases like MSSQL, PostgreSQL does not incur expensive licensing fees, making it an economical and practical choice.
Additional Tools:
Authentication and Authorization: We'll use Auth0 for managing user authentication and authorization. Auth0 provides secure, scalable authentication solutions and can be easily integrated with our tech stack. Additionally, it offers a free tier for up to 7,500 monthly active users, which is perfect for our current needs as a startup. This allows us to implement robust authentication and authorization without incurring additional costs during our initial growth phase.
Notifications: For messaging and notifications, we'll use SignalR, a library for ASP.NET that simplifies the process of adding real-time web functionality to applications. SignalR allows server-side code to push content to clients instantly as it becomes available, providing a robust solution for notifications.
Payments: We'll integrate Stripe for payment processing. Stripe is a widely-used payment platform known for its ease of integration, security, and flexibility in handling various payment methods.
Metrics
Since we’re building a system for a startup, we don’t expect much.
Here are our initial assumptions (all on average):
Daily Active Users (DAU): 500
Session Duration: 15 minutes
Peak Concurrent Users: 100
Pet Profiles Created / month: 1,000
Walker Profiles Created / month: 500
Daily Bookings: 200
Notification Volume: 500 notifications/day
Payment Transactions: 200 transactions/day
These metrics will help us gauge the initial performance and scalability requirements for our application and ensure we are prepared to meet user needs effectively.
Architecture
For our startup, we’ve decided to start really simple. We’ll use a couple of external providers: Auth0 as our identity management solution and Stripe for payments. Everything else will be managed in-house. To save money, we’ll provision two virtual machines (VMs) – one for our application and another for our database.
We’ll use an Infrastructure as a Service (IaaS) solution from Azure. As a startup, we likely don't have the good old computers stored in a garage somewhere (and we shouldn't, really, because it's not the '90s anymore). Cloud providers like Azure allow us to provision any type of infrastructure we need. Whether you’re a large enterprise or a startup, the cloud has you covered.
Additionally, using the cloud will enable us to scale faster if needed in the future. It really is just a matter of a few clicks and some configuration to handle larger loads as our user base grows. Well, at least on theory.
Here’s what I decided to end up with for our fictional startup.
This approach is as basic as possible to ensure we don't spend too much time and money building something the market might not even be interested in. As mentioned, Auth0 is free for up to 7,500 users, making it ideal for startups, because, well... free. If needed, we can always switch to another provider, such as Okta or Microsoft Entra ID.
We'll start with two cost-effective VMs until we get enough traffic to justify scaling up. Additionally, Stripe's pay-as-you-go pricing model is perfect for us, as it incurs no fees unless someone makes a payment. This strategy allows us to minimize initial expenses while being prepared to scale and adapt based on user feedback and demand.
Now, we could have started with something like microservices, using an event-driven approach and other fancy technologies and techniques. However, that would drastically increase the development cost, overall complexity, and time to market.
Remember that users don’t care about how cool your architecture is or what fancy technologies you’re using behind the scenes. What they care about is having a product or service that they find useful and that they can use now.
You don’t need a complex system when you’re just starting. You need a product. If the time comes when you need something more sophisticated, that’s a great problem to have, and you can address it then. But until that point, as the saying goes, you’ll cross that bridge when you come to it.
Conclusion
If you take just one thing from this post, let it be this: always start with simplicity in mind. Simplicity is hard to achieve while complexity is easy. Anyone can create something complex, but only those who truly understand their domain can keep things simple. Don’t start with big investments or spend time building the most amazing product. Start small and keep it as simple as possible.
Mark Zuckerberg once said that he never intended to create Facebook as it is today. Initially, he just wanted to build a platform for people at Harvard to see who studied what and who knew whom. He then expanded what was known as "Thefacebook" back then to other universities and added more features, but all of that came with demand. He didn’t build the social network giant we know today from the outset. He started small, bought a single server to host the initial app, and grew from there.
Remember, more likely than not, your startup will fail. This is a proven fact, illustrated by the "Startup Curve." The chances of failure increase with time, especially during the "Trough of Sorrow," a phase where many startups struggle to find product-market fit.
Your chance of succeeding decreases every day, so make sure to ship the most viable product and start from there. Test the waters to see if your product meets market demands. Don’t spend too much time working in isolation. Build fast, deliver faster, and see what the outcome is.