As we can divide the business into two aspects:
1. Where the user uses and engages with your product idea: The Interface
2. Where core business logic runs and magic happens: The Engine
Here we talk about the second part of your product: The engine. If you didn’t read the first part of this talk: your product tech stack: The Interface, read here.
While talking about the engine, it same as it sounds. It is too complicated to select and it is a more crucial part of the business. If anything goes wrong, will charge you a lot of costs to repair it or create a new one.
So start with a few backend terms or we can say engine parts:
- Server Technologies [such as php, node.js, Ruby on Rails, Django, .net, Go, Rust etc]
- Database Technologies [such as SQL-based (MySQL, Postgres, Oracle, SQLServer) No SQL based: Mongo, Orient, CouchDB etc)]
- Cloud Technologies [Such as AWS, GCP, Azure, Digital Ocean (I’ve separate post on hosting here)]
- Other Data streams (caches, indexes, searching, message queues, job queues etc.)
So let’s start with the first server technologies: where the business core logic is written. Here few factors that are very important:
- Development Time (Time to develop new feature and release it: as startup require a lot of iterations and fast release cycles, and this time is directly proportional to cost, so low is good)
- Code Maintainability (Development time on change feature or bug fixing in long run, same directly proportional to cost, so low is good)
- Code availability: (How much traffic a server language can entertain in terms of cost, this is directly proportional to the cost. As many servers are available to handle traffic low cost will charge as a bill)
- Code Scalability (If sudden traffic comes and wants to scale, code quality is managed in this way. If not cost will be added to manage that and may few downtimes for users as well, not good from a business point of view at high traffic suddenly out of service for few time)
- Developer availability and communities (Here inversely proportional to the cost, as much as developers are available, the cost of the developer will decrease)
As here we compare very popular options: PHP, node.js, Ruby on Rails(RoR), Django, GoLang, and Rust. Others are rarely used so won’t talk about that. RoR and Django are similar types as for backend Rails have a better advantage of dev time, and GoLang and Rust are similar so I put them into the same block.
Tech | Development Time | Code Maintainability | Code availability | Code Scalability | Developer availability |
---|---|---|---|---|---|
[Lower is good] | [High is good] | [High is good] | [High is good] | [High is good] | |
php | Low | Medium | Low | Low | Highest |
node.js | Low | High | High | High | Highest |
Ruby on Rails | Lowest | Highest | Medium | Medium | Low |
Django/Python | Lowest | Highest | Medium | Medium | Medium |
Golang & Rust | High | Medium | Highest | Highest | Lowest |
For overall on the business point of benchmark node.js is quite a good fit for many reasons:
1. Dev time to build application is similar to php, slower to Rails and Django, but quite faster than Golang and Rust.
2. code maintainability is high and very important.
3. code available to handle traffic is high than php, rails, django, but low than Golang and Rust.
4. scalability is also so good similar to point 3
5. Most important: A very large community developer is available at a very reasonable cost. However, php developers are cheaper than node.js but other factors also matter with PHP.
Now if we say node.js is good to start, code maintenance is quite tricky and it depends on the framework you select for development in node.js. Express.js is the most popular framework here, however, I advocate the Adonis.js framework due to many reasons: as it is MVC, similar to Rails and Laravel in php. In MVC code maintenance and dev time are quite good. Overall in long run, it will get benefit you on the business side. Quite easy to adapt the intern to an experience-level developer. Type safety and a lot of features are inbuilt. I recommend you use it for the next SaaS Startup if not tried ever. Otherwise, express.js will be the other option. A lot more frameworks there with magical stuff, but I won’t recommend you waste the cost to testify to others.
Moving to the second part Database Technologies which is subject to the business product problem, still, now most of the problems can be handled by SQL database as we see Excel to store data in table form. MySQL is the most popular database and I also recommend using it. Reliable at a very high volume scale, Postgres is also one good alternative. Others are SQLServer, Aurora, and Oracle depending on your business needs.
But for dynamic information stores such as e-commerce where you don’t know the dimension of product information like phones have different information to store and TV will have different, then use Mongo. I prefer to use both in most cases a Mix and match of MySQL and Mongo or some cases Postgres. But in most cases, I don’t require Mongo. MySQL is quite sufficient for MVP or later stages. After that very high volume needs to shift data into mongo and Elastic search for further use cases.
Let’s move to the third part: Cloud Technologies AWS is the world’s most popular cloud service provider, has many reasons: first mover advantage, a lot of services are there and DevOps are most used to it. However Azure and GCP can also be the alternative. Digital Ocean is also one good cloud service provider for startups who don’t want DevOps headaches and manage a lot of stuff by service provider. Netflix, Dropbox, Uber, Ola, Hotstar and a lot of big to small startups are using AWS, but we can also use mix-and-match combinations according to requirements. Few services are taken from AWS few from others, but it will take an extra headache to maintain the infrastructure. So I recommended using one initially, and if got a lot of cost on the infra side then think of switching infra to some others.
The last part of this post is about Other Data streams: For caching Redis and Memcache is the most popular option, most of the work can be done by credit, and for specific use cases use Memcache. see the documentation for your requirement fitting.
Indexing and searching the world’s most popular engine: Elastic search is available, as solar and a few more popular alternatives are available, but I guess elastic search can fulfill your most of requirements.
For message queues or sharing data across micro-services with high volume Kafka. RabbitMQ is very few people use and at a low scale. I guess Kafka the only solution at such a big scale. Other cloud services AWS, and Azure provide their own services as well but that is costly compared to this. Instead of using native cloud service they also offer managed Kafka, use that instead.
For Job Queue: Redis also provides the queue concept so initially, we can use that. Highly scalable also. Google firebase and AWS bases SQS and other native cloud-based solutions are also available so you can try that out. My recommendation is to use Redis, as you can also use this for caching, so will save the cost of infra.
End of this post, Summarized both posts in nutshell and my recommendations:
Web Frontend: (SPA/SSR/PWA): Vue.js
Mobile Apps: React-Native
Backend-Server: Node.js (Adonis.js)
Backend-Database: MySQL
Backend-Infra: AWS
Backend-Others: Redis, Elastic Search, Kafka
Yes, my recommendation will solve the right stack for your product. However, it depends completely on the product idea and recommendations can be changed as per need.
IF you missed the PART-1: The Interface (user experience and interaction point)