Vertical Slice Architecture Myths You Need To Know! — Transcript
Full transcript
- 0:00hey everybody it's Derek Martin from cod
- 0:01opinion.com as with anything in our
- 0:04industry that gains some traction by the
- 0:05waterer Community it develops some
- 0:08misconceptions vertical slice
- 0:09architecture Falls exactly into this
- 0:11trap but don't worry I'm going to
- 0:13demystify some of these misconceptions
- 0:16why they exist and set the record
- 0:18straight easily the number one
- 0:19misconception not even close this is a
- 0:22question comment or confusion is this
- 0:25idea of share nothing or that how do you
- 0:27share between slices or between features
- 0:30I think the reason why there's this
- 0:31misconception or confusion to how this
- 0:32works is because people want features to
- 0:34be completely independent when that's
- 0:36not really the case often times there's
- 0:39relation between the two that could be
- 0:40workflow or that could be just commands
- 0:43or queries and a subset of them that's
- 0:45actually what the feature is and this is
- 0:46actually pretty common I'll give you
- 0:48some examples of this but before I do
- 0:50I'd like to thank Avent store for
- 0:51sponsoring this video event store DB is
- 0:53a new category of operational database
- 0:55built for event sourcing cqrs and event
- 0:58driven microservices from for more on
- 1:00event store DB check out the link in the
- 1:02description the most common example of
- 1:03this is your underlying domain or data
- 1:05model this thing is shared across
- 1:08features sure your features are given
- 1:10use cases specific use cases but they
- 1:12may all be sharing that same underlying
- 1:14domain or data model the key aspect of
- 1:16this is you don't have that domain model
- 1:18or data model that's shared between the
- 1:20entire system no it's very specific it's
- 1:23vertical and what those features that
- 1:25actually needed that should be very
- 1:27narrow very focused another way of
- 1:29thinking about this is let's say we had
- 1:31some validation between features but
- 1:33there's specific validation that we need
- 1:34to do in two specific features pretty
- 1:37much the same way well just create
- 1:40something that's shared between the two
- 1:41features that's fine how do you do that
- 1:44just use the same class whatever it is
- 1:46that you're sharing that you're going to
- 1:48have within those two features there's
- 1:49nothing wrong with this not each new
- 1:51feature needs to be completely
- 1:53independent in what it's using it's just
- 1:55narrowing that focus a different way of
- 1:57looking at it is let's say these two
- 1:59featur features they're using one
- 2:01particular way to validate and then the
- 2:03other three features maybe they have
- 2:04something completely different that's
- 2:05kind of the benefit of having things by
- 2:07feature by verticals is that you can
- 2:09decide what that implementation looks
- 2:11like maybe something shared between a
- 2:13couple or a few of them maybe they're
- 2:15not and this relates to what I think is
- 2:16probably the second most common
- 2:18misconception which there's little or no
- 2:20abstraction so this misconception I
- 2:22think exists because people are
- 2:24generally thinking about layers and if
- 2:25they're thinking about vertical slices
- 2:27what happens to the layers well the it
- 2:29can still be there nobody's saying not
- 2:31to use layers nobody's not saying to not
- 2:33use abstractions so for example if you
- 2:36had some type of data access layer or
- 2:38whatever that was that's not just saying
- 2:40that if you have some type of vertical
- 2:41slice or feature that you don't have
- 2:43that abstraction of data access you can
- 2:46where I think this gets a little bit
- 2:48confusing is because now you're deciding
- 2:51specifically in a given vertical slice
- 2:53or feature how you want to do that data
- 2:55access a lot of this now comes down to
- 2:57coupling is the question is do you need
- 3:00the abstraction maybe you do maybe you
- 3:02don't but the idea that you don't have
- 3:04to use one or that you shouldn't or that
- 3:06there's no layers is a misconception
- 3:08here's an example let's say you're using
- 3:10an orm for your data access and all
- 3:13these vertical slices these features
- 3:15let's say there's a dozen of them that
- 3:16actually depend on this omm or an
- 3:18instance of the orm do you need the
- 3:20abstraction maybe you do maybe you don't
- 3:23if you needed to change that underlying
- 3:25uh database or orm or whatever you want
- 3:26it to do how much work is it to actually
- 3:29change those dozen places this is very
- 3:31different if you have uh some type of
- 3:33data access layer that's coupled
- 3:36hundreds of times so the the focus
- 3:38becomes more narrow and that's what
- 3:40people then start thinking about well do
- 3:42I need the abstraction or can I just
- 3:43change it when I need it if it's
- 3:45testable and you don't need to create
- 3:47your own type or one abstraction around
- 3:49it maybe you don't but that's not to say
- 3:51that there's little to no abstraction
- 3:53it's really up to you and this leads us
- 3:55to another misconception which is
- 3:56there's a low barrier to entry meaning
- 3:59that if you want to get into vertical
- 4:00slice architecture it's a lot easier
- 4:02than say clean architecture I disagree
- 4:04with this because I think fundamentally
- 4:07it's not about clean architecture or
- 4:09vertical slice architecture or aventurin
- 4:12architecture all these different types
- 4:13of architectures you ultimately use that
- 4:15make your architecture fundamentally
- 4:17it's understanding what the problems are
- 4:20why you're applying certain patterns or
- 4:21certain Concepts and often times this
- 4:24relates to tradeoffs around coupling and
- 4:27cohesion that's really what you're
- 4:29battling
- 4:30most of the time and there's just
- 4:31different ways of doing it so I don't
- 4:33think there's a lower barrier to entry
- 4:34with vertical slice architecture I think
- 4:36maybe on the surface it seems that way
- 4:39but you can screw up anything that you
- 4:40don't really understand now another
- 4:42misconception and I kind of alluded to
- 4:44this a little bit earlier is that
- 4:45features don't impact other features the
- 4:48reason why this misconception exists is
- 4:49because this idea incorrectly that there
- 4:51share nothing that each feature is going
- 4:53to be or vertical is going to be
- 4:55completely independent it's just not the
- 4:57case you're going to have some coupling
- 4:59between between features often times
- 5:01this could be business processes or
- 5:02workflows where one thing kind of kicks
- 5:04off a business process and then it hands
- 5:06it off to another feature you're going
- 5:08to have coupling there how you couple is
- 5:10a different story and I'll get to that
- 5:12in a second but the idea that you're not
- 5:14going to have one feature affect another
- 5:16feature is not really the case so why is
- 5:20that important because you're less
- 5:23likely to have features impact other
- 5:25features because you're not going to
- 5:26have some massive layer that's coupled
- 5:29to every feature that's the whole point
- 5:31of vertical slices and focusing on kind
- 5:33of the utility of each one and how you
- 5:35want to implement that rather than
- 5:38having your entire system depend on one
- 5:40data access um layer or whatever the
- 5:43case may be you're splitting things up
- 5:45so again you're controlling coupling so
- 5:48that's why kind of this notion of
- 5:50features won't affect other features
- 5:51it's not that they won't it's that you
- 5:53won't have one feature that's specific
- 5:55to one specific use case it won't likely
- 5:57affect another feature that's completely
- 6:00unrelated but you absolutely can have
- 6:02one feature affect another feature
- 6:04that's directly related and lastly to
- 6:06piggyback up the last one is it requires
- 6:08messaging to decouple Features so
- 6:10something like Pub sub and topics or
- 6:13messaging in cues and this misconception
- 6:15is often because that's how it's
- 6:16actually implemented or given in
- 6:18examples or you see videos like me
- 6:20explaining event Riven architecture Pub
- 6:22sub or using some type of orchestration
- 6:25to work on business processes and
- 6:26workflows so when you have something in
- 6:28one feature happen
- 6:30you publish an event and some other
- 6:31feature can pick that up and continue on
- 6:33the workflow kind of like what I was
- 6:35mentioning earlier but that's not
- 6:36necessarily how things have to be
- 6:38implemented asynchronous messaging is
- 6:40just a way to remove the temporal
- 6:42coupling you're going to have some form
- 6:43of coupling some degree of coupling
- 6:45messaging is just one way of handling it
- 6:47but by no means is messaging required in
- 6:49a vertical slice architecture now the
- 6:51last thing to touch on isn't a
- 6:52misconception at all I think it's
- 6:54actually kind of the reverse which that
- 6:56there's not enough emphasis on when you
- 6:58might want to consider a vertical slice
- 7:00architecture which is really you want to
- 7:02focus on use cases it isn't to me very
- 7:06applicable or something you should be
- 7:07striving for if all you're developing is
- 7:10crud and that's because your use cases
- 7:12are your features your features are your
- 7:14vertical slices the idea that you have
- 7:16some type of capabilities your system
- 7:18provides some type of behaviors the
- 7:21behaviors are what you're focusing on
- 7:23that's the idea of organizing your code
- 7:25around these use cases around these
- 7:27features around these behaviors these
- 7:29capabilities what does your system do if
- 7:32it's just create read update delete and
- 7:35that's how you're going to organize your
- 7:36code sure I guess but a lot of the value
- 7:39here is that your code is expressive
- 7:41about what it actually does so hopefully
- 7:44I cleared the air a little bit on some
- 7:46of the misconceptions that you might
- 7:47have read or watched in videos I hope
- 7:49this gives a better illustration about
- 7:51what vertical SS architecture is and
- 7:53isn't if you enjoyed videos like this
- 7:55and topics like this and you want to
- 7:57chat with other software developers you
- 7:59can you get access to my private Discord
- 8:00server by joining my channel the Link's
- 8:02in the description on how to join if you
- 8:04enjoyed this video please give it a
- 8:06thumbs up if you have any other thoughts
- 8:08or questions make sure to leave a
- 8:09comment and please subscribe for more
- 8:11videos on software architecture and
- 8:12design
- 8:28thanks
About this transcript
This page contains the full transcript of Vertical Slice Architecture Myths You Need To Know! by CodeOpinion, generated from the public captions YouTube serves with the video. The transcript has 1,645 words across 247 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.