Похожие чаты

After fast-forwarding through many Microservices course playlists, I've notice a

common pattern. That is, each sub-service within a given project - has a single table!

Coming from a Rails driven traditional MVC and Web-API/ SPA-Client world where I manage most of our data needs within a single database, This is new to me. Ngl, Looks like an overkill. I am more comfortable with building data model and relationships within a single database.

First Question: Is this observation correct? Do I need to split an application down even to an individual table level? What is the general rule to follow here?

Second: How do I counter the communication/ processing lag to render a response that relies on data from multiple services? It can be a big ask, I just need some direction here.

14 ответов

15 просмотров

No and Yes, it will depend, if your model, for example if you are going to take 5k, 10k, 15k etc. of beating per req/s the correct answer is yes, if not the answer may be no. It will depend a lot on the need of the project, for what you described your projects are mostly a monolith you can have a hybrid of this there depending on the need of course. There is no general rule, there are problems and needs to be solved with an architecture that best suits reality. When you work with a distributed system, communications with FRONT whatever the web, mobile etc. it has to be via websocket or long pool or some service that will communicate with your frontend with the answers.

Durability: What happens if your monolith fails? Right: everything fails, the entire business is down. This is really bad! If you split things up - some parts of the system might go down, for example you're unable to make orders, but you can still view and search through existing orders since those parts are operated by different microservices. Development: When you're working on a big business project, then you probably have a team of dozens of people all working on different parts of the system. Decoupling logic and data allows for better scalability and less friction during development. A microservice architecture isn't a universal solution since there's no silver bullet in software development. Sometimes when a simple monolith is the better option.

Justin-K Автор вопроса
Roman Sharkov
Durability: What happens if your monolith fails? R...

That's a strong case for microservices. I guess you have to think of frontend interface too quite differently, to hide all the disjointed data and accommodate such service failures. Going through one such tidy example would be great to pick and learn from.

Justin K
That's a strong case for microservices. I guess yo...

usually, I have a gateway service that clients talk to (through REST or GraphQL or similar) That gateway service has access to individual microservices. The frontend is not allowed to talk to individual services, it doesn't even know them, they're in their own network inaccessible from the internet.

Thirteen
How do you scale the gateway service?

you just replicate it, which is easy to do since it's stateless

Justin-K Автор вопроса
Roman Sharkov
usually, I have a gateway service that clients tal...

Yes something like apigee or mulesoft. Interesting, I have briefly worked on one. I was referring to how a frontend written using a react component architecture would have to accommodate for service failures in such a landscape, to render a consistent sort of experience.

Justin-K Автор вопроса
Roman Sharkov
you just replicate it, which is easy to do since i...

Yes all you would really need a copy of your rules.

Roman Sharkov
Durability: What happens if your monolith fails? R...

Erlang/OTP primitives solve the durability problem. OTP has supervision trees, which supervise other Erlang processes and supervisors. This way Erlang does ensure durability even with a monolith. Your system will still run if one component fails. That component will be restarted according to the chosen strategy. Ofc it can't save you from a full node failure

A​kshit
Erlang/OTP primitives solve the durability problem...

I don't see anyone rushing to write new things in Erlang tho 😅

Roman Sharkov
I don't see anyone rushing to write new things in ...

Well it's a nice in web services, but it's really widely used in telecom due to all the concurrency and fault tolerant stuff OTP and BEAM provides

Justin-K Автор вопроса
A​kshit
Well it's a nice in web services, but it's really ...

The stuff is indeed fascinating! https://www.cnblogs.com/bozhang/articles/3153031.html

Roman Sharkov
2013, oof, that article's 8 years old

The core design of OTP hasn't changed much. It worked 8 years ago, it works now :)

Похожие вопросы

Обсуждают сегодня

30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
Чёт не понял, я ж правильной функцией воспользовался чтобы вывести отладочную информацию? но что-то она не ловится
notme
18
Also, why can’t the community have a vote/ say when it comes to initiatives like buybacks. Isn’t the point of crypto decentralisation? Don’t we deserve input as long term supp...
👨🏽‍🦰
13
Привет)) уже кажется эту тему перемусолили, но вот я так и не понял. Я сейчас сижу на 27дюймов 2к мониторе. На Актуальной макоси, если я куплю 27д 4к монитор: - будет ли изобр...
Vladislav Piskunov
16
any reference of this implementation?
BitBuddha
29
Hi guys, any problem with Pulsebrige? Trying to transfer from wETH to ETH. First it tells me to connect my metamask "through mobile app" not desktop. Then I did and confirmed ...
Snowflakecrypto
13
Страшнейшая правда про списки ЦБ. С первых дней жизни P2P сферы, молодые человеки, начитавшись законодательной базы и "внутренних" документов, решили, что им противостоит сер...
Foxcool
3
У меня есть функция где происходит это: write_bit(buffer, 1); write_bit(buffer, 0); write_bit(buffer, 1); write_bit(buffer, 1); write_bit(buffer, 1); w...
~
13
Карта сайта