vrijdag 8 april 2016

Middleware

Middleware is 'man in the middle' approach. And why should you use it...or not?

What is it?

From Wikipedia:
Middleware is computer software that provides services to software applications beyond those available from the operating system. It can be described as "software glue".[1]
Middleware makes it easier for software developers to implement communication and input/output, so they can focus on the specific purpose of their application.

In what situation should I use it?

Well, basically what I have found logical (though not always true) and learned from different classes/courses, is that you use the man in the middle approach, to make connections between systems manageable. Also, the amount of connections, in ideal situations should be limited. 

Consider the following:
I have system A (sysA), which is lead for data A (datA). I implement a system B (sysB), which will be working with the data it receives from system A. So we have a connection from sysA giving a raw copy of datA to sysB.

Well, good, we have two systems and one connection. Nothing wrong so far. Now, I am forced to implement a new system C (sysC), which also is using datA. So I make a new connection on sysA, with a new port, new service, to send datA to sysC. On which also a connection is created to accept the data on a specific port.



Well, nothing wrong there. We have three systems and two connections. Yay!
BUT, now we find out sysB crashes and we have to set up a new system, different DNS name, different port. We set it up and modify the number on the sysA side.


No big problem.....yet.

Now, we expand our company, implement new IT solutions, expanding the streams of data within the company.

So, we have the leading system, that has an outgoing connection to five systems. However, we now have systems that use subsets of the data from sysA. Instead of datA, we have subset(datA) as datB, another subset(datA) as datC.

We can even make an extra complexity by making a leading or updating connection from sysB to sysA, or worse, a query connection, from sysB' AND sysC, but sysB also requires data from sysC...

Now we have five systems and five connections. But remember, these connections are single direction. The maintenance, for the keen observer is overseeable but becoming cumbersome.

Lets see what we have:
sysA
  • connection 1: output, datA, port3, remote system B'
  • connection 2: output, datA, port2, remote system C
  • connection 3: output, datC, port4, remote system D
  • connection 4: output, datB, port5, remote system E


sysB'
  • connection 2: input, datA, port2, remote system A
  • connection 3: input, datE, port3, remote system C
sysC
  • connection 1: input, datA, port1, remote system A
  • connection 2: output, datE, port2, remote system B'
sysD
  • connection 1: input, datC, port1, remote system A
sysE
  • connection 1: input, datB, port1, remote system A
Yeah yeah, now you have been jabbering about connections and we get it, adding more systems will make connections expand more and more. But keeping a nice list, will make it possible.
True, very true, however, if someone new has to take over the maintenance, you better make sure that the list is up to date and that there are no typos in them. Why? Because if I ask someone to adjust connection 2 on sysD, it will expand solution time ridiculously. A. there is no connection 2 on sysD, B. finding out whether you subsequently meant sysA, sysB' or sysC is hunch work.

But that still doesn't warrant a middle man solution...or does it?

Lets look at the diagrams, if there was a middleware solution:
Does this really look much easier?
Now lets look at the amount of connections per system.

sysA
  • connection 1: output, datA, port1, remote system midA
  • connection 2: output, datB, port2, remote system midA
  • connection 3: output, datC, port3, remote system midA
sysB'
  • connection 1: input, datA, port1, remote system midA
  • connection 2: input, datE, port2, remote system midA
sysC
  • connection 1: input, datA, port1, remote system midA
  • connection 2: output, datE, port2, remote system midA
sysD
  • connection 1: input, datC, port1, remote system midA
sysE
  • connection 1: input, datB, port1, remote system midA

midA

  • connection 1: input, datA, port1, remote system A
  • connection 2: input, datB, port2, remote system A
  • connection 3: input, datC, port3, remote system A
  • connection 4: output, datA, port4, remote system B'
  • connection 5: output, datE, port5, remote system B'
  • connection 6: output, datA, port6, remote system C
  • connection 7: input, datE, port7, remote system C
  • connection 8: output, datB, port8, remote system E
  • connection 9: output, datC, port9, remote system D
So....er....what improved? We got even more connections, with the same amount of systems +1 and have more possibilities for typos.

WHAT IS THE BENEFIT?! or Rather...when do the benefits start to pay out?!

Well, look very closely to the connectors. Now, imagine you add three new systems to the landscape, which used either datA, datB, datC. They will only require a connection from the midA system. This simplifies the maintenance and configuration tremendously.


(If you look closely, I even sneaked in a reuse of datE to sysH. The only thing I needed to do was make a connection on midA to export the same data to sysH.)

Also, imagine that system C now fails and needs to be rebuild and gets different configuration? You only change the settings on midA and all other systems are totally unaware of the problems with sysC. Now, sysC will be called sysC', but for the rest of the systems in the landscape it will be still midA. 

Conclusion


It is true, that if an environment is not likely to grow beyond about 5 systems, a middleware solution isn't really useful, unless you want to be prepared for future changes. 


What middleware is there?


For middleware solutions, there are different options. Freeware/Open source and licensed solutions. Which you would need, depends on the kind of business and how much you are willing to code yourself.

In my branche, healthcare, we use Cloverleaf, because the HL7 (Health Level 7) dataconnections are preconfigured. For other environments Biztalk from Microsoft can be an option. Below are some links to different solutions. If you want more indepth info on how to choose the right type, contact me.


Middleware manufacturers:


but there might be others out there.


dinsdag 8 december 2015

SQL server LDF move


Today I ran into something that was on my plate for some time already.

One of the applications in our organisation used an sql database on a consolidated SQL server (meaning, there are more databases on the server, owned by other applications). At installation time of the new SQL 2008 server R2, I wasn't contacted, so the initial databases were created without correct forethought.

Best practice in my opinion:

  • Drive for system
  • drive for databases
  • drive for logs
  • drive for backups


BUT then you should setup the server to automatically place new databases divided over the drives mentioned above. 
Another thing you should make sure, is to remove default SQL folder names like: MSSQL10_50.MSSQLSERVER\MSSQL. Make it consistent over all drives: either in root of the drive, or in a specific instance folder.

Now I had to move a 110GB (yes really) Log file, from my database drive, to the log file drive. Which in itself takes time to move, but the steps also aren't without risk.

Shutdown application so the database isn't used anymore.
Take down the database on the server.
Detach database.
Move the LDF to the appropriate drive.
Reattach the database with the correct drive location for log files.

When you want to shrink a database log of 110GB, which is what you SHOULD do when the actual DB is only 1.5GB, make sure you change the backup type to Simple and the initial size for the log to be as small as possible (also check irratic max growth rates).

Currently I have all the stuff in backup and shrunk the files to manageable files.