Architectures and Microservices with Darren Broemmer - RUBY 657 - podcast episode cover

Architectures and Microservices with Darren Broemmer - RUBY 657

Oct 23, 20241 hr 2 min
--:--
--:--
Download Metacast podcast app
Listen to this episode in Metacast mobile app
Don't just listen to podcasts. Learn from them with transcripts, summaries, and chapters for every episode. Skim, search, and bookmark insights. Learn more

Episode description

Darren Broemmer joins the Rogues to discuss how Ruby on Rails enables a microservices architecture and when it's appropriate to approach your system's architecture with microservices. Chuck and Dave lend their experience and expertise in pointing out some of the challenges with microservices and the power of Rails in enabling the Majestic Monolith. Tradeoffs are discussed and approaches are considered for when parts of an application may make a good candidate for microservices.


Links

Picks


Become a supporter of this podcast: https://www.spreaker.com/podcast/ruby-rogues--6102073/support.

Transcript

Speaker 1

Hey everybody, and welcome to another episode of the Ruby Rogues podcast. This week, on our panel we have Dave Kamia. Hey everyone, I'm Charles max Food from duv chat dot tv. Dave, It's nice to do a podcast with you again.

Speaker 2

It's been a while, hasn't it.

Speaker 1

I know, I keep winding up showing up when you can't make it, and then you show up when I can't make it. Yeah, of course now we both show up and Luke and John can't make it. So one of these days we also have a special guest, and that's Darren Bromer.

Speaker 3

Did I say that right, Darren?

Speaker 4

Yeah, Darren Bramer, Yeah, Bramer. Ah, I had a oe, said German. German a sound.

Speaker 3

Ah nice, sou.

Speaker 1

Do you want to introduce yourself, let people know who you are while you're important and famous and all that cool stuff.

Speaker 4

Absolutely? Yeah. Well, first of all, thanks a lot for having me on here. It's great to talk with you guys. So I've been engineer engineering my whole life. I will admit that I discovered Ruby a little bit later in my career. I was the Java guy for quite a while and going all the way back to two thousand and two, I'm going to date myself here. I wrote a book on Java J twoee. Actually, so there you go. There's a data bit of technology a little bit, and

so I've done all types of engineering managed teams. I decided I wanted to go back get hands on keyboard. After doing that, went to Amazon Web Services, had a great time working there, learned a whole lot, had a lot of fun, met a lot of great people, and then wanted to get more into kind of combined the two things I really really enjoy, so the technology obviously,

but also communications. And so now I kind of kind of went and switched gears of now the developer evangelist for engine Yard, and we have platforms of service tools. But I get to do my two favorite things, which are play with technology and share that with people, write about it and talk about it.

Speaker 3

Awesome.

Speaker 1

And yeah, we ran across this article from you talking about architecture and micro services and stuff, which is funny because I think on JavaScript jabber. We did an episode on micro front ends about three weeks ago. We recorded it. Anyway, we're a little more ahead on that, so it's probably

going to come out in a few weeks. But it's just interesting because people are talking about this and how to break up application logic and stuff like that, and of course in RAILS we all talked about the beautiful monolith and you know how that all kind of comes together to put it all in one app. And so, yeah, I'm kind of interested because I don't know that I necessarily got the breakdown on where you come down on this.

And I remember early in my career, like soa service oriented architecture was a big thing, and I think I gave a whole bunch of talks and gave a whole bunch of bad advice because it was the cool thing to do, and I was really in love with the idea.

But you know, been built a few apps and took it way too far and it was like, you know a lot of this stuff really does belong in its own app, and then some of this stuff it started okay, some of this stuff belongs in workers and some of this stuff actually, you know, may belong in its own service,

you know, micro service. And so you know, I kind of have gone back and forth as to how much you want to peel off into different parts, and so I'm kind of curious where you come down as far as Okay, what do I break off into micro services? What part do I keep in the monolith? What part do I you know, and how do I break that up? And then I also saw some stuff about containerization, so we can I guess dive into that next. But yeah, how do how do microft services kind of fit into Ruby these days?

Speaker 4

Yeah? So I think when you're looking at decomposing your application and doing design, you know, and and and really there's only one reason that we really do software design, right. We do it because we're probably going to need to change our application tomorrow, whether that be to fix some bugs or to add some new features that people want. We can't we can't, you know, add patterns and layers

of indirection everywhere. So we need to make choices. I say that because every time you add a layer of indirection, there's it's not free. There there's a there's a cost to it. Right. We can't optimize to be able to change every aspect of the application. You know. For example, I've been on a number of projects over my career.

You know, the team would be, well, we need to abstract this and that so that if we want to swap out the database later on, we can This is maybe a little less relevant now, but I think the example still holds, and so there was effort spin into that. Now, how many of those projects ever actually swapped out databases?

You know, I can think of maybe one that went from a relational database to a no sequel, and they would if they had to make broader changes anyway, So you need to you need to think about where can I decompose my logic into reusable bits. And when you think about the basic rails architecture model view controller, generally speaking, you try to push that logic down in that if you think about it as a layer down as far as you can. You know, validations you'll always need to

do before you persist to the database. Yeah, put it in the in the model class. But it becomes very tough when you think about this. You know, there's lots of best practice and things about where to put quote unquote business logic, and in my experience that often ends up coming back to the service level or in rails, you know the equivalent of a rail's action a controller method. So if I'm a you want your code to mirror the real world as closely as possible, and I was

you know, you mentioned earlier. I've probably given bad advice in my career in the past too. I used to be huge enthusiast of object oriented and while I think it's still valuable and has its place, I think in terms of decomposition, if you want to mirror the real world. If I'm a customer, I don't think of objects and entities. So let's say I'm going to go online to pay my credit card bill. I don't think about that in terms of, well, there's an account object and a vendor

