Find the show notes and download the episode here.
Michaela Light 0:02
Welcome back to the show. I'm here with Dave Ferguson. And we're going to be talking about how your database relationships may have fallen into a rut and how to get out of sad, right so your relationships can be fabulous with your ColdFusion and database. So welcome, Dave.
Dave Ferguson 0:19
Hello, how are you?
Michaela Light 0:22
I am absolutely effing fabulous. How are you in sunny California, Southern California.
Dave Ferguson 0:28
I wish it was sunny. It is Southern California but not sunny.
Michaela Light 0:31
vakeel bio says sunny Southern California. It must be sunny
Dave Ferguson 0:36
it mostly it's sunny. But it's cold. It we're in like the cold spell right now. But it's normally pretty, pretty nice here. Can't complain.
Michaela Light 0:45
So you're somewhere south south of Los Angeles. I understand one of those amazing theme parks.
Dave Ferguson 0:50
Yes. Not not not the ones ran by the mouse. The other the other kind? The more extremes non mouse theme, the non mouse departs with extreme rise. Yes. Well, that's
Michaela Light 1:00
very appropriate than non mouse because we're going to be talking about non SQL or no SQL. So that's just a plug for what's coming up. Yep. Yes. But you've been doing it and cold fusion for decades now. Oh,
Dave Ferguson 1:16
it feels like an internal debate about how you? Yeah.
Michaela Light 1:20
And eternity. It's sometimes. Yeah. Well, we From Here to Eternity as they said that movie. But how did you get into all this?
Dave Ferguson 1:29
Oh, geez. So I started development. If you're looking at ColdFusion versioning. My first foray into development was cold fusion 1.5. Way, way, way back in the day. And then, yes, alert days, way back before Macromedia before everything. And I literally got into development by 100% accident. And that's not like a joke. It's an actual real thing. I had I will skip all the gory details. But I had a very, very bad accident, moving a refrigerator and got severely injured. And I was unable to continue to do the job I was doing due to physical constraints that I had for a few years. And I needed to find something else to do. And I literally one day I was sitting in the restaurant I worked out at the time when I when I got injured, rehabbing and just sitting there one evening reading a book on HTML for Dummies, no joke. And this guy walked up to me and said, Hey, do you build websites? And I said, kinda, I'm like, I'm just learning. I got to figure some stuff out. And he's like, Well, I need one done for my company. And we don't know what we're doing. Do you want to learn and make something for us? And I was like, why not? I'm doing nothing anyway. And then I asked a buddy of mine what I should do to build a site. And his answer basically drove the rest of my career. Because his answer was, hey, I've got this CD for cold or this floppy disk. For cold fusion, you should try and use use this. Wow. And that's where I started. And then, fast forward many years later. That's where I started. And now
Michaela Light 3:25
you now you work on large enterprise systems, which don't have refrigerators.
Dave Ferguson 3:29
No, no, I now do well enough that I don't move for dryers anymore. I have them move for me. Thanks to plan. Yes. So I guess has some good thing on the way. And yes,
Michaela Light 3:44
I remember cold fusion 1.5 It came with a web server made by O'Reilly I seem to remember. And you can get a free T shirt in the box.
Dave Ferguson 3:53
And the confident administrator was a standalone application that you worked on. Because it wasn't Java based back then. And you had no executable directories, it was very vastly different.
Michaela Light 4:06
It was dvml Instead of CFMs.
Dave Ferguson 4:08
You can actually in some cases, you can actually write dvml Wow, using C instead of the CF prefix on tags you can use DB and it's something that still kind of works
Michaela Light 4:20
Wow. Yeah, I'm guessing your health must have recovered because I see that you do mixed competitive martial arts
Dave Ferguson 4:28
yes I'm doing well yeah, I'm actually I just recently few months ago became a third degree black belt in Taekwondo.
Michaela Light 4:34
Whoa, I better not mess with you.
Dave Ferguson 4:37
Yeah, so got that recently. So now I same rank is my son. Oh, my son is way more or faster and powerful and could kill me any second. But no, both my son and I
Michaela Light 4:49
is not just strength in martial arts, right. The
Dave Ferguson 4:54
you know, a lot more mental, mental or physical sometimes. Yes, but my No my Son, my son's actually a world champion. I'm Wow, taekwondo. Yeah, he's he's really good. I'm a, I'm a multiple state and district champion in different disciplines in Taekwondo. But we can
Michaela Light 5:13
help. How does being Taekwondo, triple Black Belt help you be a better developer? Dave?
Dave Ferguson 5:21
I would say that's one of the things that I've learned in. That translates from Taekwondo in general to development is mental acuity. Just being able to stay focused, and not less, especially for like competing in taekwondo, that is ultra stress. Because you're going to walk out onto a mat in front of a whole bunch of people you don't know and be judged. And that concept actually, was one of the ways many years ago that got me over being afraid to show code to somebody. Because I stopped really worrying about what somebody else thought and saying, I'm going to do what I'm gonna do, whether they like it or not. And that was kind of the same thought process. I started going through with sharing code and talking in and going be more out there with what I've worked on. Because I got less worried about what somebody else was going to think. It's like, like it really don't, it's that simple. So it kind of translated over pretty well.
Michaela Light 6:19
Well, that probably makes it easier for you to publish things open source, because I know you've done a bit of that. I know, learn CF in a week. You just you guys just made that open source, didn't you?
Dave Ferguson 6:28
Yeah, we recently Yeah, we redid the whole thing. Prime comm GS a couple years ago, maybe now. Yeah, they redid the whole thing. It's all open source now. So you everybody contribute, get the source code if they want it. Yeah, made it well, let's
Michaela Light 6:41
talk about learning see if and the week a bit more later. But I perhaps we should just talk about, you know how some ColdFusion developers get stuck in a rut with their database or other pieces of fusion ecosystem?
Dave Ferguson 6:54
Yeah, mostly, I mean, I would say Yeah, mostly like database specifically. Everybody, I mean, you get this happens with anybody in anything you do. When you get really good at doing one thing. People just tend to stick with it. Because it's like, that's the train just the way I know how to do something. And I'm going to do this because it's just makes my life simpler. But at the same time, you're almost doing yourself a disservice, because you're not learning something new that can make your life even easier. So you don't want to you don't want to have that stuck in a rut of I'm going to do, I'm gonna do the same thing at that 10. Well, you want to do the same thing over over to you, you're really good at it. But getting really good at something allows you to then learn something else easier. So if you just stick to one thing, you're never going to get down that I'm going to learn something else easier, because I'm just sticking with one specific thing.
Michaela Light 7:48
I think there can be a lot of benefit to trying out some new ways. I mean, obviously you can't, there's an extreme way every line of code will be trying a new way. And that will be a disaster zone. You know, the opposite is you always do it the same way and every projects exactly the same. That just gets boring, and you never never learned to me the advantage of trying new things, whether they succeed or not, you know, not all new things succeed, right? Yep. Sometimes you try something new and it doesn't. But it provides cross-fertilization You see a new you have a new way of looking at things. And instead of trying to treat you know, to use a metaphor of the hammer and the nail you know, not everything in the world is a nail sometimes there are angle brackets or screws if you try and use the hammer to nail an angle bracket together, it doesn't work so well as as
Dave Ferguson 8:35
an example it you can't you can't treat your blog, like it's a shopping cart.
Michaela Light 8:42
There you go. Well into that. Lena, you're right. COVID there
Dave Ferguson 8:45
and got the same thing.
Michaela Light 8:47
No, they have different requirements. So and so yeah, well, you know, traditional relational databases have their place and there's nothing wrong with them. But you know, they are a hammer so to speak. And sometimes a screwdriver comes in handy. Yes. So, and I just want to make a call out to the listeners, you know, your ColdFusion land needs you to try new things because if you don't you're gonna get stagnated stuck. And this whole thing I have quite a few people who complain to me that quote CFD is dying, which is a bunch of bullshit because it isn't dying. There's a lot of alive and new things and there's new versions of Lucy and Adobe ColdFusion and new database versions and new tools like command box came out a few years ago but I still speak to people who don't even know command box exists which like blows my mind, but
Dave Ferguson 9:36
people are crazy. When box is one of the greatest things ever invented.
Michaela Light 9:40
It is it's free. It does amazing things you said you were running three different ColdFusion versions on your Mac you know development system using command box and it's super quick to try things out and it's great technology.
Dave Ferguson 9:55
The best thing is I can work like I have one engine right now running cf 2016 Now we're working on upgrading it. And I literally just go into the configuration and change a number and restart it. And it goes back and forth between the two. So I can see things that are going right and wrong. It's amazing.
Michaela Light 10:12
I talked to Brad wood on the show a little while ago about, you know, some of the cool command box modules that he and the other guys all put together. So I'll put that link in the show notes for folks who are interested. But you know, I just want to say anyone listening who's ever thought, oh, cold fusion is dying? Yeah, you know, there's been some issues in the past. But you the listener, are able to shift this by doing what Dave did here and trying out something new and getting out of a rut. And we're going to talk about one particular thing here, which is trying out some different ideas on database stuff. So I'm curious, Dave, what are the most common databases that confusion most ColdFusion developers use?
Dave Ferguson 10:58
I would I don't have a specific number. I know you've done polls and stats on this stuff. But I'm, I'm pretty sure that at least 80 plus percent of systems out there are running either SQL Server or MySQL would be mine. It could be higher. possibly hire.
Michaela Light 11:12
I think he's in one of those to install. recall some of them relational database,
Dave Ferguson 11:18
but your your Oracle is not a cheap thing. So most people aren't going to run Oracle because it's really expensive. But yeah, there's definitely there's lots of other databases out there. But yeah, you're generally going to be MySQL or SQL Server, SQL Server probably being the predominant favorite.
Michaela Light 11:35
It is, and there's a free version of SQL Server Express, you know, you can use that on anything. MySQL, MySQL, three, two, but MySQL is free forever. As far as size, I think my SQL Server Express, I want
Dave Ferguson 11:49
to say you're limited to 10 gig. Yeah, it's like 10 gig, you're limited.
Michaela Light 11:53
Yeah, you've got some limits. But let's face it, most people don't have 10 gigs of data. And if you do have 10 gigs of ad, you probably have a budget to be able to pony up. Yeah, something. We, we have
Dave Ferguson 12:03
systems at work where a single table has 10 gigs. So Oh, wow. Yeah. And large enterprise giant systems? Yeah. Like I said, I work on big stuff.
Michaela Light 12:14
So what what are the you know, motivations for trying something else other than get out of the rut and try something else. These relational databases, delete, you have some limitations, or I don't know it's
Dave Ferguson 12:31
necessary. Relational databases are limited, they're limited by cost. There's a very big price point in using something like SQL Server, like you said, if you're running over a 10 gig limit, then you've got to deal with licensing of standard hosting all that other stuff that comes into play. So there's definitely there's a cost impact for your choices that you make, whether it's SQL Server, or MySQL, or another variant. So but for the most part, I mean, relational databases are fundamentally the same. They all store data in a relational manner. Hence, they're considered a relational database. But there are far other ways to store data, when you don't need that relational that permanent relational aspect.
Michaela Light 13:18
Just in case anyone listening doesn't know what relational means here is basically you've got a foreign key, and you've got tables, relation databases, assume you have tables, all the rows are exactly the same columns. And then sometimes you can relate a record from one table to another through a foreign key, primary key and a foreign key. And that's the relationship. You might be enforcing that in the database level, where you might not depending on how, how you
Dave Ferguson 13:47
either enforced by color or or database by keys.
Michaela Light 13:51
So it works well, and it works really well if your data is really regimented. And it it kind of doesn't work. So well, if the data is a bit more loosey goosey, which we'll get into. That's a technical term, Lucy. Yes, yes, it is. We'll get into later. And then I think one of the other issues, correct me if I'm wrong, is that you know, some of these No, SQL databases can handle much larger data volumes and scale better. Can you tell us a bit about that? Maybe? Yeah.
Dave Ferguson 14:21
So for like SQL Server scales in a different way, it scales, it scales more horizontally. I'm trying to remember the actual terminology here. So don't get this wrong, because it's basically you need to buy a bigger server. Yep, you basically need to buy more machines to scale SQL Server. It scales in a much different sense. Where something like MySQL or sorry, like a no SQL database scales horizontally, where you can create more nodes as you need them. Pretty cost effectively. You can easily expand a SQL Server, it's not an easy thing to do. You need to buy either more hardware, more processors give it give it more, give it more under the hood in its engine to do more, were something like no sequel or MongoDB, NoSQL different types of like that, you can literally stand up another instance of it and have them start sharing the load pretty easily. Because they're designed to do that. SQL Server can easily branch out and be clustered. But when you start clustering SQL Server, a year cost ramps up drastically. Because now you need multiple pieces of hardware. Even if you're going to mirror SQL Server, you need two servers, plus a witness. So you're now into three machines. So mirroring is pricey in anything you want to do with expanding sequel to be fault tolerant. And having multiple occurrences or expanding it becomes very cost very costly. Most companies can't pay that cost when it gets really, really pricey. You can't use that free version of SQL Server clustering, it doesn't support it. So you've got to start by you got to start writing enterprise class software. Where something like MySQL, that
Michaela Light 16:08
means that a six or seven figure check, I believe,
Dave Ferguson 16:11
yes, yeah, you're writing big checks at that point. Like, MySQL, you can spread it out, it works a little better. But you're still you're It's just different. But like, yeah, so something like a no SQL database, or they expand differently. And it can span a contract, depending on load pretty easily. Where once you expand, that sounds like a contract.
Michaela Light 16:37
Right? Right. So it's, maybe I'm getting ahead of myself here. But is it the case that no SQL database is more quotes cloud ready? Because when I think of expanding on tracting, I'm thinking you've got a, you know, dynamic cloud, I always say container system?
Dave Ferguson 16:56
I would say yes, depending on what the data is you're storing. Because it's all on the data. If you're using different clouds, like Amazon cloud, or whatever, they have relational databases that expand and contract pretty nicely. Month, they're costly.
Michaela Light 17:14
So this is a lower cost alternative if you don't need all the things that you get in a relational database me up. So and then the other thing, you know, we mentioned earlier relation database, all the rows are the same as that. And that's, is that no longer true for a no SQL database? Can you have different data structure in each row with your key pairs?
Dave Ferguson 17:37
Well, as we'll get into, there are different types of no SQL databases, and depending on the type of database you're using, yeah, I mean, you can have, they don't necessarily use rows in some occurrences. But those data objects can be completely different from each other in the same place. So it allows you to have a more robust storage without altering structure.
Michaela Light 18:04
But they're not totally, you know, free form, they have some kind of XML markup or some structure in there. So you can access the data. Yeah,
Dave Ferguson 18:13
something like MongoDB, which is a document type SQL Server document, no SQL database, it literally is just hey, it's like a folder on a.on us on a computer, you can just dump stuff in it. It doesn't have to have any predefined structure. You say, I want you to store this there as Okay, I want to store that. I don't care what it's all JSON. And you say, Okay, here's that. And then the next packet, next JSON thing you put in, it could be completely different from the first one, it doesn't care.
Michaela Light 18:43
So if you think it take that analogy a bit further, the modern format for Microsoft Word is an XML format. And you could think I've got some file folders in my computer, and I'm just dumping different word documents. Some of them are really structured, some are more loose. But I can you know, as long as I can navigate to them, I can pull that data back out. And MongoDB is a some of these other ones, what are the other ones that people commonly use?
Dave Ferguson 19:11
So there are, there's four main types of no SQL databases. There's a hierarchy really? Yeah. So there's the most people don't really get into these. But if you're looking at the different types of like, no SQL databases, you have Missy, I want to make sure I get these names, right, because they're very, it's very important that I name these properly. You're the document type database, which is like Mongo, you have a key value pair, which is more something like Redis, which we can talk about, you have Y column stores, which is completely wonky way to store data. And then you have a graph type database. Wow. There are four main types, no SQL databases, and those are kind of the four most common is a document style, which is no SQL, or sorry, MongoDB right.
Michaela Light 20:00
it. And so that's MongoDB, Couchbase, MarkLogic, Cosmos, and all the sub variants thereof. And that's what we're going to focus on today. But if anyone listening is interested in all those other types that you mentioned, I'll put some more notes in the show notes. So you can read a bit more and see some examples
Dave Ferguson 20:22
of some of those really like key parts of those, like, for example, like key value, if you're using like a centralized session store like Redis, for cold fusion, that's all in a value SQL database. That allows for very fast retrieval of name value pair data, which is pumping for like session store. Right, I want to talk about wideangle. Because that will just completely confuse people because it's really strange. Yes, the other really, really weird we were talking about this earlier, before the show was graph databasing, which is really, really interesting, the concept I've really looked into, because it's a really mind boggling concept of way to look at your data, where it treats the relationship as the first class citizen. And how that is. So when you're literally going for data, you actually in a in a graph database, you actually query the relationship, not the data itself. So it's a completely backwards thinking compared to traditional relationship, relational databases. So when you start moving into the plummeting into that world, your your normal, your normal becomes the opposite. And it's a really fun, interesting way to look at data. And I get why they would do it for something like that. Because your your statistical graphing data changes at a whim. So when you treat the relationship as the primary first class citizen allows you to grab that data really quickly.
Michaela Light 21:44
I had a intrigues me, I'm interested look into that. I must have met Dave with, you know, SQL Server, or any other relational database. You know, Dr. Cod dreamed up when he created the idea of relational databases IBM mean, many, many years ago, in the 80s, I believe, or possibly slightly earlier, it always seemed to be an afterthought, to have the relations between the tables, you know, it's like, here we have the tables, they're almost like flat files, right? I mean, I know they're optimized and stored differently these days. But originally, they were basically every table is a flat file, and you must have all the rows be the same, because that's how a flat file is you can't have a flat, it can't be flat, and everything's different. And the relationship was almost like tax on top of that, and it wasn't really fundamentally built into it. No, and that trips up a lot of new newbie developers, right, when they first get started. They don't really get the relationship part. And then they don't index their database. I'm sure you come across this in your work, yeah.
Dave Ferguson 22:47
Mostly generate like the, you have like the user table, and then a user types table. And they will create those new tables and manually put the IDS across, but won't link them with a key. So the keys there, but they won't use a, they will use an index to LinkedIn properly. So then you get right out of sequence, just just because you're just it's a when you're you new to it, it's not something you consider. You don't remember to put that piece in the middle. So you manually insert keys, and it gets all weird, but yeah, yeah.
Michaela Light 23:19
Well, we're working on moving a legacy system. Actually, I said, dotnet system, we're moving at ColdFusion, which is a great thing to be doing, I feel. But the previous developers who are nameless, and you know, was written 20 years ago, so I forgive them. But they didn't enforce that if you delete the parent record that your child records need to be cleaned up to. So it's often data. So and that's not that uncommon. I've seen that quite a few times. That's not database integrity. Anyway, let that's very intriguing. Now. One of the things that relational databases dude would do very well. And it's one of the reasons like banks and, you know, shopping carts, and whatever use them is they managed to have a you know, we have a transaction in SQL, right. And they keep the data consistent, right? Yep. So if you put money into your account, it's going to be in there there's no danger that you put money in and someone else doesn't see it in there.
Dave Ferguson 24:20
That's correct. So what you're what you're discussing there's a concept called acid.
Michaela Light 24:26
Acid. Wow acid. This is sounds very Southern California.
Dave Ferguson 24:32
So acid trying to like I was trying to look it up real quick, Turner, because I'm drawing a blank. Remember, it's stands for accuracy. The law. I'm trying to I don't want to say it wrong. Here's
Michaela Light 24:43
a tome assisity automaticity. Consistent here. I'll highlight it in the show notes for you. My cursor is at the acid point, so you can explain it. Gotcha. Yes. Yeah, so tell us Dave what's Why Why does it matter?
Dave Ferguson 25:00
So why it matters is it's one of the big, big variance between a no SQL database in a relational database is acid support. And that basically means if I'm going to write a row of data, can I guarantee without a shadow of a doubt 100% that is going to get there on the relational Bono's notes or not, yes.
Michaela Light 25:21
Like if you have a parent record and a couple of child records and some grandchild records, either all get inserted, or none of them get inserted, you can't have a mix up. So family is off in Las Vegas, Boston,
Dave Ferguson 25:35
yes, that would be bad, especially they don't know where each other and then can't find their parents ever. Yeah. So in a relational database, like a banking system, this is where this is really, really, really critical. Makes us transactions run everything because they have to guarantee if I'm putting $1 in my account, that that dollar goes, the right to the right place, ends up there is properly processed, my account information is updated, so on and so forth. It can't use the spreadsheet can't bank on the fact that it made it, it actually has to guarantee that it's not a joke, then maybe unintentional, Jamaican,
Michaela Light 26:07
unintentional, show that, okay.
Dave Ferguson 26:11
So it has to guarantee that row of data gets inserted properly. Right. And that is one of the key things. And that's why some banks and bigger companies use systems like Oracle, where they're way better at dealing with something like that. But no, SQL doesn't use acid at all, if there's if there's any acid support is very minimal. It uses a concept called what's called eventual consistency, where it says, you're going to write a row in it, it's going to get there at some point, we know it's going to get there at some point, we just don't know when it's going to get there. And that usually only comes into play when you're using clustered no sequel instances, like the one of the servers down the chain, it says, hey, that's going to eventually get there, I'm not going to let you know if it gets there or not. But it should get there at some point, where if you're dealing with like a SQL server cluster, and you're dealing with pure acid support for like banking, unless, if that record doesn't get rid of written across the entire cluster, it won't, it won't respond, it will respond and say I couldn't write this record. Even even one server in the cluster fails, it is gonna say I couldn't write this record. That's, that's pure acid support. But no sequel doesn't use that it uses eventual consistency, where it's like, yeah, maybe
Michaela Light 27:26
you got to know me probably will get replicated everywhere eventually. But you know, but don't expect
Dave Ferguson 27:31
it there right away and may get there at some point.
Michaela Light 27:35
And it might turn up in several parts from the sound. Yeah, might be some of the family arrived in Las Vegas on Saturday, and some arrived on Sunday. And then little Johnny gets left behind.
Dave Ferguson 27:49
So it's a
Michaela Light 27:50
which, yeah, it's a different thing. And people may be thinking, well, that's really stupid. Mikayla and, Dave, why would I ever want to use a database like that, but there are some use cases, we'll talk about where that makes more sense. And the benefits you get outweigh the losses. From that? It's good. Yeah, and I will say one of the other things I sometimes see on systems is the performance of the, you know, the relational database can suck because, you know, someone's running reports, but they get held up by people putting transaction locks on updating the data a lot. Unless you were smart enough to turn off the locks on the report, because you didn't need it to be 100% consistent, because you're not a bank. You know, it can really cause a lot of slowdowns. I'm sure you've seen that a new
Dave Ferguson 28:41
Yep. A lot of times people put transactions just out of habit, not because they're required or needed. And then you get stuck. Yeah. And then they did they do put the transaction in the wrong isolation level, which causes even more problems.
Michaela Light 28:55
Right. So you know, that's a good thing to look at in your own code. Hey, do I am I printing bank statements? In which case Yeah, it better be consistent. Or am I running like a? You know, I don't know some other reports on sales report, for example. Typically, you don't need a sales report to be 100% transactional, accurate? You'd like it to be fast if
Dave Ferguson 29:17
you're dealing with finance moderately accurate, if you're dealing with Financials, I would say if you're dealing with money, and and if if you can be if you can't be off by a penny, then yes, you need to be transactional. But if your was like, Hey, how much do we make today? And if it's off by a penny, are you going to lose your lose your shirt? No, then okay, you don't necessarily need to lock your database down to fix that penny.
Michaela Light 29:40
Right, exactly. And that can really affect performance experience.
Dave Ferguson 29:44
And I tell them a bit about it. What they're really quick with that with transactions though I will tell anybody I would I will always and people will not like this and especially from like Adobe and other people. I will always suggest to not use Yeah, A transaction. And there's a prime reason why is you're creating a transactional lock on your database and a system outside your database. So there are occurrences where something goes wrong outside your database, and your connection doesn't transmit over to the database to release this lock in that from this transaction, your database gets home. So if you need to do anything transactional heavy in in a transaction, something like that, then I would always suggest doing and store procedures inside the database versus outside the system.
Michaela Light 30:35
Because then you have more control over
Dave Ferguson 30:37
it. Because if your database connection breaks, it's not going to hurt anything. But if I'm inside a massive transaction, and something breaks inside the transaction, I could theoretically break my database. So avoid that.
Michaela Light 30:53
So transactions are overrated if what I'm hearing
Dave Ferguson 30:56
they they have their place, but they see tend to see them more overuse than anything. Right? No makes sense. There's a perception that they need to be used when they don't need to be.
Michaela Light 31:08
Right. So let's just talk a bit about use cases. Because you mentioned there's no acid for MongoDB and other no SQL. And what are the downsides are there to no SQL. So
Dave Ferguson 31:33
other downsides, I mean, to know SQL, one of the bigger downsides is your because of how they store data, you can end up with extremely large databases, because of their non transactional sense. For example, if you're storing in a no SQL database, a shopping cart, you're going to store every ounce of everything about that shopping cart in that record, or that document as a simple as a no SQL database calls it. So you're gonna store everything about the user, their order, their shipping information, all of that is going to be all packaged together. Now if that same person has two different orders, you're going to have their same information about them their shipping information, duplicate it in because it's I'm sure it's specific, because it's order specific. But the beauty of that, here's where that the beauty of that I mean is better, because let's say you order something on Amazon, and you're having it sent to your house, you have all of your order information in there for that order, right? Now you want to order something on Amazon or have it sent to somebody else. I don't want to store that information as part of you, you and where I'm shipping something to you, because then that could mess up your prior order. So I'm going to store that shipping information separately. So that's where it comes into play. Because now the order and the destination are are permanently connected. They're not relational somewhere else, where that relationship could be messed up. And then you could end up shipping the wrong thing to the wrong place. If that makes any sense?
Michaela Light 32:59
No, totally make sense. I've no idea what database Amazon has behind it. I don't either. But if anyone listening, listening knows, please let us know. I'll update the show notes. I'm just kind of curious what they but because it is a relational database. It's a big relational database. I'm
Dave Ferguson 33:17
sure it is. But you can there's lots of different ways you can do that. So that's just one example of why you want to anchor that data together and not realize it
Michaela Light 33:26
Yeah. Yeah. What are the downsides either to going the most equal route.
Dave Ferguson 33:35
If you're talking is in, in usage, from cold fusion to how you're in to dealing with the databases, then one of the bigger changes is how you actually get to the data is completely different. It's you're not writing queries anymore, you're writing different things. And it really and gas, it's so different. It takes some getting used to. So once you get used to it, it's no big deal. But how you get to that data is completely different. And interesting.
Michaela Light 34:06
So you've got to learn a new for want of a better word query language, although I don't think they call it that. But yeah, yeah.
Dave Ferguson 34:14
Yep. We gotta learn it just it's gonna learn something different.
Michaela Light 34:18
Yeah. And then how do these different NoSQL products? I mean, with relational databases, if you switch from SQL Server to MySQL, yeah, you might have some hiccups, but basically, it's gonna work more or less the same unless you've got really fancy with all the T SQL stuff or whatever, T SQL.
Dave Ferguson 34:35
Yeah, there's not really it doesn't vary that much. I mean, essentially like MySQL to SQL server where you're doing top one versus limit one. Not that big. That's a pretty because one of the main things that trips people up because you can't do top one, you have to do limit one of the end your query. So but for the most part,
Michaela Light 34:54
basically my Yeah, basically on migrating the migrating between the two different databases is usually moderately straightforward. Yeah. Works the same
Dave Ferguson 35:04
way. Yep. But if you're gonna
Michaela Light 35:06
What about if I start? Go ahead? No, no, well, yeah, if you go if you start off with MongoDB, and now you want to go to Couchbase, is that easy, or that's like a total rewrite,
Dave Ferguson 35:17
that it can vary. Because there's no real standardization of data retrieval from a no SQL database. Your mileage may vary. You may get data to MySQL one way, or sorry, MongoDB one way, and retrieve it one way, but go to something else. And your method of your crud methods are completely different. And that's because they implemented something different.
Michaela Light 35:47
So there's no like Standards Committee like for for relational databases, there's some kind of standards committee, I couldn't tell you what's called but you know, Doc, Dr. Code, wrote that, back in the 80s, I, Oracle implemented the first relational database, and then whatever the precursor to SQL Server was, which I'm forgetting who they bought it from. But there was some other database that Microsoft based that on, I don't think Microsoft ever creates their own software, they always buy someone else's stuff that works good.
Dave Ferguson 36:17
If it works for you go for it.
Michaela Light 36:19
Certainly SQL Server was acquired from some other database vendor, I believe. Anyway, might the point is trying to make is there's some kind of effort, we're all they're all competing, but they they work together to keep it morally standard.
Dave Ferguson 36:34
Yeah, we're no sequel is different. They're all trying to build build a better mousetrap. So they've kind of all got their own, quote, unquote, standard of how to do things. There are a lot of them, like the document types, like no SQL databases are all pretty close to each other. But once you get away from that, and go to other things of different types of NoSQL databases, they start varying drastically.
Michaela Light 36:59
Well, let's focus on MongoDB. Because that's where you have some sample code, you can share with folks, those watching on video will be able to see it, but we'll stick it in show notes so people can see it there. Or if you have it in a repository somewhere, we're happy to link to that. So maybe you can, it would now be a good time to look at some codes, because we've been talking come up theoretical, and some people only like, well, that sounds all very fine. And well, but what's what's this actually look like? Yeah, let me
Dave Ferguson 37:36
share. For those watching on video, I will share this and I will walk you through some we'll walk you
Michaela Light 37:43
through those listening on audio format. And you can go to the Terra Tech site for the show notes to read the code too. So are there any little snippets? It's not like we're publishing war and peace here? It's just like, you know, a sample app?
Dave Ferguson 37:58
Yep. So these are slides out of a presentation I did on this subject. So
Michaela Light 38:03
at Adobe CF Summit, yes. Yes. Yes, yes.
Dave Ferguson 38:09
So the example I have on the screen here is basically how you would retrieve a collection. Now, okay, we didn't go over terminology, that's fine. But basically collections a table, if you want to reference that one. So how you would cow so in this one, so the no one thing then you'll see right away here in this example, with Mongo deer fur with no SQL databases, you don't have to have a table there to start with, you can create a connection and then just create a table right away. Because the table is just a blank, just just a blank container. You don't need to have somebody on a database in a database or administrator creating all this stuff, you just basically do it. So here, if you see in this example, I connected the service. And then I just told to create a collection or a table called bands. And then I just insert a band, band member.
Michaela Light 39:02
And that's it. Band as in Rock Band, as in
Dave Ferguson 39:05
rock band. Yeah, you're using the Beatles as an example. So I am this occurrence, I inserted John Lennon as a member of The Beatles. And it was that simple. So that's in this. So I created a database connector, which is pre set up in cold fusion, the administrator, and then I just tell it to create a table called bands. And then I just insert the single single band member. And that's pretty basic to insert, basically creating a table in a row.
Michaela Light 39:32
And so coming back to that metaphor we had before of having, you know, a folder in your Windows Explorer, or whatever operating system you use, which had a collection of documents. In no sequel lingo, we instead of saying folder, you say you've got a collection. And then you've got all these documents, which are equivalent to rows in a relational database. And then if you had a different quotes table with different infamy And that would be a different collection. Exactly. So, and then in this code, it's very similar to object orientated type code. It's how I describe it. Right? Yeah, inserting, inserting a document or updating it. Alright, it's not exactly the same. But you know, there's a, so this example
Dave Ferguson 40:24
app, yep. So this example I have on the screen, you see that we're inserting multiple, at the same time in a couple different ways. All this data against all the same, there's really no variant, but it's just the same thing, doing it a couple different ways. Inserting one insert or using inserting an array, and it will create it and then what you see on the on the screen on the right side is actually a screenshot out of the MySQL, or sorry, the no SQL viewer, which shows the data in the devil in the collection.
Michaela Light 40:57
Now all these things like you've got create collection, is that a no SQL command being run? Or that some cold fusion command?
Dave Ferguson 41:07
It's, it's a little above. So it's how you would actually create the collection you have created? It's called Creating you create flexion. But that's cold fusion code.
Michaela Light 41:15
Uh huh. Okay,
Dave Ferguson 41:18
it's part of the service.
Michaela Light 41:22
All right, and then this is this way, you've got dB dot bands dot insert, that's another ColdFusion.
Dave Ferguson 41:28
Yep. So we're telling you in this collection name, so DVD bands is collection, we're going to insert a row. So there's a lot of once you have selection, there's a lot of helper stuff along with that on what to do what you can do.
Michaela Light 41:41
Okay, so so when you will get how you set this up in ColdFusion, 2021. And one other versions, you can do this in but somewhere looking around in there, there's like a CFC or something that defines all these functions you're running.
Dave Ferguson 41:55
Nope. Well, and since I, in the cohesion engine, yeah, nothing I set up ahead of time now. Yeah, this is all the code. You don't have to say, oh, no, this was a single write any other? Nope. Over here. Nothing I Okay, Mongo service that you see here is actually a built in function.
Michaela Light 42:14
Oh, okay. Cool.
Dave Ferguson 42:17
But then let's say I want
Michaela Light 42:18
to now you've inserted or you've inserted all these documents into your collection. Yep. And now you want to go back and find the members of the band.
Dave Ferguson 42:27
Yep. Now, here's a different way, a different way to look at this. So basically, what I've done here is now I've created what a musician's musician collection is for musicians and what their instruments are, and so on, and so forth, what their, what their role is in the in a band. So the first thing I did, just because it's a sample was the first thing is I just drop it. So basically, that's just like deleting a table just to drop the whole thing. And then we create the musician collection, and then insert many, we basically insert an array of structs. And then at the end, we basically just, we're going to search for them, and basically return everything, using a, a command to describe everything. And then we're going to dump it all back out, which is what you see on the example.
Michaela Light 43:15
I thought now, I'm just going to pause you there, because you said this is sort of like you're inserting an array, which is called Fusion structure of structures. And we know from our cold fusion programming, that if you have an array of structs, each struck, you know, for each quotes row in the array can be different. And that's exactly what you have in this MongoDB. Right, each document in the collection can have a different structure that is correct to it. So if you're trying to wrap your head about what this is, what what a no SQL database is, you can think it well. It's a way of, of permanent making permanent the data in an array of structs.
Dave Ferguson 43:55
Yep. Very cool. So then taking that one step further. Let's say you're doing the same list of magicians, but you only want to find the drummers, you would find it by searching the structure using a name value pair. Hmm. So then in here, I want to find all of the musicians in this example for the instrument equals drums. And there's only two of them in here. So using a name value pair, it grabs those.
Michaela Light 44:25
So okay, so you're using the Find FIND function or what have you. That's skills. And then you're using a cute ColdFusion feature there with the right arrow operator whose name eludes me. Yes. Sam was a cold fusion 2018 thing. What are those things called? I forget
Dave Ferguson 44:45
what they for I forget.
Michaela Light 44:47
Okay, but they're a cool way of processing arrays and ColdFusion. Yep, in a single line. And in this case, what you're saying is fine, fine, all the dramas and then sir Uh, go ahead and run another function on each of them, which in this case is just dump them out.
Dave Ferguson 45:04
Yep, there's a lot more I can do, I don't know, this is where instead of doing a select star from musician where instrument equals drums, I'm just saying, Give me here's the, here's the musician, musician collection, find me, everything we're instrument is drums, and you can do wildcards and stuff in there. I think my next example that I do
Michaela Light 45:25
now, let let me ask you this, because before you come off that slide, you were searching for people whose instrument is drums. But we know that the structure the document, in a no SQL database may not have an instrument piece to its structure, right? The musicians who don't have an instrument, because they were just like dancers or something in the Prodigy or whatever, it would skip it, part of the return. So it wouldn't give an error. It's my point. No, we're not. So they can return it. And, and because this is all you said, this is you can dynamically create this stuff, and I'm assuming, so you've been adding musicians in for a while, and then you suddenly decided I need to record tattoos on musicians, and you can start adding that in, but your old code carry on running just fine. Yeah,
Dave Ferguson 46:14
you just have to in your code account for the fact that unless you if you did on a go forward basis and didn't fix older data, then from this point forward, you're going to have an extra attribute of tattoos as as your example. And you need to account for that, you know, code because if you don't, you're gonna throw errors when you get to the Find the older data that doesn't have it. But it's something
Michaela Light 46:36
that might come back to you or you just have to come back to your example of an E commerce company like Amazon, you know, suppose they start collecting, you know, they used to collect Visa, MasterCard payments. Now, they collect Amex payments, and they need extra fields for that. They don't really care that the old records don't have that data, because it's not relevant to those relevant already processed. Yeah. So this is more related to how a business uses their data than be totally Niall and everything has to, yes, filled out. The last
Dave Ferguson 47:09
example. Last example I think I have here is just basically how to I there's a couple here more. So here's how to like update an existing record. This is no SQL specific thing
Michaela Light 47:19
which the update function.
Dave Ferguson 47:24
So I'm going to update this ID. And I'm going to set born to a number or I can do math and say born is whatever the value is minus one. That's what that minus one will do. They'll say whatever that value currently is. They're just drop it down by one decrement. Oh, yep. So if you're looking at like a shopping cart, you can say where quantity plus one.
Michaela Light 47:47
Got it as an example. It's very analogous, analogous to the SQL UPDATE statement people are used to
Dave Ferguson 47:54
the leading is pretty simple. You can delete a lot of different ways. But here's just one example of the leading, I'm going to eat, insert Eric Clapton into the Beatles and take him away, just like the Beatles did. I use that to mean I'm it's funny. It's funny. It's true. They'll be sensitive.
Michaela Light 48:14
I never knew. Yeah, of course, he had his own successful Korea. So
Dave Ferguson 48:20
yep. So here's how to find a structure. And one of the beauties we didn't actually talk about yet, is the nice thing about no SQL is embedded structures. So you can embed a document in a document. So for example, if you have like it was using the shopping cart example, if you have a product, and you want extra detail about that product, you can have embedded structures, or you have the person where the address of that person is embedded in the person. And that's kind of what the example is here, where I'm deep digging deep into a, a, some JSON data for this example, that I dug up some Airbnb code, where on the right here on his executive flip these men were here we make more sense. On the right is the actual raw data that I'm looking through. And on the left is the output of the Find where I'm trying to find addressed on market use. We're using dot notation to dig deep into the data where I'm saying I want where the address dot market. So the market of this address is actually New York. And you can see that on the left where the address and then it has a substructure of its information, and in that it contains New York as the market. So this will return me. So this returns 607 records where this matched up. And you could go even deeper you just get to use dot notation to dive deep into the data. And it's very fast once strikingly and scary
Michaela Light 50:01
now, first of all, this is totally analogous to how you put a sub structure within a structure, you know, certain structure records in ColdFusion already. And then secondly, just to point out, you know, one document might have a certain sub structure, another document might have a totally different sub structure. And that's just fine with no SQL. Yep. So they don't have to have consistency between the rows.
Dave Ferguson 50:27
Yep. Because if you just started, let's say, You're a year in and I use an okay, and we need to fight instead of what citizen would market, isn't it? Because it's a little different. A market generally goes over multiple cities, or sometimes in multiple states, or counties. So let's say we started with country. Yeah. Let's say later, we're starting or tracking market, what market is it's in. So now, this wouldn't find any previous data that had no market unless you backup data, your data, like the example prior. So this will allow you to go forward and only find those records that actually have a market in them.
Michaela Light 50:59
Right, without giving an error for the ones that have a totally different structure? Yep. So very cool.
Dave Ferguson 51:06
Thank you. And that was my last example.
Michaela Light 51:11
All right, very cool. Well, we can stop. Stop sharing that. So we'll stick those examples in the show notes. So people can read them at their leisure, it's actually very straightforward. If you've ever used structures in ColdFusion, I think you're going to pick this up very quickly. And do that. So let's talk about how you what versions of ColdFusion does this work with either the Adobe or Lucy flavors and works
Dave Ferguson 51:37
with a lot of them. But if you're using ColdFusion, 2021, it's probably the simplest and easiest implementation there is.
Michaela Light 51:48
Why is that?
Dave Ferguson 51:49
So for those who don't know, in ColdFusion, 2021, they implemented the package manager. So most features in ColdFusion, that you would normally just find there, for example, like debugging, logging, all this stuff, isn't there. Like you can't connect to a database right away either, because the database module is not there. It's just the base engine exists when he first started. And you have to go into the package manager and turn this stuff on. So if you don't
Michaela Light 52:12
I know why they did that. But for people listening who haven't played with cofece, 21, I'm thinking, what the f that's a really stupid idea. Why not? Tell Tell us why it's a really good idea that Adobe
Dave Ferguson 52:25
portability, and size. If you're going to do something where you don't need databases, why don't we need the giant database module built in? Or if I don't need debugging or logging or other features, and I don't need that my engine volume now comes from goes from 100 called hardware. So couple 100. Meg's, I think is was 2018. down to maybe 2030. Meg's Yeah. So you don't waste you dump all the waste of stuff.
Michaela Light 52:53
And why does that matter? I mean, I know it sounds like a good thing. But let's say
Dave Ferguson 52:57
you're using, for example, like Cloud instances where their storage is drastically limited. I don't want to have a 200 meg engine sitting on there when I only using 10% of it,
Michaela Light 53:07
right. And it means faster load initiation times, if you've got a cloud and it's spinning up a new instance,
Dave Ferguson 53:14
if I only have 5% of the engine, then it's going to load up considerably faster.
Michaela Light 53:19
Yeah, and you don't have to manually figure this out. There's like a tool in ColdFusion, 2021, that'll look at your code, and more or less, figure out what it what it needs. Or if you're lazy, you can just say load everything. If you're on, if you're on a traditional hardware server, you can install the whole one gig of ColdFusion. Yes, so
Dave Ferguson 53:38
and you can actually go to the ColdFusion Administrator, and there's a little package manager screen where you can turn on install stuff. And also, if you try to go to parts of the administrator where the package hasn't been installed yet, it'll tell you and they actually give you the command to go run on the server to actually install the package. And in most occurrences, you don't even need to restart the engine to install that package, you just put it in there and just start working.
Michaela Light 53:59
Sounds kind of analogous to I forget what the thing is called in Linux, but you can dynamically load new libraries in there. So kind of analogous to that. Yeah. So for node, you're saying for MongoDB, you can load the package. Yeah,
Dave Ferguson 54:14
there's a package process. And then once you do that, you now gain access to the the datasource creator, and administration screens for no SQL databases with Mongo. And it makes all the code examples that I showed you just start working, if you have a MongoDB obviously, behind the scenes attached to it, all that just starts becoming available starts working.
Michaela Light 54:38
Cool. So this is if you had a relational database this way equivalent to loading the database driver so you can have data sources for article that aren't built in correct. So same for MongoDB you've got to load load the package to process MongoDB or for using CouchDB. You load the CouchDB one or and so forth. So we is that right? They can find, you know, a 32nd operation, just go in the admin do it. Now you're writing MongoDB code. Is that what I just heard? Pretty much. Yeah. That's amazing. Yeah, it's pretty cool. So everyone who's in a in a cold fusion, Rajan was like, Well, I've got half an hour I could spare to play around with this. They actually could load this open. They could look GET command box, they could look close, they surely should have command box. But if not, they get the command box, they spin up ColdFusion 2021. If they don't already have coffee, 2021 Take off that package for MongoDB. And they can start creating documents, collections documents
Dave Ferguson 55:39
are granted, they would need an actual MongoDB running somewhere they're connected to but that's outside of this. But yeah, tell us how do we do that? Well, there's a couple of ways you can either run locally, or you can use what's called MongoDB. Atlas. Au, which is a there's a free version, ran by MongoDB in the cloud, that you can connect to and run your without literally a few minutes of setup and turning some stuff on. You can have your own MongoDB running.
Michaela Light 56:08
Wow. So that's like a cloud version. It's
Dave Ferguson 56:12
a cloud version eight. Oh, no. Yep. Wow. And
Michaela Light 56:18
I'm guessing other cloud vendors probably have similar things I
Dave Ferguson 56:21
would open around, I would assume but yeah, I just know that I have. I've used MongoDB. Atlas. It's just free. Makes
Michaela Light 56:27
it Yeah, I just did a quick DuckDuckGo search and I discovered Digital Ocean have a MongoDB thing, you can just click a button. And there it is. Yep. Ready to rock and
Dave Ferguson 56:38
roll. And really quickly with the with the package manager, if you're using command box and the newer versions they've made running the Adobe command box, the Adobe package manager super easy. So there's I don't I don't remember the stuff offhand. But there's documentation from him on how to run the package manager super easy. They made it like a single command.
Michaela Light 56:59
Wow, straight from my landline and command box.
Dave Ferguson 57:01
Yep. Yeah, they simplified it down. So you don't have to do a whole bunch of extra stuff you can do all right there.
Michaela Light 57:07
Wow, that's amazing. So any places, I mean, we just told people how you could do this in half a half an hour at home, or wherever you happen to be? Are there any other resources in how people should get started with this?
Dave Ferguson 57:25
If you're using something I think of using Atlas, maybe some others, there's some pre built Mongo DB documents that you can get to play around with. That's where I got some of this data like, there's an Airbnb system you can get that gives you all that data to play around with. So you can grab some of those if you want to play around with how is it to get stuff in and out and do other things, you can grab one of these free database systems that are out there, quote, unquote, database systems that are out there for Mongo to play around with and learn how to use it without trying to create your own data. Cool.
Michaela Light 58:04
Are there any books or websites you're referred to to learn this? No SQL stuff or?
Dave Ferguson 58:09
Not? I've handled none of hand. Okay.
Michaela Light 58:13
I think I'm sure they're out there. So anything else we should have mentioned about no SQL before we leap into learn CF in a week?
Dave Ferguson 58:22
I could go on for a long time. About no SQL my own. My thing is don't don't incorrect. Give it give it a shot. If you're looking at doing something different that you don't need a relational database for there's a concept and we didn't talk about it. But there's a concept called the CAP theorem.
Michaela Light 58:48
But let's talk about it, Dave. Yeah. So there's a
Dave Ferguson 58:51
concept called the CAP theorem, which will help you determine whether or not you need, what type of database you need. So the capsuleer CAP theorem stands for consistency. It's CAAP, consistency, availability and partition tolerance, the three main dry main factors of a database. So depending on what you need, you could say okay, my database doesn't need to be in relational database, it could actually reside in no SQL. Because the main things you're looking for no SQL are our tolerance and availability. Consistency is your is your least important factor. Like for banking, yes, consistently. 100% you want consistency and availability, but your tolerance can be a little less. We're no SQL. You have a little bit higher tolerance. And you want high availability, which no sequel is, is very good for. There are systems like I think I try remember which one I think it's couch CouchDB it was built and actually works better. I think it's couching. It works better when it's actually using multiple systems versus a single engine? I'm trying to think it's couch. I'm trying to. I know. I know I'm trying
Michaela Light 1:00:10
to leave it. Do you have that diagram handy for cap? I think that helps explain it for those people who can see it. And I'll put the diagram in the show notes. But you want me to share it real quick? Yeah, let's just share it because I think you were one of the diagrams worth 1000 words, yes. really explain the concept to me.
Dave Ferguson 1:00:28
So, yeah, here's the CAP theorem.
Michaela Light 1:00:33
So we got a little Venn diagram here, basically, three circles for your mathematicians, or logicians. And the three circles are consistency, like every node in this cluster gets you the same data availability, you get a quick response, and partition tolerance, that even if one of the nodes dies, you know, you can still get data. And the diagrams showing that if you want consistency and availability, you pay the money for an RD in a relational database, like Oracle or SQL Server or MySQL. But if you don't need the consistency to be 100%, rock solid, right? Because you're not a bank, or an insurance company or whatever. Then if you if you want availability, and partition tolerance, use no SQL. And just to point out, the relational databases do not give you partition tolerance. If one of those nodes goes down, you're effed. So in
Dave Ferguson 1:01:35
unless your cluster, but you can still have issues even on a cluster environment. So yeah,
Michaela Light 1:01:40
yeah. Whereas with no sequel, you might have, you know, half a dozen or more, or hundreds, if you're amazon.com.
Dave Ferguson 1:01:51
You lose, you lose some or particle, some lot of the nodes is still stay functional.
Michaela Light 1:01:56
Right? It's amazing. Yep. I am assuming that when, you know, when Google does a search, they must have a database underneath. And they have hundreds of 1000s, if not millions of servers gobbling up, you know, website data, and then putting it into a format that can be queried really, pronto. And I don't know if these are no SQL database, but they use something analogous I feel where if the nodes aren't working the query still work. Yeah. And that's a really good example of where you don't need consistency, right? Because no one expects a web. You know, when you do a Google search, or a Bing search, or whatever. You don't expect you know, someone may there are hundreds of millions of websites in the world, and they're being edited constantly. So you can't expect you to be consistent, right? You just expect that get a reasonably good search result.
Dave Ferguson 1:02:51
Yep. That's what it is the there's a MySQL system, no SQL database called Cassandra.
Michaela Light 1:02:57
Not couch. Cassandra. Cassandra. That's a very ominous words, Sandra's,
Dave Ferguson 1:03:01
and that is the one that actually it's, it's Apache Cassandra. The one that actually works better when cluster was it was designed from the ground up to be clustered. So when it's clustered, it actually works better because that was its initial design.
Michaela Light 1:03:20
Right. So it's much more fault tolerant, it, it kind of makes me think of how it is not a tie entirely analogous to this. And I'm not saying you should do, how to implement email through no SQL. But you know, how email was originally designed to survive a nuclear war that if some of the nodes called zap, the email would still make it through because it will get rerouted. And this is somewhat analogous, that, you know, even if some of the nodes are there, you know, you're still gonna get a good query that result set.
Dave Ferguson 1:03:50
So here's how I generally explain it is, if you are running a blog, and somebody comments on your blog, would you go out of business if that comment didn't get saved? No, if the answer is no, then you don't need a relational, highly consistent high availability database with with all that, if you can accept the fact that somebody may come in on my data on my blog, and that comment will go into the ether and ever be saved, then you probably don't need that giant database. Right? Because you shouldn't treat a blog like you treat a shopping cart. Right? There are not the same thing.
Michaela Light 1:04:35
No. So if you want high availability, high availability and tolerance to nodes going down and able to scale, this is a great use case. Or if you just want to play around with it, and you really don't need all that relational database stuff. And the third use case I'd stick out there as if you're in love with ColdFusion structs and arrays, you know, arrays of structs then you know this The marriage made in heaven.
Dave Ferguson 1:05:01
Imagine creating a giant struct of data and just taking that struct as is and writing it to a database without doing anything with it.
Michaela Light 1:05:08
Right? Now that strat is, you know, permanent, or whatever the correct technical term is,
Dave Ferguson 1:05:13
yet, the way you created it does make it does make it quote unquote easier in some aspect is that you can pull it out, and it's JSON data when you pull it out. So it's just like it never left. I've actually built systems that do that, and share data among systems that way. So one system may create the struck but it writes it somewhere. So this is gonna pick it up. And it was the exact same way it was written, no, no difference, no variant. I don't have to regenerate.
Michaela Light 1:05:39
So this is this is a no SQL deep database is a way to do that without having to write that code yourself. Yep. Very cool. So all right. Well, let's, let's talk briefly about your one of your amazing projects, Dave, which is learn CF in a week, which you do together with a few other. CF has. I mean, it's a whole group of you, right, but there's three main main contributors.
Dave Ferguson 1:06:08
Yeah. So I'm one of them. Obviously. The other the other, the other main contributors are Carl Van Steen. And Ben Ben or Carl Van, I always can never pronounce his name, and I'm terrible. Yeah. And then Dan Frederick's. So the three of us Fredericks? Yeah, the three of us kind of way, you know, we could do this better. Yeah, and we kind of took it over when the prior project was kind of a left behind. Yeah, and we, we kind of just grabbed it and ran with it, we actually got a lot of the original contributors to redo their stuff. Because we redid a lot of the documentation. We redid the majority of the examples in it to be CF script based versus tag based. There are still some tag examples. But we we gave, almost all examples are now in tag and script redid a lot of the documentation on how it works with more current versions. Read it sections, added sections. And beyond all that we put all of it in made all of it open source and putting it up. So people can contribute and make changes as they want. It doesn't autoload we have to manually load the new changes into the site. Obviously, there's a review process we go through. But it's all there for everybody to take a look at. If you want to grab it and go through stuff on your own time, you can actually download the site run locally if you want it to. There's no database, anything on it anymore. It's just straight HTML ColdFusion processing a whole bunch of JSON data. Wow. So
Michaela Light 1:07:51
you can you can not only can you learn CF and week from the content in the website, which actually is a really great way free way to learn ColdFusion or, or even if you know cold fusion, we are a bit old school and you get want to get a bit more up to date. I think most people I've met who goes to that site actually learn some new stuff. And we actually try to trade. In addition, in addition, that code for the site itself is open source, and you can contribute to it and you can doubt you can use it to learn.
Dave Ferguson 1:08:22
And we did our best to make the code that actually is built that build the site itself be modern, so that it can be an example to because it's all written on. It's still it's unfortunately we haven't updated is still running on 2018 ColdFusion 2018. But it was written using cold box. So we use the framework to build it, which it wasn't prior. So you've got some examples there on how to look at a more modern, moderately built system.
Michaela Light 1:08:50
I didn't know you'd read down it in cold books. Yeah. Wow. Very cool. Cold books being a framework that autists solutions put out. So yep, more open source.
Dave Ferguson 1:09:00
So So yeah, we did a lot of work to make it more of an example, as best we could. And it was, I mean, it isn't what it is without all of the contributors helping out with everything in it. We had a lot of help from a lot of people. Not only just the session, the ones that they wrote reviewing stuff from the previous system that we brought over, and make sure they were still still current and right. And we obviously we kept credit to where credit was due. So if we, if the original author didn't redo their content, we kept them as the original author and gave credit to the new person who updated it. So but yeah, it's um, it's kind of a thing that we play around with. And it's a great resource if you're either nuclear fusion or if you're learning if you want to don't know something and want to see hey, how is that done? Here's a large chunk of free much a lot of the experts in the field, telling you how to do something in a better way, possibly. So it's a really great resource. And oddly enough, my wife was one of the she's not on here, but she's one of the people that helped us with it. And she proof read everything. Wow, my wife's a teacher by trade. Yeah. And in English in a reading coordinator can coach, English, English, English coach, so she actually helped proofread the entire thing.
Michaela Light 1:10:28
Wow, what a labor of love.
Dave Ferguson 1:10:30
Yes, she was, she was none she was happy to do. And then she realized how much he had to do when she went, Oh my
God, I don't know what this is. Saying, I have no idea what this means. But this is grammatically wrong. And I'm like, and I had to the funny part of that was one quick story on that is when she was going through a lot of it, I had to tell her no, that's, that's grammatically right for the context. But in a but English wise, it may you may be grammatically wrong. But you're dealing with code. And it's that kind of stuff. So it's actually right. So it was funny.
Michaela Light 1:11:03
It's funny, well, we have a whole episode that goes into the details of this episode 93. And I'll link that in the show. Notes. And you guys talk about what you did on it, and all the cool stuff that's in there. But there's a lot of advanced material in there. I mean, you know, there's even sections on containers and the API Manager, package manager, all kinds of things. So coming up actually know the installer in there would basically tell you go use command box. Oh, yeah, that's cool. Here's the command. Here's the I know, you guys still are you guys and the rest of the team still working on adding new things into it and 2022.
Dave Ferguson 1:11:48
That's our goal. This year, we want to get it updated. So it's running off 20, cm 2021. And updating all the examples as necessary. We haven't kicked around a while for the long unfortunately, the longest time of a learning see if in a week, week two, basically taking the examples and getting a more advanced deeper dive into them. But we just haven't really nailed down what that content would be. And one day, we will know what that content will be and do it. But aren't there yet?
Michaela Light 1:12:18
Well, I would suggest you look at what people want to learn in the state of the cold fusion user survey that we just recently did. And I just read through what technologies people are into with ColdFusion. What things they want to learn and what comments they are I think you'll get some inspiration from that. But I yeah, I don't know what the ColdFusion community can do to support you in having a week to have this will maybe they can contribute to it in some way.
Dave Ferguson 1:12:48
If you're triggered or give us ideas on coping, you think we should go deeper into? Because I've been there already. So and that's where we were struggling with there's so much content there already. It's hard to figure out. Okay, how could we deeper dive into some of those? Because some of those there is no deeper dive?
Michaela Light 1:13:05
Mm hmm. Yeah, maybe that needs to be I don't know, how quite crowdsource that, you know, what, what people use, and Adobe themselves have some, you know, I know that the Adobe engineers, they get some customers, they get permission to get a copy of their code for their mega big legacy app or their modern app. And so they have access to a lot of code. And they use it for regression testing, when they come out with ColdFusion 2023, which they're already working on. You know, they make sure for backwards compatibility, all those legacy apps still run as best as they can. So I'm just wondering, you know, they must, I mean, it clearly the case that the the cold fusion engines, Adobe ColdFusion and Lucy have some kind of coverage. And together with fusion reactor that does coverage testing, they know what commands get run the most probably as the CF output tech,
Dave Ferguson 1:14:03
state, standard five days, the set query, loop and output as the SEC query loop output and one other. I forget to remember offhand the five the five common tags.
Michaela Light 1:14:20
Yeah. So tell me Dave, why, you know, you've been doing cold fusion for over 20 years. You started on version 123 years, I think. Why are you proud to use cold fusion? Now,
Dave Ferguson 1:14:34
you know, to this day, cold fusion has made a lot of the, to be honest, a lot of the hard stuff easy. It's not the old language, only language. I know. I've learned others, since starting with cold fusion is the first language I learned. So I would arguably say this probably wasn't the best way to learn from, but it is what it is. But I've I've been I've learned that over the years, it has made a lot of like I said, a lot of the hard stuff that you would think is really complicated. Like back in the day when we're looking at Oh, my God, like an ASP app back in the day, how would you send email all you have to add these 9000 things into it just send email, or ColdFusion was one tag. So it made and it always has been even to this day, like examples of how we add MongoDB into and be able to query MongoDB databases, it has made the harder stuff very easy, and continues to do so with every single version they put out.
Michaela Light 1:15:34
Excellent. And then, as you know, I'm on a campaign here at CF live podcast to make cold fusion more alive. What would it take to make cold fusion even more alive this year?
Dave Ferguson 1:15:49
That's a That's a tough question. I think I don't know. I think because of its age, it gets, I think, a bad rap. But if you didn't look at it, PHP is actually older. And in Java, yep. So they're older still button and then look at ColdFusion is actually built on Java. So you can't you can't say that it's bad, because it's old that that argument doesn't shouldn't exist. Because just because it's old or old, doesn't make it bad, makes it different. makes it better and more It's done can do more things because it's got some roots. So I don't, I would caution people from from dismissing ColdFusion as an option just because of its age. I'm looking at it for what it can do. And I think the more we can showcase what it can do, the more viable the solution becomes. But and it changes the argument versus Oh, it's old. Nobody wants to use it, blah, blah, blah. It's like, well, here's the things it can do. So you tell me something else that can do this with less people and found in a faster development cycle. And Molly Bulow, and you can't, I don't think I don't think there's really much out there that can compete with ColdFusion. And how fast you can write it and get something viable. Right out of the box. It's just it's, technically it's just built different. For sake of a better term. And,
Michaela Light 1:17:27
yes, lines of code, it's less libraries to pull in, you know, but
Dave Ferguson 1:17:33
I mean, and you can pull this I mean, if you need to, there's nothing stopping you.
Michaela Light 1:17:36
Sure. But you can pull in any Java libraries or other things into it.
Dave Ferguson 1:17:41
So out of out of the box, and I think it does more in less time than anything out there. Which is I think it's its big selling point that people miss. And what it can do is, it's the big missing selling point, because people focus on the wrong thing.
Michaela Light 1:17:55
Yeah, those are, those are great points. Dave. I mean, I will say to everyone listening, try out some new ColdFusion stuff, there's a lot of features in ColdFusion 2021, there's a lot of features in lucee, 5.3, you probably haven't tried all of them. And then just look at all the other things like these NoSQL databases we talked about, you know, maybe you've never tried those or, or even if you're still sticking to MySQL, Ben, Adele was writing recently on his blog, you know, all these he had an accidental upgrade to MySQL eight, I think it was his, his hosting company didn't tell him, they were upgrading it, and he wasn't really prepared. So we have to scramble to fix a few compatibility things. But you suddenly discover there, all these new features built into the database that you didn't even know were there. So I just encourage everyone, get out of your, you know, programming rot. Try at least one new thing a week. You can't do what you couldn't go wrong just to go to learn CF and a week. And just pick one thing you don't know what to do. Each week, you could easily spend a whole year learning new things out of learn CF in a week. Or you could spend a whole week learning.
Dave Ferguson 1:19:09
Exactly. And along with that learning something new I would always and I've seen this on many places. A lot of times your best ideas come from the new guy because they haven't seen what you're doing on a day to day basis before. Yeah. So don't discredit the idea from the new guy just because they're a new guy.
Michaela Light 1:19:34
They have fresh eyes for the project,
Dave Ferguson 1:19:36
much different perspective. You know, so always consider that, that their perspective is just different.
Michaela Light 1:19:44
Yeah, excellent point. If people want to find you online, one of the best ways for them
Dave Ferguson 1:19:51
to do that best place to find me is on Twitter at Def Roby. And, literally, if you find a deal of grumpy somewhere, it's more likely He pretty much captured that everywhere I could. I've had that for a long time. And so is what there's no numbers or anything on it. It's a throwback to where I used to work. So figure it out.
Michaela Light 1:20:14
Very cool. And we also will put the your Twitter handle in the shownotes, and also your LinkedIn profile. It was in there. So really appreciate you coming on the show and telling us about MongoDB and why people should get out of there. Right in their ColdFusion development today, Dave?
Dave Ferguson 1:20:34
No problem. It's fun being here. Thanks for having me. All right.