<p>A simple question about scalability. I have been studying about scalability and I think I understand the basic concept behind it. You use an orchestrator like Kubernetes to manage the automatic scalability of a system. So in that way, as a particular microservice gets an increase demand of calls, the orchestrator will create new instances of it, to deal with the requirement of the demand. Now, in our case, we are building a microservice structure similar to the example one at Microsoft's &quot;eShop On Containers&quot;:</p>
<p><a href="https://i.stack.imgur.com/iP0TE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iP0TE.png" alt="eShop On Containers" /></a></p>
<p>Now, here each microservice has its own database to manage just like in our application. My question is: When upscaling this system, by creating new instances of a certain microservice, let's say &quot;Ordering microservice&quot; in the example above, wouldn't that create a new set of databases? In the case of our application, we are using SQLite, so each microservice has its own copy of the database. I would asume that in order to be able to upscale such a system would require that each microservice connects to an external SQL Server. But if that was the case, wouldn't that be a bottle neck? I mean, having multiple instances of a microservice to attend more demand of a particular service BUT with all those instances still accessing a single database server?</p>

<blockquote>
<p>In the case of our application, we are using SQLite, so each microservice has its own copy of the database.</p>
</blockquote>
<p>One of the most important aspects of services that scale-out is that they are <a href="https://12factor.net/processes" rel="nofollow noreferrer">stateless</a> - services on Kubernetes should be designed according to the 12-factor principles. This means that service-instances cannot have its own copy of the database, unless it is a cache.</p>
<blockquote>
<p>I would asume that in order to be able to upscale such a system would require that each microservice connects to an external SQL Server.</p>
</blockquote>
<p>yes, if you want to be able to scale-out, you need to use a database that are outside the instances and shared between the instances.</p>
<blockquote>
<p>But if that was the case, wouldn't that be a bottle neck?</p>
</blockquote>
<p>This depend very much on how you design your system. Comparing microservices to monoliths; when using a monolith, the whole thing typically used one big database, but with microservices it is easier to use multiple different databases, so it should be much easier to scale-out the database this way.</p>
<blockquote>
<p>I mean, having multiple instances of a microservice to attend more demand of a particular service BUT with all those instances still accessing a single database server?</p>
</blockquote>
<p>There are many ways to scale a database system as well, e.g. caching read-operations (but be careful). But this is a large topic in itself and depends very much on what and how you do things.</p>