and a payment behavior. I think about that of I'm going to go pay my bill. You know, it's it's an action I take, something I do. And so you can try to push logic further down this stack, but usually it ends up kind of bubbling back up to this service layer because those are encapsulated units of work. Now paying your paying your bill that now I personally wouldn't do this, But let's say let's say I was late on paying my bill, so I'm going to incur

a fee. So that's probably another service to calculate what the late fee is based on when I submit it. All of that so you can see you can see that kind of breakdown, and so reusing those services. And actually, you know, this almost gets back to like functional programming. It's funny how things kind of come full circle every every so often. But to me, the service level is the easiest way to decompose and be close to how

you mirror the real world. And if you can do that, if you can model it closer, you're going to be you're going to be better off in the long run when you need to make make changes. So now segue that into micro service because microservice often has the connotation of being a separate physical deployment. So there's different steps you can take to migrate this. Right, So you mentioned the beautiful monolith. I might have tons of code all

sitting there. It's in one deployable one deployable unit. You know, Rome's not built in a day. I can't do all of this at once. So you know, one of the articles I wrote that you reference was really just well, how do I take that first step? How do I go from the beautiful modelith to whatever my target architecture is, whatever your favored decomposition model is. So the beautiful thing. One really nice thing about rails is I think it helps you out here. So even in my existing code

base a controller action. Let's say you're using rack as you're middleware. That controller action is actually a wreck its own RACK application. So in the rack up file, rather than just doing rails application new, you can actually just point it directly to that controller action. So now you can deploy that as a deployable unit. It's going to use the same code base, but from a logical standpoint, I've separated that out from the rest of the system.

I can begin to reason about it more, think about what changes when, how do I reuse things? And then just to tease the topic a little bit, just to throw the container bit out there so it's an easier migration then to make it a separate deployable unit because that same image, that same codebase, I'm just going to have a different rackup file that I use for each of those. I can deploy those separately, I can scale

them independently, I can observe them. See you know how they behave If one if the CPU goes off, the rails on one of them is going to be easier to identify where the problem was. So you don't get those kind of advantages until you actually make them true micro services and you get that observability, but there's a lot of benefits when you start to go down that road, and rails I think helps. Rails gives you tools to help do that incrementally. So that's kind of an overview

of where I'm at. I don't I don't think there's one. There's certainly not a one size fits all, but to the extent that you can go with micro services to break that out from a logical design perspective, and then the actual deployment get the observability, scalability independence. I think there's a lot of benefit there.

Speaker 2

And so just because I can, I want to push back just a little bit and just to get some more clarifications. So when we deploy a now isolated bit of code as a microservice infrastructure speaking, what is going to look like as far as the database level is concerned. Are we going to spin up an additional database so now we have a whole new database server with a new database on there, or would we just create a

new database within a server. So if we're running postgrads, we have one instance of postgrads or a cluster, and then we have a new database for this micro service and that microservice only communicates to the one database or do they all share the same global database.

Speaker 4

Yeah, that's a great question, and you're poking at you know why. You want to obviously think through these things carefully, but yeah, no, it's a great question. So your your data, what does your data architecture look like? If you're starting out with the beautiful monolith, you do likely have that single transactional database. So to the extent that you can segregate out by you know which objects, which models or tables are used by sets of services, You're better off

segregating those and making those their own deployable units. You know, you're still going to have some potential level of contention because you've got different apps talking to the same database, and so you know one could have one could certainly impact the other. You can still have a noisy neighbor

situation there. But as you migrate over time, if you can decompose your larger architecture into those discrete topic areas where you can have different databases, then you get a cleaner isolation, and that typically takes folks a lot longer to do. And you can also end up in the spot well where I need I need data from from both places, and you can end up getting into performance issues because you get you know, pretty chatty between these services.

So so it's not it's not with it's not a panacea for sure, but I think to the extent that teams can start thinking in that direction and trying to find those what are the what are the good isolation boundaries to use? And again there is it's not a black and white topic, but there's no crystal clear answer, but I think there's over overall if you look at

how do I make changes right? Because in today's economy, you know, with the pandemic and people being at home, like we were already essentially a digital economy, it's almost entirely that way now. So you know, we're all forced to innovate so much faster, you know, deploy We were already deploying continuously, and now we want to do it even more. So if we don't do it fast enough, someone else is going to copy our business model, We're going to we're going to lose lose customers we could have.

So there's so much pressure to get features out there faster, and so again it's you know, you can't optimize for everything, but it's thinking about well, what is going to benefit me to isolate where I may want to be able to innovate faster move separate from the other aspects of the code. One problem that and even at Amazon our teams ran into this, especially some of the bigger services, where you really want to get a bug fix out

or some feature out. But if you're all in the same if it's all in the same kitten kaboodle, and you've got an issue that pops up with one of the other changes, you got to roll that whole thing back because at the end of the day, you can't have impact ongoing impact to your customers. And so that is something that I think really hurts teams their velocity when you've got to make sure that these twelve or twenty or however many features are all working perfectly in

order to get all of them out the door. So rather than an all or nothing, micro services really help you there. So you wouldn't isolate everything, but the areas where you know you're going to have a focus on, or you can predict, or you already know that are important to your customers, that's where you may want to think about it.

Speaker 1

So one other thing that I'm wondering about because Dave was like, well, how do you how do you deal with you know, the database level. I'm thinking, how do you figure out like traffic coming in right? I mean, do you have subdomains, do you have like Varnish or something on the front that you know figures out this path means this micro service or do you have them talk to each other through I've seen like rabbit MQ, which I've also seen be a headache. I mean, how do you work all that out?

Speaker 4

Yeah, So there's a number of solutions here. I think one nice way to start is just too And here's where an abstraction does actually benefit you, because you can put a facade in front of your service. And so maybe you start out with just actually just calling inline. You're just calling the class directly in your same Ruby process.

