5 ms·
I wish the author discussed microservices in the context of domains and models. If you model your application and find a distinct isolated domains, then conside
by shusson 9y ago
I wish the author discussed microservices in the context of domains and models. If you model your application and find a distinct isolated domains, then consider creating separate services for them.
- kyberias 9y agoBut again, why? Making them services means distribution and that has a cost. You must have some reasons to make them distributed. You should first consider simply having the isolated domains as modules in your application monolith.
- bostonvaulter2 9y agoDoes anyone have good references for this kind of modules in Rails? Would it basically be a gem?
- mhw 9y agoIt doesn't have to be: you can use (Ruby) modules, classes and namespacing to split the application into logical pieces. Then start to enforce encapsulation between these pieces, so all access to a given piece of the system goes through a small, well defined and documented interface. If you are thinking about migrating to microservices at some point, it's also beneficial to try to limit the areas of the database schema that each of these pieces accesses. There's no point having lots of microservices running over the top of a single monolithic database schema: extracting microservices should imply extracting the relevant part of the database schema and putting it into a private database with operational access only through the microservice. You can make this much easier while still working in a monolithic application by being more disciplined about how much of the schema a piece of the application needs to know about.
- kyberias 9y agoModule is an overloaded term in software engineering. The most generic definition is just some bunch of code packaged somehow with a well defined interface. Ruby has its own kind of "modules": http://ruby-doc.com/docs/ProgrammingRuby/html/tut_modules.html http://ruby-doc.com/docs/ProgrammingRuby/html/tut_modules.ht...
- shusson 9y agoThe biggest benefit in my experience is reuse with separate applications.
- kyberias 9y agoYet you can package and reuse code without introducing the cost of distribution!