C
C#2y ago
Alerin

❔ The application is available worldwide

I need to create an application that will be fast in different regions of the world. I want to use asp.net blazor version wasm for this, how should I make the server low ping in each region? How to make a database? Common for the whole world or base per region? Are there any ready-made solutions? Unfortunately, when I tested cloud azure, with a large number of queries to the database, the time is 40ms, which reduces the performance of the application.
15 Replies
Doombox
Doombox2y ago
Blazor WASM will be slow in every region, because it performs frankly like garbage, query times are the least of your concerns when the bundle sizes are as big as they are anyway If you're talking about the backend only in terms of ASP.NET then it's a different story, why do you need such low query times? 40ms is perfectly reasonable for anything that isn't realtime
Alerin
Alerin2y ago
I thought about blazor wasm because it works on the phone and the rest is rest api or grpc. When it comes to the time to the database, the problem arises when there are many queries. For example, download a list of elements, then add something else to this list, etc. There is clean data in the database, only the server parses it to, for example, dto. I had such a problem when, for example, I wanted to make 10 queries to the database, then the whole thing took about 400ms I understand that it can also be done with the cache, but what if the cache in the US will be different than in, for example, Asia?
Doombox
Doombox2y ago
what are you using for your DB? parallelising your queries would be step 1 really unless you're facebook you don't need to worry about distributing your DB that widely
Alerin
Alerin2y ago
I was thinking about mssql which is best for ef core. I was commissioned to create a netflix-like system for a movie producer. Currently, it will be a few videos, but the platform is expected to develop.
Doombox
Doombox2y ago
I mean the backend and the CDN for your actual videos would end up being entirely separate, though I'm not that knowledgeable on stuff at that scale
Alerin
Alerin2y ago
I thought to create a server per region, make the application and database on one server and add the region prefix to the database. ASP.Net is able to handle a lot of requests from one server. We anticipate around 50-100k online users. I will stream the movie with cdn77 or cloudflare. Unfortunately rest or grpc I have to handle myself. Here I have a problem with the database, user data, videos, etc. There is little movie data that does not change so it can be replicated. Unfortunately, there can be many users, so keeping it in one database can be problematic, especially since there are different regions of the world.
Doombox
Doombox2y ago
MySQL can handle parallel queries (or rather more than one connection that executes queries in series), the only limit afaik is system resources and for non-realtime applications you might be entirely fine with a single server wherever your userbase is most concentrated, worst case round trip times from the other end of the world is like 250ms which you obviously can fix by having a regional server if you want if you have multiple regional servers at some point they will have to update the "master" server, but you haven't got to be concerned with how slow that is, the "regional" server essentially acts as a cache
Alerin
Alerin2y ago
You are right too, now there is such a fast internet in the world. 250ms is not much with final rendering.
Doombox
Doombox2y ago
the regional server would exist purely to bring the user-experienced round trip time down, then you can send the update off to the master server whenever you want, even if the roundtrip time is like 5000ms it doesn't matter because the user won't experience it
Alerin
Alerin2y ago
You can create a central application that manages the data, and the servers and the application on them will act as a cache and possibly communication between them. Do you know any ready-made solutions that work like this?
Doombox
Doombox2y ago
Uhhh, not that I can think of, I don't really work at this scale much #web might be the place to ask or #devops-and-tools if there are some ready-made distributed solutions that are implementation agnostic it might be that someone like AWS offers an out-of-the-box solution for this where you just give it a DB and it handles distributing it and maintaining parity, but I don't really know
Alerin
Alerin2y ago
Thanks for your help, I'll look for solutions and wait for someone else to comment on the topic.
Axiss
Axiss2y ago
for geographic distributed databases you can look at AWS Dynamo or Azure Cosmos DB.
Henkypenky
Henkypenky2y ago
^^
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server
More Posts