But that then that positions you so that when you do move it out to a service, you can swap that out and it's and it's less of a problem in terms of the domains I like, I personally like having the different subdomains part of that. I guess the product that I work with, Engineer facilitates this pretty nicely, where each of your apps within the same application just

get different subdomains. But there's obviously different ways that you can do it, and you don't actually you know, of course you don't need to split that out because you could just use different URL paths to accomplish a similar goal. But having the if you get it into containers and you can segregate, then you get those benefits of the physical deployment also. So to me, I would keep I prefer to try to keep it simple. You you know,

certainly there there's a couple different choices there. I mean I would probably if you can't avoid putting messaging layers in between, you know that if you can keep it simple, rest calls, you're you know, unless you need to do something different, I'd probably would advocate for that. You know, keep it as simple as possible, but no simpler. But there's also other tools and frameworks that help you do that. I haven't worked with it in detail, AWSS Service Mesh,

which helps you orchestrate all of these micro services. So there are there are things out there that will that will help you manage all of this, and probably those are worth it if you really get into large numbers, if you really your if your enterprise is you know, truly bought in and you're and you're going across many different departments in many different organizations. That's probably when you when you look at something like that.

Speaker 2

But yeah, so kind of where I'm going with the whole database side of things, because I agree, if you do have a micro services environment, then you should have a separate database for each micro service. But the issue kind of comes into play is when you sort off with just a few micro services, it's fine, it's easy to manage, but then when you scale up to one hundred to one thousand to ten thousand, it becomes less manageable, and your infrastructure cost also is scaling up fairly.

Speaker 1

Past five and I'm getting a headache.

Speaker 2

So the issue with that scene is when a micro service stops becoming a micro service and it becomes a monolith service to where you have now these twenty different or forty different micro services that just have grown and grown and grown, and now you have forty separate, full fledged Ruby on Rails applications that are so highly coupled and dependent on each other, that would it had been better to just have built it into one beautiful, majestic monolith.

Speaker 4

Yeah, I'm I think I had a similar reaction that Chuck had. If we get into the thousands, I'm completely with you, we've probably gone We've gone off the rails at that point.

Speaker 2

I think that's where Netflix is at. I don't know how many they have, but I've seen their data map of their micro services and communications. It looks like a whole globe of just jumbled spaghetti mess.

Speaker 4

I believe that's probably correct. I actually got to work with them a little bit when I was at AWS. They also are a bit of a snowflake because no, I mean, there are very few companies or organizations that have the amount of resources that they have. Companies like Netflix, like Amazon, you know, there aren't very many folks that can put that many resources on it. And they have

a vast amount of capability as well. I think for small and medium sized business, you're looking at a different category and a different type of architecture, and it would probably not be good if you got into those numbers. I will say, on the infrastructure cost point that you brought up, I think that would be true on if

you're on instances or virtual machines. However, containers are very efficient at this You can put a lot more container processes on the underlying hardware, and you can you also get a lot of those other benefits that I that I mentioned. So I don't know that the infrastructure cost would be quite as bad as you as you think

it is, because the container processes are pretty lightweight. They can start up in milliseconds as opposed to you know, like an EC two instance probably takes like between thirty and sixty seconds to start up, whereas a container, let's say it, let's round it off to a second. So you can scale those up and down really really quickly, and you can pack a lot more onto a physical cluster as well. So I don't know if that would

be as much of an issue. But on the on the complexity front, Tim, I agree, there's some point where it becomes unmanageable. Yeah.

Speaker 2

The infrastructure scaling pricing that I was referring to is more on the database side, because on a small tier

database that's really all the application needs. But because you have scaled it up to fifty or one hundred micro services, you're not going to be able to connect to that same database instance with the lower tier plan because the number of max connections that's available on those various plans, you would have to either spin up multiple database servers, in which case you incur scaling costs there, or have one really large database server where you have multiple databases

within there, and then you still incur a higher cost just for that max number of connections. Now, AWS may have something different now where you can allow more connections, but each micro service would need at least its one own dedicated connection to the database instance.

Speaker 4

Yeah, unless your databases are of pretty decent size, I would probably go the route you mentioned where if you're talking AWS, you have an RDS database and you can put multiple not instances, multiple schemas on there, right, so at least you can segregate it that way. You know, if many many of these micro services, if they have a smaller footprint, there's not no real reason to have a different physical instance, you know, you don't need to take that separation to the n degree. Not to be

too salesy, but we do. The company EngineYard also has a scale arc product which is a database proxy, which is also a nice way to actually get the three tier architecture independence actually separate out your application tier from your database by connecting to the proxy and then it can talk to all of these other databases make them look like different connections, do caching, intelligent caching, and security controls for you. Again, if you get into larger number

of databases, that might be something that's that's helpful. But yeah, packing multiple database schemas on the same you know, RDS cluster is actually pretty pretty good strategy in a lot of cases unless you have a really high volume er, a really large sized database.

Speaker 2

Whole container idea instead of the virtual machines I really do like and I think that especially even if you stick with a monolith version of your application to do auto scaling, you can more instantaneously respond to the demand coming in opposed to provisioning a whole new virtual machine.

So I'm really with you on there with using doctor containers and stuff like that, because I think that's the proper way to do auto scaling because you get instant reaction to your users instead of having to wait, Okay, we're at a fifty percent usage load across all our vms. We need to hurry up and add more servers, all automatically, of course, But then fifteen minutes later the server's provision and now it's ready. Well, that traffic's all said and done.

Speaker 4

Now absolutely, so yeah, these those two things that we've been talking about, the micro services and the containers are most certainly independent. So like you were just saying, even with beautiful monolith, containers give you a lot of benefit. They give you this scale, really fast scalability that you just talked about, and something we haven't even mentioned yet,

