3 ms·
My advice would be to try to structure your app to only use the database directly and structure all business logic around asynchronous actions that can be calle
by endisneigh 4y ago
My advice would be to try to structure your app to only use the database directly and structure all business logic around asynchronous actions that can be called via server less functions or regular services you’re hosting. IMHO this is the future of most softwares architecture.
Set up proper replication for your database and you’re good. Very few companies I’ve seen need more than this in principal. In practice there’s a lot of real time stuff that really isn’t necessary increasing architectural complexity.
The amount of service types that inherently need real time processing can probably be counted on a single hand
- humbleMouse 4y ago
- mikhmha 4y agoyup this is what we do at my work. There is data and then all business logic / asynchronous processing is done using serverless functions. Ends up being really cost effective and it can scale well. All the data exists (and setup with replication) so you can always migrate ur app to some other platform or architecture if need be. we have CI/CD pipeline that builds and deploys serverless functions using serverless containers. not a serverless enthusiast btw. microservices have their own set of issues but they can be the right fit for certain apps.
- KronisLV 4y ago> server less functions This is a nice idea, but many out there will need to work with on-prem infrastructure and self-hosted software. So my question is: why would be the best open FaaS solution that you can setup on your own infrastructure and use without caring too much about the underlying hardware/OS? > Set up proper replication for your database and you’re good. Another thing that I'd consider is how the DB will grow over time. Should you have a single, monolithic DB you'll end up with hundreds if not thousands of tables which will be cumbersome to work with. Personally I think that being able to use foreign keys across your entire domain is like a superpower, but some might advocate for separate DBs for separate domains, once you get that far.
- wruza 4y agoSet up proper replication for your database and you’re good. Sorry for maybe direct question, but I work at a small company and we are exploring options regarding cloud db now. So you’re saying that I can just set up two/three different-datacenter vps, put db replicas there and that’s fine? I know that my many safe-to-lose-data vps’s already run for years without any issues, but managed db cost is confusing, as if it was a nontrivial task that I shouldn’t do myself.
- endisneigh 4y agoWhat you'd do exactly depends on your database. For Postgres you could use something like Citus, you also could setup your own duplication, but in general yeah setup a few VPS, setup the replicas and some load balancing and you're good. Managed DB costs can seem confusing, look at your data for egress, storage, read and writes. Most have a calculator where you can plug in the data to estimate.