Instructor: SOA and microservices. 2 2
In this lesson, we're going to start talking 3 3
about the way systems are designed these days 4 4
by using service-oriented architecture and microservices. 5 5
Now, in the old days, the legacy way of doing things, 6 6
we would build these huge monolithic networks 7 7
and we'd have to get our routing 8 8
and our security and our servers. 9 9
We'd put all this stuff together 10 10
to build these huge networks to perform one function. 11 11
Everything was very tightly coupled 12 12
and so when something went wrong, 13 13
we had to identify exactly what it was. 14 14
Well, these days, it becomes a lot easier 15 15
for us to build things because we're using a lot more 16 16
of this service-oriented architecture. 17 17
When we talk about service-oriented architecture, 18 18
this is the combination of lots 19 19
of different little pieces, like the system, 20 20
the service, the platform, the practice, the people, 21 21
the architecture, the process, and the integration 22 22
and each of these can be operated individually 23 23
so they're not tightly coupled anymore. 24 24
Instead, we call this a loose coupling. 25 25
Now, when I talk 26 26
about service-oriented architecture or SOA, 27 27
this is a software architecture where the components 28 28
of the solution are conceived as loosely coupled services, 29 29
not dependent on a single platform type or technology. 30 30
By doing this, each individual piece can be built 31 31
on its own and tested on its own and that way, 32 32
there's no dependencies existing between these. 33 33
It makes it a lot easier 34 34
for us to build applications and reuse components. 35 35
Now, each service is going to take defined inputs 36 36
and produce defined outputs. 37 37
Essentially, we call this 38 38
like a black box type of architecture. 39 39
I'm going to say this thing does this function 40 40
and it takes these things as inputs, 41 41
and it's going to give you that thing as the output. 42 42
So if I have this box, it's going to do some math problem, 43 43
you're going to give it two inputs 44 44
and it's going to add those things together 45 45
and give you an output. 46 46
That would be an example 47 47
of a very basic service-oriented architecture example. 48 48
Now, when we start dealing 49 49
with service-oriented architecture, 50 50
we use this idea of decoupling. 51 51
We decouple these services into these different layers. 52 52
Now, everything is connected together 53 53
by providing a specific type of input 54 54
and they're going to provide you with a particular structure 55 55
for that output that you're expecting. 56 56
Everything in between is really a black box. 57 57
We don't really care what happens as long 58 58
as we get what we want. 59 59
This allows us to essentially have a bunch 60 60
of building blocks that we can use at these different layers 61 61
and to do these different functions. 62 62
For example, we have a presentation layer at the top 63 63
or we have a business process layer underneath that. 64 64
We have service component layers. 65 65
We have messaging layers that have a connection 66 66
to legacy systems, all the way down 67 67
to the underlying enterprise information technology systems. 68 68
And each of these can be designed, built 69 69
and tested individually in a decoupled manner. 70 70
When we look at these services, they're going to be defined 71 71
within the scope of functional business requirements 72 72
and these things can then be reused for different purposes. 73 73
As you look at these different services, 74 74
you're going to look at them and go, 75 75
this service is going to be used for this function. 76 76
This is a SMS program. 77 77
It's going to take some message and send it out as a text. 78 78
This program might be something that's going to get things 79 79
in through email 80 80
and then it's going to output it in this other format. 81 81
Whatever it is you're actually going to build, 82 82
it's all based on your functional business requirements 83 83
and allows you to reuse them time and time again. 84 84
Now, one of the things we have to consider 85 85
is that if we have all of these services 86 86
that are being built in a decoupled manner, 87 87
how do we get them to communicate together? 88 88
Well, we're going to use something known 89 89
as the Enterprise Service Bus or ESB. 90 90
This is a common component of SOA architectures 91 91
that helps us facilitate this decoupled service 92 92
to service communication. 93 93
When you look at service-oriented architecture, 94 94
it is going to be looked at from an overall design architecture 95 95
and it's a way for us to map the business workflows 96 96
to the IT systems to support them. 97 97
Again, our whole function here is to figure out 98 98
what is the process we're going to do? 99 99
What is the business process that we need to mimic 100 100
and based on that business process and workflow, 101 101
we can then pull all these different pieces 102 102
and services together 103 103
with those IT systems that will support those services. 104 104
Now, one of the things that really helps us 105 105
with this is the idea of microservices. 106 106
Microservices are software architectures 107 107
where the components of the solution are conceived 108 108
as a highly decoupled service, 109 109
not dependent on a single platform type or technology. 110 110
Again, by using these microservices 111 111
and designing our systems in this way, 112 112
we are actually having a paradigm shift. 113 113
We're thinking about doing things differently 114 114
in terms of application development. 115 115
When you're using a microservice architecture, 116 116
it's going to have some 117 117
of the same general principles as SOA. 118 118
It sounds a lot alike, doesn't it? 119 119
Now, when we look at these, they're going to contain things 120 120
like self-contained service modules, 121 121
each one performing a single function 122 122
with clearly defined inputs and outputs. 123 123
Sounds a lot like SOA, right? 124 124
We're also going to then take those services 125 125
and apply them to the design of network applications, 126 126
such as an order processing system, 127 127
a video streaming service, 128 128
a messaging system, an email system, a file support system. 129 129
Whatever those things are, we can take them, 130 130
network them together, and create a larger service. 131 131
So you may be asking yourself, what's really the difference 132 132
between SOA and microservices 133 133
because they sound very, very similar. 134 134
Well, when you see SOA, I want you to remember that SOA, 135 135
it allows applications to be built 136 136
from services with some interdependencies. 137 137
Now, when you start dealing with microservices, 138 138
on the other hand, 139 139
you're going to have microservices that are capable 140 140
of being developed, tested, and deployed independently. 141 141
These microservices are more easily scalable 142 142
than a big monolithic app 143 143
because only the necessary service modules you need 144 144
will need to be scaled up to support it 145 145
rather than having to provision additional resources 146 146
for the entire application infrastructure. 147 147
So when it comes down to what is the difference 148 148
between SOA and microservices, remember, 149 149
if we take services and we put them all together 150 150
in some kind of business process 151 151
and we create interdependencies, that is SOA, 152 152
that is a service-oriented architecture 153 153
where everything that runs that is a service 154 154
and we connect them all together. 155 155
When we start dealing with microservices, 156 156
they're independent. 157 157
They are one individual thing that's going to be developed, 158 158
tested, and deployed. 159 159
And so really, it's all about interdependency. 160 160
When you're dealing with SOA, you have those connections. 161 161
When you're dealing with microservices, you don't.