it's actually pretty nice for development as well. So developing with containers really helps cut down on how many times, how much time in my career have I spent getting my workstation, my development environment set up the way that I want it, and you know, managing those things. So using containers for development is really nice for that. There's also some really nice tooling to help out there as well,

so we offer dev spaces. There's also an open source gipod where you can with a single click bring up the online ide. It's running based on the container that you define, and you can also do some simple automation, so for example, you can have it on startup, do

your bundle, install, start your rail server. It opens up a preview window inside of your online ide, which is based roughly it's based roughly on vs code, so you can use those extensions as well, so, yeah, so you get benefits from containers, not just in the deployment, but I think in the development as well, and you know, hopefully never have to hear the phrase works on my machine. Again. That helps to alleviate some of those issues.

Speaker 2

Until you get half the developers using ARM the other half using xAd six platforms.

Speaker 4

Yes, there's a whole another paradigm shift that we now have to think about, right, Well, I know, yeah, I know a lot of the Ruby gems do work on it, but there's a handful that don't. And I know the company I work with as actually we're investing actually looking for rubis to help make get all of those gems up to speed un armed because the price improvement, sorry, the performance and price improvement is really significant. So it's a it's a big boost.

Speaker 2

Yeah, I couldn't have said it better myself. I have a eight core mac Pro one hundred and ninety two gigs RAM thing is a monster. Then I have a thirteen inch MacBook PROILM one with sixteen gigs of RAM. You know, whatever it comes with. I can't tell a difference in performance on my day to day tasks. I really cannot tell the difference. There is a huge price

tag difference. It's insane. So the ELM one, the whole ARM movement that Apple is doing, I think is amazing, and if they can keep it cost effective, then it's going to really make a huge difference in how we approach things, no.

Speaker 4

Doubt, one hundred percent agree. I really you know now that I'm a developer evangelist. I shifted from engineer too. I guess you could say I'm on the marketing side, so still an engineer at heart. But the phrase game changer gets overused so many times. When you go to conferences, you hear this is a game changer, that's a game changer. I think. I think the use of ARM, what we're talking about here, I think actually does fall into that category.

I think it's a big shift and you're going to see a lot of energy put toward that, and I think it's really going to help things out. I mean, people complain about sometimes rails being slow. It's like, well, if you run it on a faster computer, that that's a really nice way to solve that problem. Certainly certainly cost effective there, it's a lot cheaper than the person hours that you might spend diving in, diving into that potentially.

Speaker 1

Yeah, I want to move us back toward micro service here services here for a minute, because I just remember

the nightmares. I went, you're moving stuff to micro services back in the day, and I can kind of imagine scenarios that are somewhat obvious, right, I mean, you know, you can move your authorization right over to micro services and then you just you know, maybe do some permissions checks or you know, authority checks validate that somebody's actually who they say they are against their identity on the machine or on the other service, right, And so that's

kind of an obvious one to me. But I remember we tried to split our app up into services, and things were pretty tightly coupled together. And it's because the concerns kind of blended from one thing to the next, right from one step to the next or stage to the next, as things move through the system, and so there really wasn't a clear cut, a clear place to cut.

And so we when we picked one because it's like, oh, well, this is stage one and this is stage two, so we're just going to cut it between stage one and stage two. Well it turned out that stage one and stage two still have a lot in common, and so you know, there's not that clear delineation, and so it gave us problems. And you know, I'm thinking about some of the apps that I'm working on now and a

lot of them have that same problem. And that's why this monolith idea works really nicely, right, is because all of those concerns that kind of span the entire app are all in there. So how do you start to really think about Okay, you know this is a good option for a micro service, and this maybe does belong in a monolith.

Speaker 4

Yeah, it's a great question. So you know, I mentioned that earlier. I wrote a book with the phrase best practices and a title, and I think I have a little bit different take on that now. I believe that the use of micro services what we've been talking about, is a great practice to do if it works for you, and it's probably you know, it's not a one one size fits all, So it's more of a concept that

you can apply to your situation. If it's really hard to to untangle those concerns, you know, maybe maybe you just keep it in, keep it in that single app. Maybe it's not not worth doing, not worth the effort to break it out.

Speaker 2

So I basically have a general rule of thumb when it comes to micro services if this feature, you know. So let's give a real world example. Let's say if I'm in the business of PDFs and whether I'm a government or whomever, and I want to have the ability to take in a PDF and then have it automatically do the form fill out based on the parameters that are coming in. So this is a very useful feature for one of the applications that I'm developing within our

same organization. This feature is also very useful for five other applications that we're developing. So because this feature can provide a lot of usefulness to these five different applications, and we can come to some kind of compromis or agreement on its API of how it should look. It should be taken a form post with a list of parameters. It should have an idea of a PDF that is stored on the database or wherever it's stored. Then we

can have one codebase that serves five applications. So I think that's a good use case of a micro service. It does one thing, it does it really well, and it is highly reusable, not only in my application, but in multiple other applications.

Speaker 4

Yeah, that's a great example. And I think that if you've identified that as a needs used in more than three places, which is a good general rule for reuse, so you know you want to package that up and not repeat yourself across that group. So how do you deliver that capability to the other users of it or even reuse it yourself? And so you know, you could just point point the other teams or the other developers

to the repo. You could build a gem package it that way, which is also a nice way to do it, or the route that you described. You could make it an API or a micro service and it is it's well defined and it is that that's a perfect use case for a micro service, I will say, Chuck, you also brought up the authorization. So those kind of you know, non functional concerns are prime candidates as well. They're easy

to separate out from the rest of your application. It's where you get into the nitty gritty of the business logic or workflow where it becomes a little bit harder to do it. I will say, though, to try to tie some of these threads together. You mentioned earlier Dave that Netflix has thousands of these and really Aws does too. So one thing I realized that when I was there.

