‫Obviously, there is no better approach here.
‫I'm not saying server side is best and client sucks.
‫There are advantages and disadvantages.
‫Let's start with a client.
‫What's the advantages with the client side?
‫So if I have a client side server, get what I will minimize the over the overhead on the on the server
‫side, if you think about it.
‫Right, because I'm going to execute everything the client takes the the the memory allocation and the
‫execution.
‫Right.
‫Transferring the results.
‫And the client is responsible for this cursor.
‫Right.
‫The server has nothing essentially serves the connection and the connections.
‫The cursor is closed.
‫Right.
‫However.
‫OK.
‫There are there disadvantages, This is.
‫If if you execute a side cursors, what happens is the network bandwidth bandwidth of the network is
‫huge.
‫If you're pulling a lot of roads like in this example, obviously it's a bad it's a bad practice to
‫do so.
‫But if you do that, then you'll end up with a lot of network.
‫You can saturate your your network bandwidth.
‫Right.
‫Essentially get your bandwidth and the other disadvantages.
‫Your client might not have that much memory to to process the stuff.
‫OK, so.
‫Advantages and disadvantages rights clients, but the server is now relieved of this, right?
‫The good thing about the server side cursor, which is this one server side cursors, is what what are
‫you going to do as you execute this oversight?
‫And you can see that it's the client is relieved, right?
‫So you put the overhead on the server versus the client.
‫So the server is now doing more work.
‫The server is keeping hold of these cursors.
‫And imagine hundreds of thousands of clients doing the same thing, opening all the server cursors and
‫the worst of all, leaking those cursor.
‫Oh, my God, your database.
‫You can endanger the database, right, of just overflowing the database because, hey, this is like
‫you leaving all these cursors and leaking all of them.
‫OK, but, you know, if you're using them very moderately and in a smart way, you can you can you
‫can actually benefit from server side cursus.
‫Right.
‫So, like, hey, I'm holding I'm processing like a million rows.
‫Let me process 1000 rolls as a result.
‫Do something with it.
‫I could do a mass-produced, for example, and do something within etel it to something else.
‫Right.
‫And then server circuses are great for that one process processing one million resort or whatever and
‫then doing something with it and then fetching 50 rolls at that time and doing something with it and
‫exiting.
‫But.
‫If you.
‫Shouldn't really use it all the time, especially if the application applications like you don't just
‫create server suckers for the fun of it, right, because you might leak and leaking can be dangerous,
‫guys.
‫All right.
‫I think I think that's the difference between server side and client side.
‫Obviously, there are advantages and disadvantages for both.
‫Right.
‫Obviously, you can stay with client side courses, but you have to be very careful when you --.
‫Never do this, never select all.
‫Obviously that's a bad thing.
‫Never do an unbounded query like we were doing here.
‫You get to do a where clause always.
‫You can essentially simulate a server side cursor by doing, I think, a let's call limit.
‫Right.
‫Give me give me the first results.
‫Right.
‫And if you do a server side cursor, remember, this is a completely stateful operation.
‫Right.
‫So you can't really use it.
‫Well, in a web environment, you cannot just do a service that creates a server cursor like you cannot
‫build it in a stateless manner.
‫OK, so I really prefer that personal, if you ask me.
‫I prefer clients like Curser and you have to be very, very diligent to do what you are doing.
‫All right, guys, that's it.
‫That's all for me today.
‫Enjoy this video.
‫That's it, guys.
‫Stay awesome.
‫I'm going to see in the next one dies.
‫Goodbye.