Welcome to the new week! For a long time, I’ve wanted to talk more about Frontend Architecture. In my projects, I always enjoyed delivering features end-to-end the most. That gave me the feeling of completing and delivering something useful for the user. There were times when I just did backend, times when I was only doing frontend, and most of the time, working full-stack. For many years, the front end was treated as a side effect of the backend processes. Probably because initial systems were mostly about automatic processes, document workflows or calculations. Nowadays, we have more user-facing applications. Fluent User Experience and nice User Interface are values of their own. Single-page applications emerged together with frameworks like React, Angular, Vue, etc., changing the scene of our systems. More and more responsibility was pushed to the front end from the backend. Frontend applications had to be standardised and stopped being just the tip of the iceberg for many systems. That’s why I wanted to discuss Frontend Architecture, and I’m happy that our special guest, Tomasz Ducin, agreed to discuss the current state of the art complexity, where to draw lines, and all that jazz. I wanted to invite Tomasz for a long time, as he’s one of the best people I know, specialising in Frontend and Architecture. He’s Independent Consultant, Architect, Developer, Speaker, Trainer. Expertise in Web Technologies & Software Architecture. Angular Devtools Contributor. Egghead Instructor. Still, the trigger for our discussion was his great article (or actually, a rage post): What is Frontend Architecture? (https://ducin.dev/what-is-frontend-architecture) That’s where we started, but where did we end? Our talk went deep into what it actually means to design a frontend architecture - and whether it should be called “frontend” at all. We discussed how architecture, whether frontend or backend, isn’t just about structuring files or picking tools. It’s about decisions that shape the system's core, affect its performance, scalability, and maintainability, and can be tough to change later on. Tomasz explained that many frontend developers still think of architecture as file layouts and tool choices when it’s more about the trade-offs, like deciding on a centralised state or choosing when to use micro-frontends. We agreed that while the backend and front end have different demands, the two “camps” could learn a lot from each other. For instance, frontend devs could benefit from backend principles like domain-driven design to better understand the business problem. In contrast, backend devs could pick up on the frontend’s efficient prototyping and structuring of applications into components. Not surprisingly, we also discussed Conway’s Law. Who knew?! We discussed the impact of various ways to structure our teams, such as cross-functional, front-end and back-end separated, etc. One key point was the benefits of creating cross-functional teams to bridge the frontend-backend divide. Teams that work on both frontend and backend deliver features faster and communicate better, lowering the “communication cost.” It’s all about aligning with the business goal and Conway’s Law - your system’s structure will reflect the way your teams communicate. So, putting frontend and backend together in the same team creates a smoother, more user-focused workflow. Our discussion wrapped up with a big question: do we need separate frontend and backend architectures, or is it all just architecture? What was the answer? Check in the video! Especially since this video is free for all subscribers! Bon Appétit! I believe this talk was a nice wrap of the common discussions and issues with frontend vs. backend responsibilities. We covered common challenges and potential solutions. We’re thinking with Tomek about doing a deep dive on the specific topics in Frontend Architecture (e.g. micro frontends, state management, etc.), so please leave us a comment if you enjoyed it and what you would like to cover! Check also more from Tomek: * Blog: https://ducin.dev* LinkedIn Profile: https://www.linkedin.com/in/tomasz-ducin-82234a4b* Twitter: https://twitter.com/tomasz_ducin,* Egghead courses: https://egghead.io/q/resources-by-tomasz-ducin,* His Polish course Architecture on Frontend (yes, it’s polished!): https://architekturanafroncie.pl Check also other webinars! Cheers! Oskar This is a public episode. If you would like to discuss this with other subscribers or get access to bonus episodes, visit www.architecture-weekly.com
Audio and video play straight from the show's own hosting. PodSubs stores and serves no media.
Transcript
From the show. Tap a time to play from there.
SPEAKER_02uh hey folks uh welcome to the next should i call it even a podcast it's i think it's not even a webinar is not the proper way but nevertheless however we call it the most important is that we have today special guest tomas duchin i'm really happy that tomec because thomas is tomec in in short in polish I agreed to join because Tomek is one of the best person to talk about the frontend architecture,
SPEAKER_02at least of those that I know and I'm following. So today we will be talking about the frontend architecture and architecture in general. We will try to cover all those differences or maybe why we have those differences between frontend and backend. And Tomek, would you like to add something more about yourself for our viewers and listeners?
SPEAKER_00Yeah, so first of all, thank you very much, Oskar, for for letting me be your guest, because I really like this, this could sound a little cringe, but I also follow what you're posting and what you're creating. And I really like Yeah, I admire all the creations, all the stuff that you write and that you publish. So yeah, it's my pleasure to be your guest. Yeah, so just a quick intro. So I've been working mainly in big products in industries such as finances,
SPEAKER_00banking, real-time data, analytics. that would be it. I used to be a developer, team lead, architect, and so on and so forth. And something like eight years ago, I started my consultant's journey as an independent one. So what I do right now is basically helping other teams or products to overcome obstacles related to performance, testing, architecture. Some people are considering whether to go into micro-frontends or not,
SPEAKER_00or they expected something to happen after the transition, but it didn't happen and this is where I come in. And apart from that, I do trainings related to frontend and architecture, just as you said.
SPEAKER_02Yeah, so Thomas also is doing the courses on edge head at head IO. And also, he has not so active recently because of child I think, but really nice YouTube channel on the on the frontend and TypeScript. I learned also a lot from that. So I also encourage you to check that. I will add links under the video. So if you're watching that, then you already have it right there.
SPEAKER_02So one of the triggers for our discussion was your recent article about what is frontend architecture. And frontend was with the brackets. And when I read it for the first time, then that sounded to me a bit like a rage post. Was it like that?
SPEAKER_00Well, our current talk right now is triggered by the article and the article was also triggered by yet another conversation that sparked from I'm not sure whether it was during a training or some convo on social media, but yet another person, yet another time wrote that basically directory structures and files, file directories, et cetera, is basically balls down to front end architecture.
SPEAKER_00And basically, you know, my heads, you know, were just over flooded with blood. So I just, they say that if you need to repeat something three times, at least, then you should write about it. And this is something that I used to repeat, I don't know, maybe even 50 times. So I decided, yes, this is finally the moment to challenge that misunderstanding, misbelief, I don't know how to call it. I believe that it's very difficult, it's very challenging for me not to do too many generalizations.
SPEAKER_00But I think that quite too many front-end developers, front-end engineers have quite vague understanding of what architecture is all about. So the two main challenges or obstacles, I would even say, is over-focusing on the tools and over focusing on the things that you can immediately see from either the code or the files or their structure or whatever and what architecture is all about is
SPEAKER_00about the things that are not that easy to see just from a you know very quick look very quick glance so i kind of challenged this well not only the directory structure because this is quite easy to challenge but i also gave kind of, I don't know, handful, dozen of examples like that sometimes when you make a decision, an architectural decision, you can look at it from different perspectives and that what really matters in considering application or system architecture is the characteristics that you give
SPEAKER_00or limitations that you bring, the opportunities that you introduce. And not exactly the tool, the convention or the structure that you pick, because this is quite often something that has little relevance and the characteristics that you bring or that you reduce or even you close the doors that something becomes impossible. This is what matters in the long run. And this is way more difficult to reason about in the long run.
SPEAKER_00So, yeah.
SPEAKER_02Yeah. so yeah what i like about the article but it was also a hard for me a bit because uh actually my understanding of this article was it that it was explaining what is architecture in general. So it was really focused on this decision making and which decision could be considered important. Of course, that's a hard thing to decide.
SPEAKER_02But, and it was nice that you had those examples, like choosing to implement frontends, micro frontends or not, or whether that this is like a significant decision, but whether which tools, so for instance, Webpack Module Federation or some native stuff or whatever, it's not so important to be considered architecture. So the hard part for me was that actually understand why are we even calling that a front end architecture then?
SPEAKER_02So what are your thoughts on that? Why do we have this distinction between you know, yeah, architecture and front end architecture?
SPEAKER_00Yeah. So, well, people could have different take on this. I believe that architecture is mainly about the, yeah, as you said, the decision-making, the trade-offs and the impact and the consequences and the things that are difficult to change in the, in the long run, et cetera, et cetera. So we have, you know, a handful of, of these definitions and yeah. Well, people can have different takes. My understanding is that somehow front-end development and back-end development
SPEAKER_00kind of divided into two tribes that are living in their own bubbles. And yeah, there is too little of knowledge sharing and experience sharing between the two groups. And what I also found out is that at least the people whom I had pleasure to work with do not read enough books when it comes to basically the classics.
SPEAKER_00The things that we are discussing in engineering landscape and industry have all been classified carefully thought out, written down in books, analyzed, etc. They just have different platforms. For instance, all the messaging solutions, etc. This has all been already described. What changed is basically the scale of the applications and that we have cloud. So this didn't exist 20 or 40 years ago, but the patterns are the same.
SPEAKER_00And what is kind of both funny and kind of sad at the same time is that we in the front end world tend to kind of rediscover some patterns or maybe to some extent reinvent the wheel. But also what makes it slightly more difficult is that Well, the frontend is first and foremost an interface and it has a totally different range of responsibilities. So there is hardly any persistence or in vast majority of the cases,
SPEAKER_00there should be no considering of persistence. I'm on the side that there should be as little domain logic as possible so there are topics that are absolutely relevant such as bounded context on frontend but things like aggregates or you know entities etc like this has very like generally tactical DDD has very little to do with frontend and kind of frontend has specific um responsibility for instance we care about the user
SPEAKER_00interactions so different patterns and different let's say uh issues arise uh different patterns make sense to to be used for instance in front and something that is very highly uh appropriate is a state machine, which is kind of not the first thing that you would implement on the backend side. And on the client side, this is like one of the first thing that you should take into consideration. Or if we think about state management and we take,
SPEAKER_00yeah, the most radical and the most useful tool, which is Redux. This is a very good example because Redux is very radical in its philosophy. For instance, there are no events and there are no commands. There are actions, which I think is kind of a symbolic way to show that there is a difference in the way you think about systems because there is no event, command, query separation of logic and how do systems integrate and communicate with each other.
SPEAKER_00And there is basically an action and it is true that trying to define whether Redux actions are more events or commands is basically boils down to a theoretical discussion because this is difficult to both distinguish whether this is past time or whether this is the future time. But we can clearly see that whenever you dispatch an action, that you do care what is the consequence of it. So you could say, oh, this is more like a command. But on the other hand, the user has clicked something.
SPEAKER_00So the past tense and, you know, like this is somehow different because this is only the interface. So yeah, this changes a lot.
SPEAKER_02Yeah, I think that regarding the Redux, so the side note is that I'm calling that command sourcing because it's more like for the specific sets of actions or commands, whatever we call it, it's assumed that we will always get the same result because in theory, as you said, there is no storage. So we are just going through the state machine, which should always give us the same result. So Yeah, so I think that's an intriguing use case of showing those similarities and differences.
SPEAKER_02I think that for many of the people that are focused on backend work, this state management and the plentity of different state management techniques is one of the most surprising and the hardest to grasp parts. So coming back for a moment for this distinction and this disconnection between
SPEAKER_02front-end and the back-end, I'm always saying that this is one of the the worst cases that many of our so-called best practices are created by the backend developers because then somehow those frontend stuff is just pushed outside. Like, yeah, that's not important. In general, it would be best if there was no frontend, if we could just make it just static and call it a day.
SPEAKER_02However, I don't think that nowadays this is even possible and this even makes any sense. I think that those two camps, so frontend and backend, could learn a bit from each other. So do you agree with that? Or maybe if you do, then... Do you have some examples of what one and the other side could learn from each other if they were working closer?
SPEAKER_00This makes perfect sense what you're saying. So just a small side note before I get to your question is that quite often, at least in my bubble, I can see memes which basically say that frontend is more complex or difficult than backend, or that backend is more difficult than frontend, which, well, I believe that we as software engineers should consider ourselves as problem
SPEAKER_00solvers if we try to think about, well, understanding the problem first and then trying to pick the correct solution. the whole distinction between front-end and back-end architectures and all the concerns that we take into our account, they become very similar to each other. And what happens is that we have the same set of physical forces. We need to understand basically the same principles and not only like, you know, kind of...
SPEAKER_00either obvious or very, very, very basic things like solid, but also, you know, like what are the pros and cons of sharing? Like sharing data, sharing models, sharing infrastructure, sharing everything. The pros and cons are basically exactly the same. And we just need to apply it to whatever the code or product or a system we're working on. And this doesn't seem to be that difficult. What I found is that if you are an experienced front-end dev, then you know how much you had to learn.
SPEAKER_00So you consider that, oh, the other side that you might be ignorant about or very, very little experienced... does not have such level of difficulty because you are unaware of your inconfidence. This is an unknown unknown for you. And the same on the other side, that if you're an experienced backend developer and you don't know what is the complexity that frontend developers need to need to work with all the time then you think oh the other side which I'm ignorant
SPEAKER_00about is the easier one because my is so difficult because I have to put so much effort into it and so I would say this is basically the yeah the the competence and competence model being aware or unaware. I would say that backend is more difficult than frontend for me only because I feel more experienced in frontend and I know how much on the backend side I don't know yet. And this is also one of my area of very, very focused interest.
SPEAKER_00Well, what backend, what frontend developers could learn from backend? Oh, there is a... There is so much that we could spend hours on listing it. But generally, if you consider what are the architectural styles and what are the pros and cons behind them, and you walk into the problems that they want to solve and the problems they unintentionally introduce, and you will see all the patterns that are there,
SPEAKER_00then you You don't only learn the patterns, the styles, the paradigms, the mind shift, etc. But you will also learn a totally new way of thinking about the traits that you want to introduce, the price you have to pay, which is not very common in frontend. As you've said, there is... Like, for each framework, and you know, as they say,
SPEAKER_00there is a, you know, each week there is a new JavaScript framework out there, which is not as bad as it used to be a decade ago, but still there are lots and lots and lots of new tools. So, what I would say is a challenge on Frontend is that we tend to micro-optimize stuff. We tend to think about the API itself. So, basically, what is the abstraction that you use on your API level? But what is not really considered in details enough is...
SPEAKER_00How do you use the tool? And what is the shape? What is the workflow? What is the structure of what you're building? And by structure, of course, I don't mean the code and the files, etc. But the relations between the modules, the relations between whatever teams are working on the product. For instance, something that is very, very classical is that when I do consultancy, When I take a look at a system, it turns out that whether a backend is monolithic or microservice-based,
SPEAKER_00never mind. We can clearly see more or less that, yeah, multiple teams are working on a code base that is highly modular because each team could have a separate product owner with separate priorities, so essentially a separate bounded context, etc., etc., And what frontend folks have on their site is basically a directory separate by an entity. So imagine e-commerce, and then you have a whole module for a product.
SPEAKER_00And they call it modular. yeah, this silence here should sound quite a lot. So there is a whole lot of things to learn for front-end devs to learn from back-end devs, not only when it comes to patterns and even architectural styles, but even a whole way of thinking. So, as I said, not necessarily tactical DDD, but strategical DDD is something that you don't necessarily like,
SPEAKER_00like, you don't apply it on front end separately, because it doesn't make sense in separation. But at least to know what is the whole point of ubiquitous language and the semantics of domain within your system, then you try to then you start to think in a completely different way. Like, Most senior front-end engineers know that a god class is your enemy, yet they separate their modules based on what an entity is. It's kind of detached.
SPEAKER_02From my experience, in my teams, it was really hard to persuade front-end developers To think, as you mentioned, think about the business domain. So if you're building component, then what's actually this component is all about. And instead of, you know, just naming the operation based on what's happening. So, you know, something, something was selected, but actually what is the business intention behind it?
SPEAKER_02And, of course, on the backend side, that's also focused on technicalities that's also existing. But definitely there is much more discussion on how to reflect. So all this DDD or in general deploying the domain into your code. However, on the... On the bright side, I personally learned a lot when I was working for a few years in Angular,
SPEAKER_02the new Angular. I was an extreme hater of the old one. The new one is actually okay. I learned a lot. I realized because in Angular, you have this style that you have component wherever it is, but inside the component, you have everything that is related to each other. So you have unit tests, you have the view, you have the backing JavaScript or TypeScript code. And when I spent time with Angular,
SPEAKER_02having this background as mostly backend developer for a long time, it made me realize that actually that's a really ergonomic approach. So because I'm keeping all the things that are changing together in one place. So I think that that's one of the examples of how frontend and backend team could get a good synergy. And I think I agree with what you said. I think that Frontend developers are really good on the tactical side of making things like,
SPEAKER_02you know, those practices like functional. If you ask them, then they will explain you all those, especially if they worked in React a lot, then all those weird functional style naming, etc. They are really skilled on that. But yeah, disconnecting the dots, that's not always there. It's not that they are not capable. But as you said, the disconnection, and maybe because that was somehow always gathered by the backend team that now
SPEAKER_02that's what we have to do. You do your own stuff. I don't know what you think.
SPEAKER_00Yeah, there is so much you have you have touched. Yeah, sorry. Yeah, no problem. So yeah, first of all, I would say that whichever framework you choose, like the modern ones, or at least the mainstream ones, will basically have the same approach that a component, a front visual component, front end component, whatever we call it, Certainly, what a component is on backend side is a totally different thing. Unfortunately, we're using the same term, which makes it even more difficult to communicate.
SPEAKER_00So a frontend component is going to look similar, like it has its visual layer, it has potentially its state, it has its behavior, it has its tests. Also, it has something that I cannot think of any equivalent in backend. Maybe you know Storybook, You have, this is like what you've said that front and desks are very good at tactical aspect. Absolutely. Like you walk into a project and even if you have, let's say 1000 or 5000 components,
SPEAKER_00but only 50 of them are really important and basically all like, no, or let's say domain agnostic, highly meant to be reusable, and all the others are basically specific one, one time usage, etc, then you can very in a very cheap way, basically catalog them as products in the IKEA store or whatever. And you do it basically in minutes, like essentially in minutes. You generate all the stuff and you can see, for instance,
SPEAKER_00the way that we could communicate with both business and the marketing, the accounts and etc. is basically these are the components that we have. If you need anything, then we are going to work bottom up. which is very, very cool because we are going to work on the components in isolation, as you could, as you've said, with all the tests, et cetera, then we can easily provide the things, basically additionally creating an always alive documentation.
SPEAKER_00We can also create integration tests using Storybook itself. Which is like really, really good when it comes to when it comes to tax. So, so yeah.
SPEAKER_02Sorry for interrupting. Just I think that for backend people, I think archetypes could be something similar. So you are building like a archetypes, like archetype book book of archetypes. So like, this is my, let's say, even they might be small, but they might be also like a shopping cart archetype and joined together that you can reuse in multiple places potentially.
SPEAKER_00But is it something like a service or a model?
SPEAKER_02I don't, I mean, it's not so popular, unfortunately, in backend, but definitely like there were for us for some period, there was like a model based development called or model based design, where you had those in theory, those popular archetypes, like reservation, etc. And you could... If you knew it, then you could build, okay, this is my, let's say, reservation. Or I'm using here a reservation style or reservation archetype and make that easier to grasp.
SPEAKER_02But definitely it's not that, I would say...
SPEAKER_00not that visual and not that explicit so what you mean is basically the archetypes of a domain model or the domain complexity so this is very high level you can put in storybook or whatever alternative basically the very low level thing so the equivalent I could think of would be if you have either entities or value objects or or aggregates, and you could basically create some way of a catalog of how you use them,
SPEAKER_00which is super cool if, let's say, if you want to have a newcomer to your project and you want them to become highly productive on day one, So basically, they, first of all, take a look at what your components are. By the way, you also see from Storybook, how do you group them? So depending on your company's scale and the complexity of the domain, you could see basically where there might be some business-related modules.
SPEAKER_00So maybe there is already some Conway's Law that you can see there. You also see what is the, let's say, a how much technical, how much domain-related it is, etc. But what is, going back to your previous question, what could backend developers learn from frontend? This is essentially, I'm not sure if you said that this way, is to... No, I will rephrase it. To get things done slightly faster,
SPEAKER_00slightly cheaper, and yet not to do it in a lousy poor man's approach, but just don't overdo it. For instance, due to how java.net and many other platforms were built when you want services to communicate with each other of course when you are distributed then you need to create you know dto that would need to be serialized then you need to deserialize it you need to if you have you know a whole tree of relay objects the objects that
SPEAKER_00are related to each other then you would need to have a factory or an even abstract factory etc blah blah blah blah blah and yeah this is essentially how you do these things because sometimes at least not only because this is like like you always have been doing it, but basically you need to put this code somewhere. And if you don't, like in software design, if we don't think upfront, where should some logic live,
SPEAKER_00then it will basically leak wherever it can leak. So this is why we have all these classical design patterns that people make fun of on the front end side. And what is very productive is that on the front end side, I know it's easier, but since we have browsers and browsers are capable of parsing JSON very efficiently, then what we care about only is basically that we have a TypeScript interface
SPEAKER_00Now, it depends whether we trust our server side and we don't need to do any type of runtime type checking. Or if we don't trust it 100% and we want to introduce runtime type checking, this is something that I just leave aside. But basically, the thing that we need is the interface that could be even automatically generated from a contract like Swagger, Pact, or whatever solution we're using. And that's it.
SPEAKER_00That's all you need. We can prototype way faster. We can implement stuff way faster. Using this bottom-up approach based on Storybook or any alternatives, we can deliver solutions way faster. And certainly, we are not using... I would say we are using the very same classical design patterns but I'm not sure if you agree on that. I would say that the awareness of the names of the patterns are not the same big,
SPEAKER_00but basically, in the long run, the intuition leads us to the very same places. So for instance, in backend, you could have an interface that you implement with multiple classes, that have a factory in their name or a strategy in their name a policy in their name etc and on frontend what we what we know that we should write is that basically this is a function now i know it's a strategy or a policy or a factory
SPEAKER_00whatever but i don't call it strategy policy or whatever because this is essentially a function so so we get what is the abstraction but we just don't care about the interfaces. Moreover, if we have just a TypeScript function signature, by function signature, I mean the type, not the implementation, and we know that there could be multiple function implementations of the same type, then uh this is essentially the design pattern whether i am aware of the name or not but it often uh reduces a vast amount of code that does nothing for instance uh
SPEAKER_00maybe i'm going to be a slightly nitpicky but i've seen um like huge amount of code bases on the backend site where there is a single interface with a single implementation and their names is basically one to one with Which is kind of doing all object-oriented for the sake of object-oriented. Or especially in .NET, where you have, let's say, iProduct implemented by product. So what is the whole point? I know, yeah, the dependency inversion principle, yada, yada.
SPEAKER_00But what is the whole point of extracting the interface if you're always going to use the only implementation and like Strictly, literally, you are following dependency inversion, but I think you are losing the whole point of what is going on there. So on frontend, I would say we're not trying to overdo these things. So there is way less kind of dead abstractions, zombie abstractions.
SPEAKER_02Yeah, yeah. So I agree. Regarding the, the, the awareness of the naming in the front end, which I, in general, consider as a positive ignorance, I hope that no one will be somehow feeling bad about what I said. I mean, it's positive because, as you said, if it's some sort of ignorance and if you are focusing on what's that actually doing,
SPEAKER_02but not why it's actually named like that, then you are more focused on the outcome instead of using the specific pattern. Of course, that's not always... good things, you it's good to know the theory. But yeah, that's also the reason why I'm doing in recent years, more and more TypeScript, etc. Because I'm also feeling a bit more productive. But of course, that's a highly personal and subjective thing.
SPEAKER_02And simplified, I guess.
SPEAKER_00Yeah, there are lots of nuances that we don't have time to cover.
SPEAKER_02Yeah. So coming back to our initial discussion about the important decision and the so-called front-end architecture. So I think that we know that we have in general architecture and some already differences. But my guess, I don't have exact numbers, but my guess that most of the readers and viewers are probably more on the backend side. So if you could try to show like what are the significant differences
SPEAKER_02front-end architecture decision that you are usually doing when you are either setting up or evaluating some existing projects. So what are your personal top few important information, not necessarily decision, but decision information about the project and its architecture?
SPEAKER_00The concerns to consider. uh it depends of course uh from which perspective we are looking at so one of the perspectives could be how do we deploy stuff so um how many teams how many developers are working on something so whether a microfrontends would make any sense or not what is the frequency of deployment for instance if you have a let's say very dynamic business that is working with the end user
SPEAKER_00who could be, you know, the just anybody, then we would need to think about, you know, the infrastructure that considers being able to, you know, ship quite often and roll back easily. So for this reason, we would think we would need to think about, you know, all the observability monitoring stuff and basically something that front ends overlook very front end developers overlook very often is basically the whole DevOps culture. Yes. quite too many frontend folks whom I know think that DevOps is basically Kubernetes
SPEAKER_00or I don't know, Docker or whatever. So no, it's not. And going to more logical perspective, how do you separate modules? So if... there would be, well, basically, if you have one team of, I know, a few people that deploy every end of sprint or whatever, or even less frequently, then it doesn't make a big difference in which direction you go as long as these
SPEAKER_00characteristics don't change. Because, well, you can even divide your logic by entities and Well, this is not going to be useful if you grow in complexity or in the size of your development team. But as long as basically five people were working on something and still five people are going to work on the very same thing, even if these are different people after five years, then you can cope with it. So again, I would say also, what is the scale of the system?
SPEAKER_00Because from my experience, backend team, the number of backend developers are usually bigger than frontend developers because they have some more responsibility when it comes to persistence, keeping the consistency, transactions, communication internally within the backend. So not to say that frontend is easier, but there is a lot of topics that we don't need to think about on front end. So basically there is slightly more work to be done there.
SPEAKER_00But still, if our front end application is more challenging than basically what you share and how do you share it is very, very important. So what are the models that you share? What is the state that you share? If you share the state, then I tend to ask questions. Okay, so what if we want to divide something or split something or something changes? If we, let's say, have like something that I see very, very often in Frontend is a canonical model that basically an entity interface is
SPEAKER_00being shared across pretty much the whole application. Mm-hmm. So a quick question, like what if there is yet another function or a feature added to the system? Would you basically make the interface grow more and more and more? Again, if we choose a state management solution, like quite often the state management solution doesn't enforce any architectural traits, but sometimes it does. For instance, again, Redux. So Redux enforces a centralized state solution.
SPEAKER_00And I would say this is the biggest downside of Redux. Because if you are using something which is centralized, and most of the advantages are like they shine as long as redux is the single the only source of truth actually in your application so you can break the rule you can make you can introduce a competition to redux but then this isn't the only source of truth within your application so the advantages stop to shine that much or they even
SPEAKER_00become a false advantage. So you are left only with the costs. So these are the things. Or for instance, as you've said, like, yeah, some people say that Redux is kind of a poor man's even sourcing on frontend. But I like your name that this is common sourcing very much because this is, yeah. I believe that the action is more a command than event. But yeah, it doesn't really matter on frontend that much. So how many things do you share?
SPEAKER_00And also regarding the fact that frontend is visual, what taxonomy do you introduce into your project when it comes to how do we divide our code base. So where do you put the line of what do you want to reuse? Which components are going to be reused? And there is also, I'm not sure what is the, let's say, state of mind on the backend side, but on frontend, there is too much reusability obsession, way too much.
SPEAKER_00Same on backend. Same on backend. so like a counter force to dry don't repeat yourself something that i like to speak about quite often recently is the wet right everything twice which is not twice literally but like try to make something reusable once you see that these things are reusable and basically the This is quite obvious that if you have a design language like how your application looks and feels, then you would have highly reusable things that are totally module agnostic and
SPEAKER_00domain agnostic, such as buttons, radio buttons, check boxes, et cetera. But for instance, If you want to consider a data table or a listing or a grid table that you need to implement with things like advanced sorting, advanced filtering, advanced pagination, would you rather create one thing that is highly reusable and the more parametrized it is, the more reusable something is, the less usable the thing becomes,
SPEAKER_00right? Because it's basically too abstracted away. Mm-hmm. Or would you create multiple specific versions that are simpler? Where would you say that, like, where is the boundary of the thing that is reusable? How much, you know, flexible, how much generic should it be? Like, where do you put the boundary? And another thing very common in frontend is sooner or later, a company would like to have a common look and feel, and there would be a need to introduce a component library.
SPEAKER_00library of reusable components who is going to maintain it and what is going to be the workflow like in bounded context terminology like the library is going to be the supplier and the domain modules are going to be customers but So we see who asks somebody to do this stuff, but actually, if we basically spark a new team that is going to maintain the component library,
SPEAKER_00like how much other teams can basically tell them what to do because this is basically a an organizational single point of failure um would we create a separate team or maybe we will not create a team but distribute the responsibility how big the component library should be how much well, we know it shouldn't be domain agnostic, but how many parameters should it include? So quite often, let's say, like a summarizing thing, how do you deploy and monitor the application is one thing.
SPEAKER_00How do you share the state, share the model would be another thing. And how do you work with reusable components, usually the component library? These are the three, I would say, most critical pieces that are not thought well enough. And most of the issues come from these three, from my experience.
SPEAKER_02Yeah, it's sorry, it's really intriguing that, in theory, you were saying a lot of, you know, specific front end related stuff like UI components, like state management, etc. But in general, it just showed how similar are those issues that we have in front end and on back end side, because Like the component,
SPEAKER_02it's really similar to how the core team, like the best team in backend or nowadays called platform team rebranded is called. Or for instance, I even had the case like you mentioned with this component library, internal component. In one of my projects, there was a decision to form for some period a dedicated team for that and that we
SPEAKER_02will build our own component library from scratch. And I said like, okay, but you will see that we will throw it away within a few months because I knew that this is never going to be going outside of our project and in the long term, it won't be ever a priority. And unfortunately, I wasn't wrong here, because indeed, at some point, the team wasn't able to catch up because of the reasons you mentioned, like how to discuss about it between teams,
SPEAKER_02etc. So yeah, it's really intriguing that people believe that there is a front-end and back-end architecture And indeed, the specific challenges are a bit different, but in general, the scale and the topics are really close to each other.
SPEAKER_00Yeah, they're absolutely very similar and actually the misconceptions are also very similar. For instance, there was the famous case of Amazon Prime streaming that went back from microservices into monolithic style and some part of the cloud or backend community said like, oh, microservices suck. And we have exactly the same, let's say, attitude or state of mind, considering some part of the frontend folks that say that micro frontends are
SPEAKER_00entirely wrong. This is a purely technical debt and basically, you know, totally ignoring Conway's law and how basically business work. Because some people just forget that we, the development part, we are the cost, right? We are not the goal itself. We are the value, but we are not the goal itself. We are the cost. And basically, yeah, we are supposed to fix some problems. And we are not going to determine what the organization is going to be. We are basically meant to fix some problems.
SPEAKER_00And yeah, the same way people consider that microfrontends are entirely wrong. And just a disclaimer, I'm not a... I'm neither a fan or anti-fan of microfrontends. To be honest, most often I discourage teams from doing this because I see that similar with microservices, some costs and issues are guaranteed. Obviously, and the benefits are if the benefits are not clear,
SPEAKER_00and quite often the benefits are not clear in certain cases, then I discourage the teams from from going in a very, very, let's say, expensive and over complicated direction. And I think this is the the right way to do, but yeah, like, I think this, like, considering microservices or microfrontends, like, of course there are differences, but at a very high level, the reasoning is yet again quite similar, so... Yeah, lots of similarities.
SPEAKER_02Yeah. And I agree that most surprising part for many people is that the decision between whether to go more monolithic way or more distributed like micro frontends, micro services is not about the technical part. details but about the Conway Law so setting up the teams how to not interrupt each
SPEAKER_00other of course and yeah if somebody says that this is a technical approach to solve the people problem then well first there is a famous quote don't I don't recall the author is that no matter what they tell you is always a people problem but yeah I think Gerald Weinberg yeah yeah exactly but if we take this to extreme then well everything is a people problem, right? Because we are people and whatever we are discussing come from people's hands. So these are all our abstractions, right?
SPEAKER_00We are not building metal, right? We are working on abstractions. So it's all, yeah, it's always a people problem. But on the other hand, yeah, if you ignore or if you try to fight Conway's law, then you are in a totally different dimension. It's like a galaxy.
SPEAKER_02It's like you would try to fight with the gravity law.
SPEAKER_00Yeah, yeah. So so so so yeah, so yeah, this way, you can think of it as a as a technical debt or an architecture that is always wrong. But I think this is basically a fundamental cognitive bias. If you dislike an architecture, This is like liking or disliking a way of solution. I always try to find a metaphor from real life whenever thinking about abstraction things. So whenever I discuss patterns,
SPEAKER_00architectural patterns, et cetera, I try to think something from a real world. And discussing system architecture, I like to think of different ways how do you build buildings, which is kind of quite natural to think of it. And for instance, In Poland, as you know, we used to have this architecture called the Wielka Płyta, the big blocks, you know, the communist era, where they were building lots of very big blocks of flats in a very cheap way,
SPEAKER_00yet they did it very, very fast. The quality... how we perceive it nowadays is like nothing interesting and nothing that you would like to prefer. Maybe only the location could be attractive, but the quality of these flats are not really attractive. But when it was introduced, the country was very poor and we didn't have a better technology. We didn't have the resources. We didn't have the people skilled enough. We didn't have the time because there were lots of people who basically didn't have,
SPEAKER_00where to live, because it was basically after the World War. And now if we consider what were the trade-offs, how the decision was made, the moment the decision was made to basically invest into this architecture of lots of blocks, which are poor quality, but they are very big, and lots of people can live there just... The trade-off is that the quality is bad and that if you want to increase the quality, improve the quality, then you would need to spend quite a lot of money later.
SPEAKER_00I think it was a very, like, although I am not a communist fan, I think at that time it was a very good idea. Because all in all, lots of people needed to live there. And is it crappy? Yes, it's certainly crappy. It's totally crappy. And yeah, if you ever lived in such, you know, architectural blocks of flats, then yeah, you know, you know what I mean? Like, it's not a place I would like to live there, but it basically served its purpose. And it also shows how important is the whole concept of evolutionary architecture.
SPEAKER_00At some point in time you can have some priorities and even though you are living in the very same place, like in the same product, the business environment could change so dramatically, so significantly that your architectural drivers change a lot. So do I dislike the communist blocs? Yes. Do I despise the architecture? No. Because it was basically kind of lifesaver for hundreds of thousands of people or even millions.
SPEAKER_00They had a place to live just after the war. So again, if you dislike an architecture and you consider that microservices are entirely wrong, then I would say we are not working in the same discipline, I guess. Because there are trade-offs.
SPEAKER_02yeah yeah that's a that's a really a great way to phrase it and i i totally agree i totally agree especially that there are so many different changes and and factors that can Not only even on like only on front end, only on backend, but we even didn't touch any of those discussions like, you know, API first or backend for front ends on GraphQL. So all that stuff, how teams like in general should collaborate with each other through the contracts,
SPEAKER_02the technologies and how to streamline that. But yeah, I fully agree. So we are slowly getting closer and closer to our time that we initially discussed. And I wanted to ask you, because I think that many... Many people are struggling with that and have really strong and different opinions. Do you think that we should be having front-end and back-end teams or more business vertical teams?
SPEAKER_02I know that it's a trap question, but I'm sure that you have also your strong opinion on that.
SPEAKER_00Well, I have a kind of observations from empirical experience backed up by some smart people who just abstracted these things away. Well, I would say this all starts from how you build your product, I would say. And again, trying to start with the solution without thinking what is the problem that you're trying to solve is, of course, the wrong direction. So if you consider the product that you're trying to build and the product is
SPEAKER_00something that you want to redeploy quite frequently and deliver the value as soon as you can, so you want to have the time to market as short as possible, then try to think like, what is the quickest way to achieve the goal? So if a product needs to be, or a piece of a product, a module, whatever, needs to be delivered by both backend and frontend, and most often this is the case, even if there is more or less work on one of the sites, but there quite often needs to be at least some part delivered on both of the sites,
SPEAKER_00then it basically means that there needs to be a communication between them. Now, the more distance there is between the pieces of your company, the more expensive the communication is going to be. So our state of art nowadays is that we try to reduce the communication cost. So if we basically create, of course, yeah, full stack teams, or I would even say DevOps teams, not that I am a DevOps engineer, but basically I'm
SPEAKER_00working in like uh according to the devops culture like end to end from whatever is the schema of my database going through all the back and stuff front and stuff until the things like deployment monitoring roll backing um full you know measuring the DORA metrics, how often do we release, how long time it takes us to roll back a failure, how frequently the failures take place, etc.
SPEAKER_00The closer the people are to achieve the very same goals, the simpler this is going to be. I believe there are situations where doing the opposite could be helpful for some reason. And the thing that I observe quite often is that due to technical reasons, mobile teams tend to be separate. But I would say this is kind of an exception from the general rule. And the general rule would be that,
SPEAKER_00of course, according to the size of your company, of your product, of your system, if you want to achieve something, put everybody that needs to achieve the goal together, basically in one unit of our organization. And so that give them like, empower them, I don't like this phrase, but give them all the credibility or the tools or the, you know, credentials that they need to achieve the goal and basically let them do their job. So I would say, yeah, separate teams would be
SPEAKER_00I would consider it an exception from a general rule that, yeah, the cheaper the communication, the better. Because if the communication is something internal to a team, then we could consider it as like, of course it takes time, but no matter who you put into a team, there would be communication, even if they are working on totally different things. So if you put people who build the same thing into the same team that we
SPEAKER_00significantly reduce the cost of communication, which is going to be effective. And I would say this is the factor that reduces time to market. So again, like look at the business first, look at your organization not to fight with Conway's law.
SPEAKER_02yeah yeah that that's also my experience i was in a multiple teams working in a different way so both technically split layered split and also vertically and always those teams that were working together were the easiest and the the fastest to deliver good quality. Because if you break the team with the technical layer, then you are telling them that, hey, this is what you should be focused on.
SPEAKER_02And I believe that teams should never focus on pure technology, but delivering the business value. Plus, for me, it was always the most motivating if I could. And by I, I mean not only I myself, on my own but also as a team deliver feature from end to end it's super motivating if you can see that this is just what you did is someone is using that and it's
SPEAKER_00easier to make this empathy yeah and we're just two things to add here even if we have let's say a team of i'd know um three backend developers and one frontend developer, let's say, then even if it turns out that someone who is more skilled in Java or .NET would need to write TypeScript and that would be slightly worse quality compared if there was only, you know, senior TypeScript folks writing whatever, then in the long run,
SPEAKER_00it most often doesn't really matter because there is no, you know, there is no... kind of ideally elegant code or clean code, whatever. I hate clean code, by the way, because this is basically a judgment, not an objective characteristic that you can measure in any way. And yeah, so even if a front-end developer will be given a simple back-end task and it would be of a lesser quality or the other way around, this doesn't really matter because if the team is able to deliver as a whole,
SPEAKER_00then this is what reduces the time to market. Going back to what we've discussed earlier, if we put a multidisciplinary skills people into a single team, the probability of knowledge exchange and basically taking different perspectives at the well-known problems, the team is going to benefit from it significantly. For instance, front-end folks can show the backend developers, as we said before, that there are
SPEAKER_00Well, more lightweight solutions to the things that they have been doing. On the other hand, backend developers can show frontend devs that, hey, like sharing the model across different frontend modules is probably not a good idea. So just introduce a mapper, just not to let the model leak. And this is something that front-end folks are, well, generally, from my observations, not aware of. Because, yeah, this is an entity, right? So let's put it there.
SPEAKER_00A single source of truth everywhere. So, yeah, I would say that a multidisciplinary team could make everyone benefit.
SPEAKER_02Yeah, so I think that's a good summary of our discussion and kind of answer whether we have frontend and backend architecture or the architecture. So thank you, Tomek, for joining. And we already discussed behind the scenes that we are thinking with Tomek to maybe discuss in a bit more detail some specific parts of the front end part of the architecture so if you have any ideas feel free to share
SPEAKER_02it and leave them in the comments we are not setting any deadline for that but I think that we'll try to cover some of those the most important pieces that we touched upon during this discussion so thank you again Tomek for your time and sharing your experience with us
SPEAKER_00Thank you very much, Oskar, for letting me be here. And yeah, thank you very much, everybody who was listening. And yeah, hope to talk to you again. Thank you.
Welcome to the new week! “How to document systems build with Event-Driven Architecture?” and “How to keep our understanding about evolving messages definitions?” Are one of the common questions I’m being asked. For many...
Welcome to the new week! Tomasz Ducin is back with us to explain the next parts of Frontend Architecture - this time with a deeper, more hands-on walkthrough of Frontend State Management on the React Query example. And...
Have you considered applying observability but struggled to match the strategy with the tooling? Or maybe you were lost on how to do it? I had a great discussion with Hazel Weakly about Observability beyond Open...
"My favorite conspiracy theory is that the stuff we make in software actually has any sense. That's a big conspiracy, and you can see people believing that, and that's just not true. I mean, it is in some percentage,...
This time, our webinar has a special guest: Jarosław Pałka. He’s the Senior Staff Software Engineer responsible for benchmarking infrastructure in Neo4j. We discussed how to reason about performance practically, so how...