You know, one of the best things that Amazon does is they make each team be essentially like its own startup company, so that that team can innovate as fast as they can and deliver value to customers. And then I also say, the worst thing that they do is that very same thing, because you have all of these teams not always marching to the same beat and kind of repeating some things are not always always going in the same direction, but all of these different web services are.

It's not really Customers think about it as one infrastructure or platform that they're using, but it's really one hundred and fifty different services. I think the numbers actually higher probably now. And so when you're building one of those, you're using easily, you know, ten or twelve other ones in order to compose your application. So I worked on a security service. I helped build Resource Access Manager, and so you know, in terms of like monitoring and other

kind of things, you know, we obviously we don't. We didn't build our own monitoring service. We use cloud watch for example, and authorization of course we use. We used I am identity access manager. So it's really those are good examples of large sets of services. You can think of them as micro services. Some are more coarse grained, but in order to build up these really large, really large platforms that can do amazing things that run run a majority of the Internet when you think about it,

and so there's there's a lot of capability there. Again, it comes with the caveat Like we talked about before, those type of companies have, you know, armies of engineers who can work on all of these things. Most of us are not in a position where we have that many other teammates and teams to help us do this. So you kind of have to right size these design principles for the scenario, your scenario you're working on. But yeah,

there is no one right answer. You always want to apply it to your situation.

Speaker 3

I guess.

Speaker 1

The other the other end of that right is how big does it have to be to warrant putting it into a micro service as opposed to putting it into a delayed job sidekick rescue worker, or just sticking it in like lib or app services or whatever, as just the library that just does a thing right and then just gets called out somewhere.

Speaker 4

Yeah, I would, So here's where we get into. I would evaluate the deployment or sorry, the operational aspect of it and see what you can get there. So, if it's a sidekick job, you're going to have a little less You have to make sure you build in the metrics and the visibility to see how that is behaving. If it's its own micro service, which you can, let's say it's in a container, I can observe that independently very easily. I can scale it separate from everything else.

So if you let's say you have your web app and a sidekick process, so you're taking orders on the front end and Sidekick is doing some fulfillment on the back end. So if you make a change and let's say that the CPU spikes or you identify a memory leak or some other problem, you know it's not going to be immediately obvious. Well, was that one of the changes I went into the web app or was it the asynchronous job, And then what's the impact of that?

The impact is much different, right because your focus, you should have a relentless focus on your customer. So if it's the web app, they can't take any orders. If it's the sidekick process. It's like, well, that's a little bit better. I can still accept orders and I'm going to hopefully get that business. I might just be a little delayed in getting the shipments out or processing whatever,

whatever it is. So having to be its own if it's valuable like that, right, If I can get benefit from observing it and scaling it separately, then you're in a better spot. If you need to scale up that back end process, if it's doing more work, then you know, maybe it's nice to have it in a separate deployable unit.

But those are the types of considerations that I would look at as opposed to, or in addition to, I should say, the separation of concerns and how easily how easy is it for me to make code changes if I need to innovate AD capabilities.

Speaker 2

Yeah, so I have a little story that I'll try to make tangible to this. So I've had a number of dogs growing up, and one of the dogs, you know, was a border collie. So the nature of the border collie is a hurting animal. And if we had installed an invisible fence around our yard, it really would have confused the dog because that dog is meant to be more free, and it would have hurt its nature essentially. So we got a chain link fence which was a physical,

visible boundary around the yard. And I had another dog whom was not a hurting dog. They're more of a guard dog. So that dog wanted to be around me all the time. It was a rot Wilder Doberman mix which I named her Kitty, but that's a different story. And I could let that dog out of the yard, you know, into a open backyard and run free, and we never had to worry about her because she always quickly came right back to us because she wanted to be right there next to us. She wasn't interested in

hunting or hurting. So the idea of in translating this back over to what we're talking about with micro services versus monoliths, I think that the monolith is more like that big open backyard without any boundaries. And if you're not careful, it's not a matter of if, but just a matter of when are you going to to have an accident or mistake on your hands because you have

now gotten too much cross contamination within your application. You weren't careful with the boundaries and you broke a lot of single responsibility principles, and now things are too tightly coupled and intertwined in together, and you have a mess. Whereas the fenced in backyard is more like the micro services, where you are forced to stay within this confined area, which means you're forced to think about and write the single responsibility principles because you don't have access to the

outside world beyond your gated fens. And I think that if we are talking about a single application, that its codebase is never reused anywhere else. So I think that we can train ourselves as developers to have more responsibility in how we are writing our code, to not introduce a lot of this cross contamination of logic which really

should be separated out. And by doing that, like Chuck said, with the lib or app services or interactors, whatever kind of naming you want to call it, but these plain old Ruby objects where you're encapsulating and building these virtual fences around that bit of logic, then you're able to create the idea of the micro services without breaking up the majestic monolith.

Speaker 4

That's a great analogy for separation of concerns. I got to remember that one and use that in the future. The dogs in the fenced in backyard. I like that. Yep, yeah, I mean I think that you brought up a really good point. It's like, well, you know, we're all if we're all in the same backyard, you know, how long will it be until we all you know, cause problems We bump into each other trying to get our work done. You know, one person is cutting the grass in the

backyard while the others are trying to play volleyball. It just doesn't work very well. And so, you know, we talked about actually like as it gets bigger, it can get more complicated. But you can look at it the other way that as you know, it's easy when you're getting started to have it all being you know, app and live, it's actually as you get bigger and bigger where it becomes more of a challenge because changing one thing has ramifications and unintended places, and that's really one

of the one of the big challenges. There's a pretty nice tool that I've been working with or testing out called app land and its it's a it's open source, you can grab it and it gives you a nice visual map of the connections the call stacks and you can see how your components are related. You know, I always like to see I'd like to have a visual or mental model in my head of their requests coming in and how the route that they take through the

controller and what objects they actually use. And this gives you a nice kind of visual representation of that. This was actually something that I thought about when you know, I first started doing Rails and Ruby, which I mentioned, you know, like six seven years ago. And when you do Ruby or sorry when you excuse me, when you do rails new it's interesting you actually get I think it's about fifty files with five hundred lines of code,

give or take. And Rails isn't embarrassed about this either, because you can do bin rail stats and it'll tell you exactly how many files and lines of code there are. So that's a lot of code and a lot of files just to do a Hello World. Right. If I was going to compare that to no JS, for example, I think probably one file maybe what like five lines something like that. But that's there's also the positive aspect of it that it gives me. It prescribes a lot

of things for me. I always if I know, if I want to find out where a controller action is. I know exactly where to look. If I want to find where the images are located, I already know. So it gives me a great framework to get started. It doesn't, you know, it's not going to stop you from dumping, from making your your helper's directory become a dumping ground for every everything known to man and having all kinds of all kinds of stuff in there. That's not going

to prevent that. And that's where the backyard can get kind of messy. I will say the one having worked on a lot of different projects in different languages and technologies, it's nice, you know. It used to be that on every project you would have the infamous like string helper class, and so it's nice that we don't have to do that in Ruby because the string the string class is pretty rich and as most of what you need, so

we don't we don't have to do with that. But you know, helper directories always things like that can get messy pretty quickly if you're not careful. My daughter has a multiese poodle, Peanut, and I'm pretty sure when I take Peanut out for a walk, if I took him off the leash. I'm pretty sure he would go running. I don't think he's the guard dog that that would stand by my side. He'd be you know, like down the road checking things out. That he's probably like, finally I get to go run around.

Speaker 3

Yeah. That's funny because when I was a kid, we had two dogs.

Speaker 1

We had a cocker Spaniel and you know, so she was kind of a little dog, and then we had a miniature Chihuahua and she was a littler dog, a much littler dog. She weighed about a pound and a half. Oh wow, Yeah, she was tiny, and we the cocker spaniel couldn't get out of the backyard, but she could dig holes deep enough for the chihuaha to get out of the backyard. And there was nothing we could do to stop it. And so and that, I guess taking

that metaphor to the next level. That's the other thing that you find is if everybody, if you share the backyard, somebody's going to find a way to dig a hole to let people out.

Speaker 4

That's a great point. So years will always find a way.

Speaker 3

So now we're in a Jurassic Park.

Speaker 1

But anyway, Yeah, it's it's definitely interesting to think about But at the end of the day, I mean, we're we're just trying to solve problems, right. And it's it's interesting too because I keep having the conversation with my coworkers and it's you know, I shouldn't suggest this because this is work that I don't want to have to do, but this is probably the right solution to this problem.

And you know that's what we're in it for, right, We're in it to solve these problems, right, And so sometimes it's going to be micro services is you know, a terrific way to solve the problem. And sometimes it's going to be, hey, you know, we need to keep all this stuff together so that it kind of all moves and works together in this way. And sometimes we're going to be in a situation where we just have to make a judgment call.

Speaker 3

And so I like that.

Speaker 1

That's where this conversation is gone, where it's hey, look, these are some of the trade offs that come in this way or that way, and these are some of the considerations you're going to wind to make in.

Speaker 4

Yeah, that's really that's really well said. These are different tools in the toolbox, and yeah, solve solving problems is one of the greatest parts about being, you know, an engineer and doing what we do probably closely followed by seeing our users and customers actually get to take advantage of these these creations that we out into the world.

Speaker 2

Yep, absolutely, because I mean, let's face it, if you have a really pro team that follows wonderful practices, they're very consistent and there's no hidden surprises, and if you create a monolith, then it's going to be very maintainable, it's going to be well tested and you're not going to have any problems. Take that in compared to a team that is not very well versed. They are not

consistent and they're creating micro services. Now you have an application which consists of one hundred microsurfaces and each one is its own nightmare. So and it can go either way. You have a team that's great with micro services, they're great with practices, and everything is consistent and isolated in these micro services, and it's could be a great application. But then you have a team that's not as well versed and they are just creating an insane monolith that

is just unmaintainable. So it's a healthy balance of choosing the right tool for the job and making sure that you have the team and budget to match, as well as the infrastructure budget to host, because as we said,

there could be differences in which direction you go. So overall, I think that because I've worked primarily on Ruby on Rails applications, micro services doesn't really have a fit in my world because I think the convention over configuration that Rails his provided me, plus the practices that I have developed over the past ten twelve years, has really negated

the need for micro services in my world. But that could be a different story for someone else where micro services is the answer for them.

Speaker 1

Yeah, I also just want to I should point out so the app that I work on primarily these days for my full time job, it was written to replace another app that was written in another framework, in another language, and essentially it was written very quickly by some very talented engineers. But it was written very quickly, and they threw a lot of best practices out the window just to get it out the door. And so we're dealing

with those the fallout of that stuff right now. Right because we're now in the second year, we're coming back around to, you know, essentially another iteration of what this thing does, and you know, and so we're coming into Okay, we've got to deal with this, and we've got to do with this, we've got to deal with that, we've got to deal with you know, these other things. And it's you know, it's yeah, you know what Dave's saying.

It's just not pretty. And it really does, in a lot of cases, come down to your discipline and your willingness to look at these problems and identify where these things are going to come up right, and so you know, whether or not you use one architecture or the other, whether or not you make these decisions one way or the other, what it really comes down to is your discipline in implementing them and approaching these problems in a way that is going to solve the problem in the

long term. And RAILS does a lot of things that makes it really easy for you to approach this. From the majestic monolith, I kept saying beautiful monolith at the beginning because I couldn't remember the word that dhhused in his blog article. And I have the article up now in front of me, so I'll put on link in the show notes. But you know, and that's his approach

and so that's the approach to the from rails. But as Darren pointed out, you know, there are a lot of things in there because it's built on rack that it does exceptionally well. That allows you to break it

out into services if you need to. And so because of that, it makes it, you know, really versatile in your approach, and so you know, find the approach that works for you and then just be disciplined in the way that you approach it so that it does the work that you need it to do, solve the problem that you need to solve. And that's the that like, like Darren said, this is the really great part is that we get to go in and we get to

figure out the pieces to the puzzle. It's like playing a video game, except at the end of the day it's not the prescribed path through the level. It's the Hey, at the end of the day, we got the problem solved and we get to do some really cool stuff along the way to figure it out.

Speaker 4

Yeah, those two points, those two points were spot on. Right at the end of the day, there's no there's no until AI advances to another level, maybe there's no replacement for the design and the discipline, Right, So you do that design upfront and it's like what's best for

my situation, and then the discipline. I think that you know, even after you've agreed on the design, I think there's no substitute for those code reviews, right, Like, that's that's where you're really like, Okay, are we are we really doing what we said we were going to do? We

are we following our guidelines? You know. That's how you make sure that you accomplish that goal and you don't end up kind of in a situation like you describe, where a lot of people find themselves with a code base that has a life of its own, its own personality, for whatever reason that it ended up being created that way. Right, there's always reasons that at the time that get applied, but there's just no substitute for those things. Yeah. I've

worked previously. I worked in environments where we did not review every line of code, and then more recently I did, And it's hard to imagine not having code reviews for everything anymore.

Speaker 1

Yeah, So real quick, I'm going to throw out a couple of resources and then we'll get to picks. One is you mentioned machine learning and AI and I have to say, we have a machine learning podcast. You can go check it out at Adventures machine Learning. Just go to devchat dot tv click podcasts up at the top and it's right there Adventures and machine Learning. Or you can find it in your favorite podcast app. Just do it search Adventures in Machine Learning.

Speaker 3

You'll find it.

Speaker 1

It's got kind of a face and some artwork. Anyway, it looks really cool and I'm very proud of it. And yeah, one of the hosts, he's a really good looking guy. And yeah, Migael's pretty cool too. The other one that I'm going to throw out there, and you know, because we're talking about discipline and practices and things like that. I had a really terrific conversation with Bob Martin about clean craftsmanship and he talked about practices. Oh man, I'm

gonna blow this so hard. Practices. There were three levels to it. The third one was ethics practicals. I think it was disciplines. Principles was the principles anyway, go listen to it because he breaks it down. And the first

level was he talks about TDD pairing. You know those kinds of things where you know, like you're talking about the code reviews kind of falls underpairing, right, and then testing of some kind right under TDD, you know, and some of these other things where you're just doing these practices that get you to.

Speaker 3

Where you need to go.

Speaker 1

And then you have standards, right, That's what it was. It with standards, and so what are your code standards? Right, that make the code the kind of quality that you have to do. And then the ethics where you know, the kinds of things where it's and he has the programmer's oath is what he calls it, and we kind of talked through that.

Speaker 3

We have another.

Speaker 1

Episode where we talked about that on the Clean Coders podcast, But he talks about you know, hey, you know, am I making the code based better? Am I delivering for the company that's paying me for my time? Am I delivering code that meets the kind of standards? Am I improving my skills so that I can deliver for my team?

And you know, things like that, and anyway, it was really really interesting conversation and that's the kind of thing that we really need to be talking about too, within our within our teams and with the people that we work with, because at the end of the day, it's not just Hey, here's the technology and the technical approach that we used to solve the problem, but it's yeah, what are we doing to make sure that it's the

right solution to the right problem. What are we doing to make sure that the code meets the standards that we have for the kinds of solutions we deliver, and what kinds of things are we doing day to day in order to make sure that we are delivering for the company that we work for, delivering for the team we work with, delivering for the world at large, and things like that. So anyway, terrific conversation. I'll put both of those links in the show notes, and yeah, let's

go ahead and new picks. I'm going to push it today. First, Dave, do you have some picks for us?

Speaker 2

Yeah? Sure, So my first pick is a pack tool Gecko Gauge. If you've ever had to work with hardyboard, which is the cement fiber boards that you put on the side of houses, then this tool is amazing. It allows you to just clamp onto the previous fiber board that you installed and then set the new one just right on top. It'll be completely leveled to the other one. It is a life saving tool for working with hardyboard.

And the whole reason why I picked this up is because I'm building a shed underneath our deck and I'm now getting around to the part where I'm doing the sighting to make it look like the rest of the house. I was not going to be able to do this job without that tool. So it's amazing. And on the date of recording this podcast today is April first, i

launched a new tutorial site. So I've been doing drift and Ruby for many, many years, over two hundred eighty episodes I've recorded on Ruby and Ruby on rails, and so today I've launched a new training site and that is drifting Cobal. So you can go to driftingcobyl dot com and you'll see that it's a completely satire side for April first, but hey, if it picks up one subscriber, that's like ten percent of the entire Cobalt user base, so I'd say that's when.

Speaker 4

Wow, that's amazing. I actually did Cobal when I first started programming dating myself again, so this is great to see.

Speaker 3

Nice, very cool. I'm gonna have to is that a punch card?

Speaker 2

It is nice, It's not a real punch card. The real punch cards were more like the this is.

Speaker 4

This looks like a copy book description almost Yeah, your data formats.

Speaker 3

And oh I'm tweeting it right now.

Speaker 4

It is a good It is a good call out that we are recording this on April first. When you all asked me to be a guest on the podcast, I wasn't sure if you were joking or serious.

Speaker 3

Hey, you scheduled it not us fair enough?

Speaker 4

Fair enough?

Speaker 1

Yeah, all right, I've got a couple of picks I'm gonna throw out there. The first pick that I have is I've been using this tool I'm really liking. It is called click up now. If you have used no notion dot so I've picked it on the show before. Notion is kind of an all in one how do

I put it? It's supposed to be kind of a wiki slash, trellos slash, to do list slash anyway, it does not have any kind of automation, and it doesn't integrate with Zapier, and so I quit using it eventually because I just couldn't.

Speaker 3

I couldn't do with it what I wanted to do.

Speaker 4

Right.

Speaker 1

Well, clickup has all that stuff built in and what it doesn't have built in it actually integrates with Zapier. So I'm really really loving this tool, and so I'm actually moving as many of the workflows for.

Speaker 3

Devchat dot tv over to it as I can.

Speaker 1

A lot of the stuffs still on Trello, and that's where I wound up moving a lot of this stuff too, so it's going to take some time to move it over. But I am really really looking forward to some of this stuff. I can actually include some of the other folks from dev chat dot tv on it, and so I'm looking at instead of for example, we have some automation that's built into Zappier that's supposed to like pick things up and send out a calendar invite and set

up a Google doc and do all this stuff. And I'm hoping that I can move all of that into clickup and then just invite our podcast guests as guests

on the test. That's the only part of it. I can't guarantee what'll work because I haven't double checked on that, But for the hosts and everybody else, I can actually go in and do that, and I'm hoping to be able to automate all of that stuff so that then it comes back after the episode and says, because we manually have to follow up, Hey, can we get a description for the episode and a title for the episode? And because I'm not on all the shows, and so I'm kind of the backup on the shows that I

show up for. But if I'm sick or if I'm just not on the show like Adventures in dot Net, I'm practically useless on that show anyway, Right, I can kind of make it up and go look up the terms. I don't know, but realist, right, if they're talking about like some deep library NC SHARP, it's like, okay, what is this thing?

Speaker 4

Right?

Speaker 3

And I have to go do some research.

Speaker 1

So that's what I'm looking at doing, is just automating the crap out of that. And so I'm pretty excited about that and working through it.

Speaker 3

But if it lets me automate all of that stuff, I'm going to be one happy dude.

Speaker 1

And so I'm going to pick that. The other thing that I am also going to pick is dev influencers. So dev influencers dot com. You've heard me talk about dev heroes, that's now dev influencers. So if you're looking at kind of that next stage, or if you're in a position like Darren, where you're a developer, evangelist, or you're trying to you know, gain some kind of audience,

you know, where you're trying to get noticed. I'm putting together basically a coaching program and I currently have five people in there where I'm coaching them every week on Okay, here's how you build an audience. I'm focused on podcasts, So here's how you build an audience. Here's how you build your podcast. Here's how you get people to listen

to it, Here's how you grow it. And then from there it's here's how you build it into Some people want to do speaking, some people want to teach live training, some people want to do courses.

Speaker 3

Some people want to do.

Speaker 1

I mean, you know, there are all these options. Build their freelancing practice, get a better job. All of those things are things that I have done out of podcasting while I'm working on the course. But all the other things are things.

Speaker 3

That I've done out of it.

Speaker 1

Right, I have a book that I've written that I've sold off to the back of the podcast, and so if that's something you're interested and you can go check it out. But if you want a podcast about it, I'm putting that out too, So go check it out dev influencers dot Com slash podcast and you can check that out there. You can also go to dev influencers dot com slash apply and you'll put your email and

name in. And that's just so that some people, for whatever reason, they hit the thing on their phone, the application, and then for whatever reason they don't get the information in. That's so that I can just remind them, hey, look, yah, filled it out. Can you come back right? And then I'm planning on sending some emails out and some other stuff,

putting some other stuff together there. But yeah, dev influencers dot Com that's where all that stuff's going to be for the podcast, and I'm going to be talking about how to advance your career. A lot of people they get stuck at senior developer, that's the other thing, and they're like, I don't want to be a manager. I don't really want to go architecture or whatever. I want to keep writing code and this is a way you can do that. So anyway, dev influencers dot Com. That's

kind of my thing. And that's not an April Fool's joke. Darren, Do you have some picks for us.

Speaker 4

Yeah, well, I'm going to go ahead and mention if you like Ruby and rails and you like the getting those benefits of containers that I talked about, definitely check out engine yard containers. That's our the next generation platform. You can go to engine yard dot com. You can also on that site go under resources on the blog. You can check out my Ruby Unbundled blog where we talk about the different architecture concepts and and other cool

things that I find fascinating about Ruby. But yeah, so engine Yard containers is a great way to quickly deploy those Ruby apps, scale them up, and get some of those observability and other benefits we talked about. Am I allowed to do that for a pick? Is that okay?

Speaker 3

Absolutely?

Speaker 1

We usually ask you to at the end where people can find you, So that's that does help.

Speaker 4

I'm ahead of the game, yep, I would. I would throw in mentioned the other app Land is a really nice way to figure out what's going on with your codebase as well. I would throw that out there as my other pick they have. I think app map is actually the gem. App Land is a site if you want to share those across different users on your project.

Speaker 3

Awesome. All right.

Speaker 1

Well, and then I'm assuming you're also on Twitter and facebo, Facebook, Twitter, and GitHub.

Speaker 4

I am at Darren Bramer d A R R E N b r O E M M E R. I probably need to get a better Twitter handle, don't I that's too complicated, but it is my name, so you can. You can find me there. And on GitHub, I have my old user ID, just letter D and then the first seven letters of my last name, D Bromine, so that's me on GitHub.

Speaker 1

All right, cool, all right, well, thank you for coming. This was really really fun. Yeah, thanks you so much for having me. This was great.

Speaker 3

Yeah, it's fun to argue about architecture, right.

Speaker 4

I love it. I love it.

Speaker 3

This is what it's all about, all right, folks. Well until next week, Max out

Transcript source: Provided by creator in RSS feed: download file
For the best experience, listen in Metacast app for iOS or Android