Hi, I'm Derek. I have no introductionary slides, so I'll just jump straight into the subject, which is a subject of storing non-scalar data. So non-scalar data is more complicated things than just your standard strings, numbers, and booleans. So they tend to be arrays, your nested objects, your arrays of objects. It tends to be a more natural way how you would store application objects in a database in different ways. And traditionally people with relational databases, you get to do that with different types of patterns. If any of you have seen AEV or something like that, it's a way of storing a single object with lots of not necessarily defined properties in a relational database. But in the last years, decades maybe even, more and more different types of databases showed up, known as call databases, as they're called, in which many different flavors exist, with the intention of storing data in a more natural way as it would show up for applications. So that is the non-scalar data that I'm having here. So a few examples here. For example, if any of you've ever written a block application, I certainly have a long time ago, it's often a common thing that you tag a specific post with multiple tags, right? So in this case, the tags that I picked here from OpenStreetMap data. OpenStreetMap data is free data. Each object you see on the map can be tagged with many different tags. But storing this kind of information in a relational database, what you would often do is, well, you have to create an extra table with this to store the tags in that you can then link to your articles. So you actually storing an array of tags separately from where you usually store your data, which is more complicated in a way of doing it. And then separately, there's examples like you have product catalogs. If you have a product catalog, I always take Amazon's example here. I'm pretty sure not many of you operate it with the skill of Amazon here. But of course, those product catalogs, you can store both books as well as, in my example, Whiskey's here at Amazon sells Whiskey's in the UK. Sorry, handy. And of course, all these different products will have different properties. Like a whiskey doesn't have a number of pages, makes no sense, right? And similarly, a book doesn't have an alcohol percentage, for example, or a distillery attached to that necessarily, right? So you have different properties, but it's still part of something that is a product. And traditionally, relational database don't handle storing that data particularly very well. Or unless, yeah, it gets very complicated sometimes. All right, so what is this presentation not about? It's also important. I'm not going to talk about how you store this data in a scalable way. I'm not going to talk about high availability. I'm not going to go into an in-depth technology covering of all the things I'm mentioning here because I'll be talking for days. And I only have 57 minutes left. And I'm also not going to talk about benchmarks. So benchmark is always a bit of a tricky point because you can't really benchmark the different-nosed goal solutions against each other because they are all there to do something very different. So it makes no sense to compare these things together. So I won't be talking about that. All right, so the things that we're going to have a look at in the next 50 minutes or so is we're going to look at the different database types for storing non-scaled data. Go a little bit into what sort of data you can store in these different types and what they're good for. We're then going to have a look at querying and manipulating data indexes a little bit, and then we have a conclusion at the end, and then some Q&A as well. All right, so different database types. How many database types do you think there are different database types? You've heard of relational databases, right? Key value stores? There's a document data stores, there's XML data stores, there's so many of them, I don't know, right? There's an article on Wikipedia, I believe, that there's 57 different types. Now, to be honest, I think they went a little bit too far with that, and I tend to want to group them together in about four different categories, of which I will be talking about three of them and not talking about relational databases in this presentation. So the simple one is key value stores. Key value stores, what are really good at, they're usually really small, really fast, and all the operations that you can do with these are on the key only, but minor variations, but usually on key only. But what they do allow for often is that the values that you store with these keys, they don't have to be simple numbers or strings or booleans or something like that. They allow you to store more rich data as a single value for a specific key. An example that we'll be looking at here is, for example, Redis. Memcache is another variant of this group of databases. Then, so diving a little bit deeper into Redis, so in Redis, the keys are binary safe strings. The values in Redis are also binary safe strings, but it's strings between quotes because it does do clever things with numbers. Numbers are also stored as strings, but you can also do calculations with them. So they're strings, strings. But beyond these, it also allows you to store lists and sets and hashes, sorted sets and a whole bunch of other things that are sometimes a lot more natural to how an application deals with the data. So the interaction with this happens through Redis CLI or PRIDIS PRIDIS, which is a composer-installable library that helps you do these things or you can talk to it with Telnet if you really wanted to. The examples that I've been showing here are with Redis CLI, which is a very simple way of doing it. If you're doing this through PHP application, you'd be using PRIDIS slash PRIDIS. And I've spoken about the normal string. So the way how the Redis protocol works is kind of very, very simple. It's a command line interface that you talk to over network connection, except that there's some binary information in here that you can't see because I'm using this through the Redis CLI tool. So the data that comes back is a little bit more rich than just strings, which are the commands that you give it to. So all the commands in Redis start often with a single letter or multiple letters to indicate what type of data we are operating on. So the S in S add stands for set. And a set of data is a collection of data that belongs to a specific key. So what I'm doing in this first example here is that I'm using the key whiskey colon, glen fitter, colon tag. That is one single key because all operations you do are on a single key. You need to do something clever about being able to store properties of objects. So what the key here basically says is that our data type is a whiskey. Our unique identifier is glen fitter dash 12. And the property that we're storing with us are the tags. So the set name is whiskey colon glen fitter 12 colon tags. And then the values that we're adding to the set is what we're doing as a second argument here. So in this case, we're tagging that this whiskey is fruity that has vanilla in it. And if you add another element to the set that's already in there, it will tell you by using the zero as return, that this element is already there. So a set doesn't allow you to store the same value multiple times. Because that won't be a set anymore. Or you can add things to it. If you want to have spaces in your names, then you need to also double quotes from PHP itself. You interact slightly different whether they have nice names for all the operators. I don't have an example of that. So after adding elements to the sets, you can of course do operations again system trying to figure out whether a tag or a word string is a member of the set. So if I use the s is member operator, and I'm basically I'm trying here is the whiskey tag with the word PT. And as you can see in the first bit here, we haven't added that sort of return value of this is going to be zero. As members return to all the members of the set. So that's all the ones we have set in the first example. So these are rather sets. It's a way of storing this information. And you can then then operations against this data type and those operations are atomic operations. You don't have to pull the data down. Compared in your PHP application or all application, modify them and store it back. All those operations are atomic operations, which is important to know because that is how you interact with almost all of the other soil database. You need to figure out the best optimal operations you can do on your data type in order to not run into race conditions and to make optimal storage, make use of the capabilities of the databases. So rather sets are very good way of quickly doing this. Whereas usually runs into memory in memory, although you can back it up to disk as well. And there's ways of doing that. But it's a very quick way of doing this kind of operations. It's really, really fast to do so. Similar things. There's also a hash data type. They work like associative arrays in PHP. So H, the first letter here stands now for hash. And when you do a hash set, again, we use the key. In this case, it's the props key of the Ben-Nevis whiskey. And we say that the distillery associated with this is called Ben-Nevis. And then with HM set, M is a letter that often comes after the first letter. So it stands for multi. Means we can set multiple values in one go. So in this case, we're setting the properties region Scotland Highlands as well as age 19 at the same time. Again, one operation doing multiple things. And then retrieving is also possible by using HGADL. If you ask for the properties, and then what you get on the Redis command line script is you get key value, key value, all the different values in your result, which is kind of ugly. P Redis handles that a lot better than you get in associative array back. So that's better. Beyond that, you can also retrieve single elements of this hash by using HGADL. And you can see that even though we set the value as 19 as a number, it still comes back as a string 19. So the strings are a bit tricky here. All right. So that was a quick overview of Redis. It's a very simple way of dealing with very specific data types. But because it is all in memory, it is a really fast way of handling that information. So Redis is often used for either kind of caching information or doing on-the-fly calculations of quick things that are always available. And it doesn't particularly matter very much. Sorry. The intention is that you can always build back this data for more information. Sorry, give me one second. This always happens about five minutes in. Sorry. So a little bit further than, who's got some music going on here? So a little bit more feature-rich than what Redis or key value stores are, are the document data stores. And the document data stores are often feature parity with relational databases. Not always. Not in all specific cases. But it tends to be built for having a, to be able to run on distributed networks. Sorry, I really have to do this, because otherwise it's going to annoy me. Please sort this out. So some humor in there. All right. So the document data stores allow for, to store more rich information that you can interact with in many other things than just the key. So it is now possible to do operations on keys and values. You can do searchers on values and not just on the keys like you can do with key value stores. Often if you see examples of document stores, they all will show you the data in a JSON format, because the JSON format is a slightly richer data type. However, most document, most document stores will not actually store the information as JSON on this, because it's a text format that you need to parse all the time, which is really inefficient, right? So examples of document stores are, for example, MongoDB, or CouchDB, or Lasik Search, and they all fit you much work in the same sort of way. Or at least the way how you can, how your data modeling for these databases works.  They're storing data. Lasik Search has a different aspect to it, where it is really good as a full text search index. You can also use it as a database sort of, but it isn't meant for it. I mean, unless you search, your search indexes aren't always necessarily up to date immediately, which is something you expect from a database, right? I mean, if you write data and you read data, it should be there immediately. From the same server, if you talk to it. The difference between MongoDB and CouchDB are mostly around how you write data to it. MongoDB being single master, CouchDB being multi-master. But by having these differences, you get other points of contention in other different ways on how you store data. Or rather, how you distribute this data among multiple nodes. So, although they're all a little bit similar, they're also a little bit different. Again, I can't go into detail between all of it, because I'll be talking for days. So I have to focus on one database that I'm talking about MongoDB, mostly because I know it's the best thing. All right, so the first line is a bit controversial at the moment, so I won't talk to that about too much. But MongoDB is like any other things I've been talking about. It's something you can use for free. It doesn't cost you any money. So the documents are stored as Beeson on this. So Beeson is a binary way of storing JSON information, except that it has a few additional data types. So it's like a date timestamp, for example, or there's binary data. And those data types are something that normally JSON doesn't have. So there's a few extra data types thrown in with that. So the interaction from within, say PHP or any other language you can think of, what you do is you build data structures inside the application, just like there were normal variables. And then you can transfer those through a client through PHP extension, like you have the MySQL extension, there's a MongoDB extension, or an Elastic Search extension, or things like that. It's the way they will take this information, put it in a different format over the network, and then the database stores it in its own format. So the documents that you interact with from your application will be as natural PHP objects. You can just say, sort this PHP object for me, and it'll get sorted for you. I mean, there's always going to be some gotchas in here, of course. But what it does mean is that, of course, in a PHP, if you have an object, a single property can be an array, right? And in an array, traditionally in a relational database, you can't really store an array of values for a specific field. Well, you can do that if you serialize it, PHP serialize it. I'm sure some of you have done in the past. I know I have. So, yeah, those documents are richer because they can store these arrays. They can also store arrays of objects, or nested objects, and so on and so on. MongoDB interact with through a PHP extension called MongoDB, and to make things easier to use, you also use an optional compose installable library called MongoDB slash MongoDB. All right, so some examples here. As I said, most of the examples that you see in online documentation will be with JSON documents. The things that I'm talking about here, how those documents look like, will also apply for CouchDB and Elasticsearch. Virtually no differences in whatsoever. So what are the things in here? What are the important things in there? Well, first of all, you have a unique ID. A unique ID is basically your primary key. If you don't set one yourself, it will automatically generate a complicated number. We usually advise to use, like, if you have a unique key already, use it yourself. Don't come up with something new that you don't have to invent. So, this underscore ID field is your primary key. But then there are values that have extra things in there. So the word field has four words in it and they are stored as an array. They're not going to be serialized or anything like that. They really just sort as an array. And similarly, the field badges is an array and each element in the array is an object with key value pairs again. This is also that you can just store and you don't have to worry about this and you can even query this directly through the query languages. So as an example here, just to look at how simple this insert data is, first thing we do is we require the library, the compose installed library, because it provides a nice interface to it. We define a variable called whiskies, which we define as we make a connection with MongoDB client, use the DRAM IO database and the whisky collection. Collection in MongoDB is your table. It's equivalent to a table. So the whiskies variable here is now the table or collection object that we can do operations on. Like insert, obey, delete, your quad operation, we can think of some documents. The basic element that you store are often either represented in associative arrays like I've done here, or there are PHP objects and the driver allows you to map different data types depending on which field to all the data types when you're hydrating or dehydrating. Again, can't really go in there because I'm not going to have the time for that. But there's a lot more things possible than just looking these at normal PHP objects or associative arrays. So but what I'm doing here is that with insert one I'm inserting a single document and with insert many, you insert multiple documents. It isn't that complicated to make use of this. All right, so once many no-skill databases started adding support for these richer data types that I've shown you but either whereas or the document stores with MongoDB. Many relational databases also started adding data types to its functionality to store that kind of extra data because they must have seen, well, lots of people find this useful. That's how this functionality to relational databases is on. Because I mean, how many of you have had formal relational database theory in uni at some point? Must be some, yeah. Right. And that is really nice and it's allowed you to make the most optimal database scheme to store in your database. But it isn't always the most optimal way of interacting with your data from your application. Right. I mean, I'm pretty sure many of you will have taken shortcuts to make data easy to query or easy to store from application or to avoid having 20-way joints. All right. I mean, they happen. So these additional data types that I've added are good for storing this unstructured data that we have seen with both, say, Redis as well as MongoDB. And examples of databases that have done so are One MySQL and PostgreSQL. If you go even back, traditionally, IBM DB2 would allow you to store similar things in its XML database. Right. I mean, XML database is a whole different can of worms again, but I mean XMLs, of course, is a richer data format than just your standard numbers and strings. So the examples of this group are MySQL and PostgreSQL. I'll be talking mostly about PostgreSQL here because, in my opinion, it has a slightly better implementation or it allows a little bit more functionality, which makes it a better target for comparing it. All right. So just like Redis, PostgreSQL has actually different types of data types to store different types of data. Primarily, there's HStore, which is your associative array kind of variant. There's JSON and JSON-B. So you can see that I haven't highlighted JSON because nobody should ever use this anymore, but it was the first one that added to it. The JSON-B variant, the B selling for binary, is an optimized version of storing this information. Very similar to the B send for MongoDB, for example. And PostgreSQL has a much richer querying index support than MySQL for this data type. I also like that PostgreSQL has also an elephant as a logo, so I prefer to use that. So how does an HStore look like? Well, basically what you do is you store a JSON document into a single data type. So in order to make use of this, you need to activate the HStore extension, which I have to omit. Some of these slides are written maybe half a year ago. This technology in PostgreSQL moves very fast, so I might be slightly outdated here. When I looked at this, you still had to activate the HStore extension. It is quite possible that you don't have to do this anymore now. So with this extension available, we then create a table. We create a table of users with a single field called HStore and the type of this data type is HStore. This is not something that most people do because at least you'd have a unique primary key and things like that, right? But I tried to make this as the example as simple as possible, so I left all these things out. And in the last block here is I'm inserting into users a disassociative array. But how am I inserting this? As you can see, I'm storing this as a string. Now I know there's a little bit hard to see somewhere, but there are single, single quotes here. The single quotes here to show that you store it as a string because interactions with a relational database are always going to be through strings. But probably the exception of sending values through prepared queries where they will have the possibility of not using strings. But most of the interactions, especially from PHP, if you don't do anything with it, any query that will come back from, say, MySQL, the data types will still be strings, right? I mean, PDO does that a little bit better, so there's other things to it, but traditionally you would only get a string back because that was a standard way of interacting through SQL. Now, interestingly, there are a few limitations to what you can do with hStore. So hStore, although you can see that we're storing it as a string and a number, it basically stores it as a string anyway. So you can't really do operations on these values. You can't, for example, increment the number by one for account if you view or log in an extra time. You can't just simply bump that number. But it will have things like strings and booleans and numbers in that. So what PostgreSQL wants to do with hStore is that this is some extra information that we can tag to things that we're already storing in the database. So as an example, I was talking a little bit about Open StreamMap and storing tags with it, right? Because in Open StreamMap the data model is like, well, everything has a type, which is either a note or a way or a relation. It has an ID, a number from one to four and a half billion or whatever the number is at the moment, and then it has tags that you can just cook up yourself. There is a standard set of tags that people agree with to using, because if you have a road, well, you need to know what type of road it is and what its name is, and people need to agree on what the names for these tags are, otherwise you can't make a nice map out of it, right? But as other people then added information for, say, cycling infrastructure on these roads, so they came up with a scheme to add additional tags to put an addition to this object, to this road, for this information, and nothing stops any other user from adding additional information to it with the own tag schemes that I come up with. Now, if you want to draw maps out of this, the way how this usually works is you do a query, and then with this information, you search for roads or you search for cycling infrastructure, you can then draw something. But because the amount of tags that a specific object can have is unbound and upfront undefined, how are you going to index all that information, right? I mean, you can't really create a column for every single tag that you come up with because you end up having hundreds of thousands of columns. Databases don't handle that. There's no database and other can handle that. But what you can do is, for the tags that are not necessarily agreed upon, you can still chuck them in an h-store because you can still query against this to do your map drawing without having to create a column for every single tag that you come up with. So an h-store is really good for handling this kind of data storage where you have a common set of information that everybody agrees on and then a whole bunch of other things that you don't. So the querying against an h-store is not going to be as fast as doing an index query against a normal field value combination, but it's still possible to do. And you can also, if you retrieve this, fill back in any application, then you can do other things with this, like render the information in this h-store without too much complications. So h-store is used in OpenStreetMap projects to do this kind of stuff. The other data type that people use with PostgreSQL is the JSON-B data type. And the JSON-B data type is very similar, how you can interact with that as well document data stores like MongoDB and Couch to be an elastic search gym. And it can be, you can create indexes on it, unlike MySQL's JSON type or PostgreSQL's JSON type. The indexes you can set on it are very different from what you would normally do on relational database data. Like you don't really set things up like unique indexes or an index on a specific field or compound field. You set them on a specific data type and there's different indexes. I'll get back to that in a moment. So JSON-B data type supports richer data types than the values compared to h-store because an h-store is just really key value. And the values can't be things like arrays or nested objects whereas with the JSON-B data type you can store that information. So again let's have a look at how that looks like. So instead of h-store we're using the JSON-B data type and in there we now insert a string which is a JSON document and it's formatted according exactly to JSON. Basically what I've done, I created this example by copying, pasting the information I had in my Mongo example and I just put insert into user's values quotation mark in front of it. That's the only thing I've changed here. And then with this data after stored PostgreSQL will parse this when you send it to the database stored in a binary format so that you can create indexes on it and do queries against all these different data types. All right so now we have stored data. It's probably useful to have a look at how we can query for this data because database is pretty useless if you can't get the data out. All right so with Redis we already looked a little bit at this how we can do this right. But you remember the example about the sets that you can use as is member to see whether a specific value is a member of a set or you can get all of them back by as members. Similarly for the hashes there's an h get all to get all the key value combinations and hm gets to get only specific hash keys out of that. But there's a few other data types that allow for more specific query types so L range and Z range allow you to retrieve a list of elements from a left position the starting position in your array to your right position the end position in the array. And as different variants there's a sorted version where all the values are sorted already for you so you don't have to do it yourself or insert order so that's the difference between the L and the Z here. So you can do optimize queries against these very specific data types. Looking at MongoDB, MongoDB has a much richer data query language. It is it it isn't SQL but it has nearly or it has functionalities on par with query functionality from what you used to in SQL. But it looks very different. But once you look at it it is actually that complicated. So this example is an example from the MongoDB shell so I'm not doing this through PHP. But if you want to transfer this to how PHP does this what you change is you add a dollar sign in front of DB and you change the dots to an error. And then of course you don't type JSON you use a PHP variable data structure. So it's not I mean the APIs are exactly the same it's just a different language. So what we're doing here in this query what we're finding is we're finding all the documents where region underscore slug equals Scotland isla and the rating is larger than three or greater than or equal to three. These operations with a dollar sign are query operators.  Like in a SQL query there are all strings right. I understand there's prepared queries where you can replace your question marks with values that are not being put in as a string before it gets sent to the database. They're different part of the protocol. But in general you always have to build strings to interact with it by writing a SQL query. So a slight benefit here is by doing it in the declarative way is that it tends to be a bit harder to get like SQL or no SQL injections because the values are just values in sample strings. So you don't have to think about escaping yourself and things like that. Having said that you can still get no SQL injections by doing queries that you shouldn't do so. All the requirements are for dealing with input data correctly still hold true for no SQL databases too. All right so the query here is refining all the documents where region is Sculpted Isla and the rating is larger than 3 or larger than greater than 3 and we only want the fields back that are called whiskey rating and H and pretty makes it looks nicely instead of picking out of one string. So we have this equality match. We have this match with a query operator and then we have the projection and the projection is you list basically all the fields that in SQL you'd select star but instead of the star you now have star again. Oh whiskey rating and H. Okay that's a good question because the projection because it is Java syntax you can't just have a single word and it's a hash right so you need to have a key and a value. Now the key here is the name of the field the value is either one or zero. If it's one that means included if it's zero it means excluded. So you can you can either include fields that you want or you can exclude some fields that you don't want. That's for the both different things. So if there's some water that'd be great. He's solved. Thank you very much. All right so if I rewrite this query in SQL you get a query like this right you get select whiskey rating H from check-ins where regions like equals stock Scotland Euler and then rating is larger equals to three. All right so an additional way of doing queries in MongoDB is the aggregation framework. And the aggregation framework is a set of operations that you define that are run in order on a collection or a table. So what aggregate does it we've defined two operations here this match and group. So the match stage sorry in the match stage what we're now matching is not a specific value but we're using a value prefix. So it allows you to use regular expressions which you anchor a bit of carrot to the start of the string. You need to do that otherwise it doesn't make use of an index in a similar way as if in SQL you use find oh sorry select blah blah from table where field like something. If you don't have if you have the percent at the start of that string it can also not make use of index because the ways how strings are indexed they usually you can only do that when they're anchored to the start of the string. In any case what I'm trying to find is all the whiskies where the region is in Scotland. All the countries also make whisky. So that's what we're doing this match and then the second step the group stage we then group all the all the things that we found after the first step we group them by region and then create a list of all the whiskies that we find by this region and put that in the whisky field. This looks kind of complicated if you want to know more about how the aggregation framework works come talk to me later I'm going to run out of time if I go in there too deep. So for each of the matched documents we're creating this bucket indexed by the region name and then we're adding the data to it. So the result of this query would be something like this. I've prettified this a little bit because the ID the region slug has gone but the ID value is now the name of the of the region itself. But you can see that the result of this is in an array of all the different whiskies. So you can do quite a bit richer queries with this that's you well you can't do an SQL right you can SQL you usually traditionally you can't return a value that is an array of values. Of course unless you use the json b data type in PostgreSQL. All right so queries with the json b data type in PostgreSQL or hstore in this case are by using specific extra SQL operators. I don't necessarily remember the names of these operators because they have funny names and yeah I just don't remember the names of them. So in this example we have a document with four fields we have ID location count unique in this admin to get the value for a key you see that we use this error operator and the error operator basically says give me the field is admin for the field age doc and age doc was the name that from the previous examples. So that will basically give me for every document in users the is admin flag and the only thing is output is pretty useless but this is an example here. So what you can also do is you can use normal SQL operators on these filters as well. So in the second example here is that we're going to show all the underscore d values for all the users where the field count unique is larger than 10. So basically what it says users that have logged in more than 10 times and then for those we want the underscore d values which is the unique identifier for a user. Now because of course upfront you never know which fields and values you have it is also possible to find out whether those fields actually exist in the data. So in this case the third example here where we do select age doc question mark age basically says if this field exists return return boolean through I think it actually does. So you can text so you can test for keys existing which is well you sometimes need to know that right. And then in the last example which is probably the most unstun that SQL that I've seen in a while you can use age doc the name of the field and then we can check by this M present greater than sign where the key value per location London UK notice the double quotes around the key and the value and the single quotes around the whole thing which we need to cast as an age store which is the colon colon age during the end basically what this does is it selects all the documents and users where there's a field in the age doc sorry where there is a key value combination in the age doc field that matches location London UK that is what it says this gets more complicated I think it doesn't look as nice in my opinion as how no school databases do this because their query language is made to do this kind of thing whereas SQL sort of has this bolted on and I'm also not entirely sure of the standardization process of these additional operators I know people are trying to standardize what all these things mean but if it's new technology and databases implement them in a slightly different way is kind of pairing from what I know both my school and post-grad school do implement the same data types so that's for age store if you look at Jason B it is similar you have both the arrow as well as the double arrow and the double arrow is a little bit better because instead of returning a string with the value unit it will actually pull the data out of the string and return it as a normal data type so most of them people use the dash arrow arrow instead of the dash arrow operator um and by doing this kind of queries it becomes important what kind of indexes you use now normally what you have on a index fields if you do normal create index you create a b3 index you get a b3 index on a on field and values in order to this kind of queries to make it go fast without having to scan the whole table you have to create an index on age dog email so post fiscal knows if there's a json b data type you can actually set an index on sub fields in there without you having to do anything about that so in this case you just like you normally would have an index on email you now have an index on the email field inside this json b data type all right so we again find the id for the email address which is my email address second example we're finding we're now using the is not null as called operator operator is that how you call this let's call him operator which is the same thing as you how you otherwise would do it if to check whether this value is null or not which you can also use to see whether the field actually exists because a non-existing field has a value of null in this case now then in the third example we're going to be more complicated and we're using this greater than operator to find out whether there's a word the word London whether that is part of the array associated with the words field okay this is a bit complicated so as you see the words field here has four values the query that we do here is a subset of this because it only matches words London which is a subset of the document and hence we'll then return it as a result if I would have used words Paris for example because it doesn't match it wouldn't return it additionally if I would have done words London comma UK it would also find it because it's still subsets of this document in order to to this kind of queries Postgres core recommends that you use a gin index and a gin stands for the G sorry because my genitive index something like that genitors inverted index basically is a index type that allows you to map multiple values to a single single document sorry single record which is a way of basically indexing all the key and values in this JSONB data type in one bucket so you can do queries against that in one go without having to do it on specific fields like we do for in the first example here where we look specifically at data against the email field in the age doc field I know I'm using the same word a lot over and over again that's confusing after all and so just in the last example what I want to show is that how would you update or add a field I already mentioned when we looked at Redis before that it is important to use atomic operators to do operations on the data what you don't want to do is retrieve the record in your application then add an extra field to the age doc type which in order to do that you basically have to rewrite a string not ideal way of doing that so what PostgreSQL allows you to do is actually update or add fields by using the colon not the pipe pipe operator which basically adds a field value combination country Europe that's not a country sorry or if you want to remove a filter you can use minus instead of pipe pipe okay I'm going to have to change that country to either continent or change the name of the country for Europe or something else all right all right so that's the interaction with with the different data types so a bit a bit more about indexes so indexes and Redis they're only going to be on your primary key if you want to do more if you want to have a compound index as I've shown you before you use it is a a preference to use the colon there's no there's no hard requirement for using the colon but this is what people tend to do but some of the data structures provide additional indexes right if you have a set for example even though your primary key is still the first one there's still sort of index on the value because it knows not to add multiple multiple the same values to the set so there's some indexing going in there and similarly if you have like a sorted list or something it's also just that kind of additional indexing to make the queries be faster without you having specifically having to create an index it is part of the data type that you are using for storing the data which is kind of handy so among the indexes they are on normal fields as you'd expect you can set unique keys you can set indexes sorry I have this one you can set indexes on a nested field like if you remember from the PostgreSQL for example where we had HDOC arrow email you set an index on the email field with inside HDOC which is what MongoDB uses with the dot instead of the arrow and you can set an index on words on the field words the field words will now have multiple values associated with that field unlike PostgreSQL which allows you to do this on the whole data type only in MongoDB you can do some specific fields inside the documents that you're storing so it's a little bit more precise on what you store your indexes on making it of course if you're being more precise with your index you end up storing indexes of a smaller size because you have to store fewer information or less information in there so PostgreSQL has this gin index oh the contrast really doesn't work here apologies then again picking red and blue on purple should have seen that coming but this gin index is a really quick way of creating this index on all the data instead of the h-store and it is you're going to have to do something in order to not have a table scan so yeah so there are two types for JSONB fields there is a kv or just a v key value or just a value I think in general people will use the standard which is key value and it allows you to map multiple values to a single document so in this case all the the combination like name glen25 or slug glenalbin or words glen words albin and words 25 that will all show up in this index so that you can quickly relate to a single record that contours that information in this data type so with this as I showed you before you can do these key value matches so we're creating the index here with this using gin on properties so you have to specify which type of index you use for it if you want to create a b2e index you don't have to specify the gin thing so it will then index this whole whole properties fields and similarly this index is also used when you do this array containing a match right so so we create the index so we create the index own properties words so that is a more specific type of index to then be able to match the properties to see whether in this case with the question mark we're trying to find whether the value album actually matches inside the words fields I've shown you only very simple operations you can do on this data I mean I can probably give it all that last several hours on all the different operation that you can do with this data but again not having the time for that so we'll get it going here a few more words about manipulating data so I've already mentioned is a few times the way how you interact with data you need to make sure that you do this in an atomic way you can do this either with transactions or you can make use of all the operations that work on all the specific data type but it's always going to be your preferred way of doing it so that's the atomicity so you shouldn't do retrieve manipulate and store this is true for any database interaction you ever have with any database you can think of so this should not be anything new so Redis has a bit of extra operations here that allows you to work on things that you've already stored so remember that we have the in Redis we have the properties and in this case the property for H is 19 returned as a string but you can do in core H incur they get difficult to pronounce those operations H incur B yes I pronounce it I don't know they need to come up with something slightly better than I think but what it does allow you to is take the field and then use a value that you want to add to the field so even though it is stored as a string you can still do numerical operations to strings that look like numbers and because it's an atomic operation it's also really fast that happens in place and is basically a free thing to do nothing is ever free but it's just a really fast operation and this is used in many applications where you keep counters like visitor counters or anything like that or if anybody still uses four square like how many people have checked into specific venue right all the kind of things Redis is a really good database we're doing this for also if you lose the data it's kind of annoying which you should always be able to build it back from data you've already stored on this and then there's other things like the atomic operational sets I already spoke about this as assets and elements to set or as REM from removing them and so on and then there's transactions as you saw so among them to be a similar thing never do this never do a query update your value and then store it again you get race conditions and among them to be has operations starting with a dollar sign which if you're using PHP is kind of annoying because you really need to make sure you're not using double quotes you need to use single quotes for everything and in this case what this query says in the first example it says increment the subfield 2017 0202 in a field steps underscore made and increase it by 7124 as a atomic operation is kind of handy it also has operations for sets although MongoDB doesn't have a set data type per se there are operations in the query language that allow you to deal with specific arrays as they were sets by using these operations so adds to sets basically says add the word open stream map to tags unless it's already there and then just ignore the operation similarly can you do things like push to push things to the end of an array you remember that in Postgres so you could do that with a pipe operator to add an extra field to it similarly MongoDB allows you to say push tags so what we're doing here is that we're adding to the tags property the values MongoDB and XDBug and then after we've done that we only take the last two elements and everything else that we discard okay in this example that is kind of silly because we've just added two elements and then we only keep the last two elements that we have but what you can use this for is that you add a commons to a blog post and then by using slides minus 10 you make sure that you only store the last 10 commons with a specific blog post and this is all one single operation without you from the application having to create transactions and do this kind of thing so as I said all those no-score databases as well as Postgres so it's a json vdase type have these operations that you really want to use okay schema validation in a relational database well that's schema validation because you have to create a schema upfront right but with all those extra modern data types now you don't describe this schema of the data that you store in there upfront in relational database with these data types you generally cannot enforce this schema on the data that you store in there it is really translated treated as a bucket of data but of course the things that you want to enforce the structure of you wouldn't store in this json vdase type anyway you would store that as normal fields in your in your record with no-score databases it isn't generally possible to enforce a schema although the database have been adding functionality to this I can't remember but a couch should be as anything for it but MongoDB allows you for example to set up a validator and a validator is basically a way of running a query against a document after it's been updated or inserted to see whether it matches specific query the validator and if it matches if the document would be found by running this query it's considered being validated so this is a way of enforcing a schema by not by still not having to create a schema upfront for example so that is a possible thing to do I think the latest version of MongoDB actually extend this language to json schema so if you use that it is a lot richer than what MongoDB originally had before json schema existed for example all right so conclusions the way how you store non-scaler data on different databases is very swalding it's important to pick the right tool for the job right I would usually recommend people use Redis for this very quick in-memory operations because it's really good at that but Redis isn't particularly very good at scaling it beyond a single machine a relational database such as Postgres with a json b data type or MySQL but it's json type which is also getting better and better over time if you're already having an application using relational database and you need to store some extra unstructured data that doesn't happen very often then use a relational database and use the json b or json type as additional to store additional information if your application is already either highly unstructured with some data it's just like that using a NoSQL database like CouchDB or Elasticsearch or MongoDB is the right tool for the job there right because it's already architected in such a way in addition most NoSQL solutions are also built to be run on a distributed platform so if you need to have easier failover capabilities or distributed writes and recent things like that relational databases tend to be less good for that because they have not been architected for that right they're 30 40 years old where the way how you scale your database which you get a bigger machine most of the time and then there are some data types that work better with some database like having the sets it's probably rather would be a much more natural fit for that than you do that in a relational database or even in a document database so those are the different things that you need to look at many different possibilities there as I said Wikipedia list 57 different types of NoSQL databases with others with more exotic features than others so yeah if you have things that you don't think that fits with the things I just spoken about today have a look at what else is out there and there's a lot of different things out there having said that are there any queries or you have two minutes that's one right up front here use the mic please would you recommend any of these for storing events if you're using libraries such as Broadway for or go into the complexity of a dedicated event store so when you say events so you don't mean time series data right is it just events but everything that happens through your application and you want to store in a big log basically you see that right yes so something like event driven architecture where you have your domain events I don't think it particularly matters much but what you need to I don't think I'd use Redis for it because Redis is not good as a system of records neither elastic search in this case both relational database as well as say couch to be among going to be as no school data so would be perfect fit for that right I mean at that point you just need to start figuring out I need to you need to run some benchmarks what is the fastest data store for you or similarly could point about thinking about which one to use which one I'm most familiar with or do I really fancy playing with something else and figuring out how how that works for me right so these are the concerns there but because in the events store itself they don't really have unstructured data very much it doesn't particularly matter in my opinion anything else no questions oh right in front again so I've not implemented or used a no sequel database before but we had we had a technical problem which we are trying to solve using no sequel but I wanted to know for example the way no sequel works is there's no definite schema so one json object might differ from others say just an object for example one json object might have field called name the other one might not so is there it's possible to have an index on the key called name and then tell the no sequel database that if you find this key called name index it and then I want to pull out everything which has that name and then if it doesn't have it ignore it yes so couch do we handle that in a different way of course you need to create different sorry for MongoDB I know you can create an index on the field and you can create sparse index on this field which means that any documents where this field doesn't exist just don't show up in your index or you can make a non sparse index where the fields will show up but the value will be null yeah that should be possible anything else one right here and then I've run over time so this is going to be the last one hey there so I noticed at the beginning of the talk you said there's four database types but you only mentioned three from what I've graph databases is the one I missed ah cool thanks yeah yes I realized that later during the talk I meant forgot to mention graph databases but there's always an eagle eared person in the front row right you're forgiven yes yes graph databases is the other big type big type all right one more slide QR codes who doesn't love QR codes the QR code will go to my my website where you can download the slides of this presentation it also has a list of resources if you want to do a little bit more reading if you have further questions come and find me at a conference email me I'm getting better at answering emails no there's no loss I'm getting better at doing that having said that thank you very much


The study found that the nucleus accumbens, NAC, is influenced by colonergic interneuron, CIN, activity when it comes to motivational processes. This CIN activity was shown to control the release of dopamine, DA, from the NAC core, which is critical for motivation. Additionally, the study found that CIN activity could also affect motivation through the release of DA, which is important for reward-based decision making. Furthermore, the study demonstrated that CIN activity could be used to manipulate motivation in animals, suggesting that it may play a role in human motivation as well. This article was authored by Alima Hippie, Val L. Collins and Joshua D. Burke.


Azerbaijan, illegal regime in Karabakh disbanded, illegal formations surrendered, an agreement has been reached to stop local anti-terror measures by Azerbaijan. The Ministry of Defence of the Republic of Azerbaijan states that considering the appeal by the representatives of the Armenian residents living in the Karabakh region of Azerbaijan, conveyed by the Russian peacekeeping contingent, an agreement has been reached as of 1300 of the 20th of September 2023 to stop the anti-terror measures under the following terms. 1. The formations of Armenia's armed forces stationed in the Karabakh region of the Republic of Azerbaijan and illegal armed groups lay down their arms, withdraw from their battle positions and military outposts and are subjected to complete disarmament. 2. Simultaneously, all the ammunition and heavy military equipment is handed over. 3. Conducting the above-mentioned process in coordination with the Russian peacekeeping contingent is ensured. It should be noted that on September 19th, in order to prevent large-scale provocations expected from the Armenian armed forces as well as ensure the implementation of the provisions of the tripartite statement, disarm and withdraw units of the Armenian armed forces from the territories of Azerbaijan, neutralize their military infrastructure, secure the safety of the civilian population, including civilian workers and military personnel participating in restoration and construction work, carried out in the territory and restore the constitutional order of the Republic of Azerbaijan, the Azerbaijani army launched local anti-terrorist measures in Azerbaijani territories temporarily controlled by Russian peacekeepers.


Hi, I've read some of your speeches, and I honestly believe that a lot of what you have to say is true And and I'm a good person in spite of what my ancestors did it And I just I wanted to ask you what kind of white person like myself who isn't prejudiced What can I do to help you and further your cause? nothing But everything that we've gone through in this country particularly black people we can be proud of Where we've come from and even if you look back there was a time where if you just looked at our trajectory how we were going We had a lot to be proud of Coming out of slavery and through reconstruction and through the Jim Crow segregated South We made a lot of progress and so when you look at that particular clip that I played from the movie Malcolm X When the woman asked him who in her day I guess would be the equivalent of what you would call a Social justice warrior I've been called a social justice gladiator or someone who is woke someone who might be Virtue signaling who wants to maybe feel better for themselves and and I don't maybe she really wanted to help But the question she asked was is there anything I can do to help and Now I'm not a big proponent of the teachings of Malcolm X But what he said to her was absolutely spot-on and what ought to be said going forward Something happens though. He said no after a while. We began to say yes And I don't mean just yes as though we don't want help But I mean we shouldn't say yes to any help to every help Especially if the help is to the detriment of our own Responsibility today, however, we find black America in some sort of world that I just really don't recognize I don't really recognize This this new version of black America compared to the way we used to be the way we were raised with Some morals some sense some sense of community the way we looked out after each other Even if we didn't particularly like each other we understood that we had a community and that we were somewhat in this together There's always been forces tearing it at the black community There's always been racist people and there always will be Tomorrow You can never with these boys if you don't keep you and them separate I found that out blaming you You've got to keep the white and the black set both from the bull conners to the governor Wallace's of the South to all the lynchings of men and women to all the horrible atrocities that happened to blacks the burning of bodies The beatings the having the dog sicked on them and the hoses turned on them We still came through to having the clan rally in March and to burn crosses and to fire bomb homes and churches We still came through. I don't know. I don't know how many of you all have ever seen an actual clan rally or Met a person a clan's member in his actual hood with a burning cross I came along at the end of the civil rights movement and it happened to me when We were being bused to an all-white school and the clan. They just simply weren't having it So we've seen some rough days and Compared to how it used to be not only from my youth, but even from my parents youth and my grandparents you These are much better days or it seemed like it should be much better days for black people But when you open up the newspaper or you turn on it the TV or look at the internet That's not what you see or at least that's not what you hear We were people that all we wanted. We didn't want anything from anybody else Just like any other group just like Asians just like Hispanics just like Irish Jews Italians we weren't people that were looking for someone to give us something We just wanted people just to move out of the way and let us do for ourselves And so when someone marched against us having that we in turn marched back We weren't trying to stop them from being who they were We just wanted to be left alone so we can be who we wanted to be so we can take care of our families so that we could Provide for our families and children all we had at that time was faith and family And we were going to fight to protect all of that And so we marched and we protest and we went to school and we worked and we took care of our families and After time we began having victories victories in the court systems victories in the state houses And so that schools will no longer be segregated so that we could start going to some of these different businesses If we wanted to and then with that came the not the right to vote But the opportunity to vote now we were able to participate fully in the American dream Were we at some disadvantages?  We were people that marched for our freedom when you saw us together You knew something positive was happening, but now we've got this So something has happened in our community you look at the stats and you see how many black men are murdered Not at the hands of police, but at the hands of each other You look at how many blacks are dropping out of school about 59 or 64 percent of young black males are actually graduating You look at how many blacks are committing suicide You look at you look at how many blacks are on their way to jail or already in jail You look at how many young black men are Selling drugs or on drugs then you look at how many black babies are being aborted And well that should come to no surprise because you look at how many black babies are born Are born without daddy being at home and so because of this devolution of our society we look and we see The crime scenes on the streets We see mothers crying because someone has just killed their baby and in most cases has been somebody black Who's killed their black child and then from there You see a lot of young black men hanging out on the streets young black men going to prison The number one cause of death Among young black men in America is homicide and it's gotten to the point to where it's devolved even in our culture There's this subculture this dark subculture in the black community that has caused us to devalue women Caused us to devalue life Even in our entertainment We see it show up in these in the songs that these women sing as they degrade themselves And even in the videos where the woman is no longer something to be respected But mainly a receptacle for a man and it's not so much some racist white person who has written or directed some of these movies But in many cases it's somebody black who has written or directed some of these movies that give us the worst image possible We look like thugs or buffoons. We portray characters That seem to perpetuate every negative stereotype. There is about black people Whatever happened to the days where you would have a group like the Temptations singing a song called my girl now We've got songs singing about this Man forget all joseph in blackface we don't need white folks going around making us look bad putting on blackface and and Performing these little stepping and fetching routines and smiling and dancing and making us look like nothing Becourt gestures and showing off our teeth. We do it just fine by ourselves All you got to do is put Some chains around our neck put some gold on our teeth and we'll play that part just as well as anybody else And so we look at some of the things that plague our black community 72% of our children are born out of wedlock 64% of all violent crime in America is committed by blacks 51% of all murders by blacks Someone once said and I now concur that the most dangerous place for a black person to be is one of two places one Either in a black community where he might get shot or in the womb of a black mother We're almost 50% of pregnancies like in a place like New York in in abortion we have literally lost our souls and I'm going to tell you something that's going to be a little bit troubling The stats that I'm giving you the fatherlessness rate the dropout rate the crime rate the rate of drug use the incarceration rate the issues when it comes to economics all these things as Bad as they are Pell in comparison to an even bigger problem that we have in the black community and for some reason Many of us either don't want to address it or simply want others to be quiet about it When you see things like that when you see these negative images these negative stereotypes these images of us being thugs or highly sexualized or Basically high high price clowns when you see these images What do you think that does for? Somebody young and black when they want to look up and see something. What do they see?  But not only what sort of image does it send to? Blacks, but you need to ask yourself what image does it send to whites in America? Remember the stats were between 13 to 18% of the population depending on who stats you're looking at It's easy for someone who's not black to go through their daily life and not interact very often with somebody black And so when they do and it's just maybe in the course of passing Whether they get their impression of what blacks are like television the internet YouTube The courthouse what What should they think what should they believe about black people when they see us behaving not forced to behave a certain way But voluntarily acting a certain way and when they see us in the malls in someplace or they see the crime scenes on the news How how do you think they're supposed to react? I don't know. I don't know if many of you are familiar with I mean Horowitz But did a man on the street interview interviewing whites and blacks about what they thought about these so-called voter suppression or these voter ID laws the wipes that were interviewed had a very different view of black people and When you see it you kind of get the impression that they don't think too highly of black Because they're less likely to have state IDs minority voters are less likely to have the kinds of IDs that have been Described or required these type of people don't live in areas with easy access to DMVs or other places where they can get identification. You can always get IDs Do over the internet is that also would make it difficult for for black people in particular?  Well, I feel like they don't have the knowledge of how of like how it works A lot of people have smartphones, but you might not have data for most of the communities They don't really know what is out there just because they're not aware or like access to the internet We don't Know how that we can't afford the internet and the data. We don't know how to use it. We don't understand how this technology works Where do they think we live? They have a dim view of us. They look down Maybe some of you who are aligning yourself with the people who you think are trying to help you Maybe you ought to step back and ask first What do you think of me? How do you see me? I'm not I'm not buying into this whole issue of of this critical race theory and this idea that Everybody's racist and so forth.  What do they get the belief that we don't know how to do the things that they can do when we fight about?  I Know maybe grandma in the 1930s may have had a hard time from coming from rural Georgia or Down in the sticks and in Mississippi or Tennessee may have had a hard time getting to the DMV But this is this is the 21st century, right? I don't know very many people who don't have an ID or the ability to get one It makes us look as though we are incompetent as though we have no idea how to function in the society Unless somebody white somebody benevolent comes to help us any whites who are trying to solve the problem But you never see them going under the label of liberals that that white person that you see calling himself a liberal is the most Dangerous thing in the entire Western hemisphere. He's the most deceitful He's like a fox and a fox is almost is always more dangerous in the forest than the wolf You can see the wolf coming.  Miss Millie always going on over the code Miss Millie, right? If you haven't seen the color purple one you ought to miss Millie is the turn of the centuries version of a Social justice warrior of today someone who's walking her day.  She's helping because well one She's gonna get some benefit out of that and you need to be careful when you start when you start seeing people Who want all of a sudden start helping you? Here's what I never understood Why would you say that someone is racist and then go to them and ask them for help now? I disagree that America is systematically racist. I disagree now I do agree that there are people out there that are racist. I do believe there are racist people out there I do believe that I'm just not as concerned about it as most people I guess I'm not I'm not I'm not focused on it to the degree I think that someone who believes that that I am inferior or someone didn't like me or what have you because of my skin that that Affects me everything that I've gotten in life and it's been a result of me either good or bad Going to college. That was me. It doesn't do my with my skin. Of course. I want to go play sports Building a business that was me. I didn't get any sort of government set aside or anything like that That was all me and then of course my downfall That was all me when you act as though that you need the white person to help you When you when you finally make it guess who gets the credit and so Oprah's character miss Sophia She gives miss Millie her answer. She didn't like it though Hell no Miss Millie couldn't believe what she said and That might be what we need to say in many cases when someone wants to help you get up The question's gotta be why Is that person that benevolent? It And I'm not saying that there are no people out there that are benevolent enough and that want to Help another community or someone else. Why can't the black community do exactly what other communities have done? Blacks from Nigeria have a better standard of living than most whites Darker coming from another part of the world with a language barrier and a cultural barrier and they seem to do just fine Blacks from the Caribbean and other parts of the world when they get here after one generation Surpass blacks from America. We've been here centuries in this same system and we struggle But other folks come here why it's because we've been given something and this is the part that I want to get into This is a problem with black America. This is what's happened to black America They don't come here with an excuse and they don't have all these years of someone handing an excuse to us Now we've got white people who are falling over themselves Trying to apologize for what else making them feel better and Hurting us along the way. I take responsibility. I take responsibility. I take Responsibility I take Responsibility for every unchecked moment for every time it was easier to ignore than to call it out for what it was Every not-so-funny joke every blatant injustice no matter how big or small every time I remain silent Every time I explained away police brutality Or turned a blind eye black people are being slaughtered in the streets killed in their own homes These are our brothers and sisters our friends our family So it makes me ask while I'm watching a couple things pop up in my head that is What black people are they seeing dying on the street? I Mean you heard this narrative you heard LeBron James saying that we're tired of being hunted by by police officers When was the last time you saw some black folks being hunted?  Go ahead we came up with seven or eight names Between all of us and We're talking about an average of 40 years And so that's not very many and then we start naming people that we see on TV We're probably gonna come up with the same 10 20 30 people that you see on news on the news on CNN NBC Fox and CBS the same names of someone that's been killed over the last 15 20 years right and the question is not how many people have been killed in the commission of a crime Because if you rob a liquor store if you if you're breaking in somebody's house or you you're selling something that you should you got a gun Yeah, good luck to you. So Not talking about that. I'm not talking about Bobby who's knocking over liquor store. That's not talking about I'm talking about somebody who was genuinely just out for a stroll And was gunned down by the police officers. Does it happen? Sure. How often that's the issue The issue would surprise you when you find out that Nine were murdered this past year by police officers versus 19 whites Well, that doesn't seem to be some some great epidemic, right? If you listen to the news, you think that we're being gunned down every day Well, why is that narrative being pushed? We'll talk about it in just a little bit But then when you say I take responsibility So I shouldn't take responsibility for what happens in my community So if this guy is selling drugs and goes to jail not his fault, it's your fault You take responsibility if this person has four children born out of wedlock and that is not at home for any of them Yeah, you take responsibility for that, too, huh? If this person isn't doing their homework and dropped out of school you take responsibility for that How kind of sitting is that?   And so for you to even say that you won't allow it Meaning that you've got the power to stop it. Whereas we don't Get it in mind for one of these quote social justice words or they've been called or social justice Gladiators or someone who's woke you do think that your voice matters more than the average black person You must to make that statement because if I told you I'm going to help you because you need my help You can't do it on your own wouldn't you be insulted and Maybe because we've been fed this for the last 50 years 60 years Maybe the black community has gotten used to this and gotten numb to this But that that's not how we used to be We've got people who want to feed us something and give us something that they don't want themselves You all remember the interview that Morgan Freeman had on CBS about About black history month you're gonna relegate my history to a month. Oh, come on. What do you do with yours? What which month is white history month? I'm Jewish Okay, which month is Jewish history month? There isn't one. Oh, oh Why not? Yeah, do you want one? No, no, no, I don't either. So if you don't want it, why should I? But what's happening is we've got America wanting to patronize and to talk down to us and to pander to us You got politicians who want to kneel down in silence To pay respect to the black men who died at the hands of police officers You got politicians who want to come to Black organizations or to our communities or to our churches and talk to us But they don't want to talk to us any old way They want to talk to us with some sort of slaying the way they think we like to hear it or the way they think that we Sound ain't nothing wrong with that There's nothing wrong with working retail folding clothes for other people to buy I don't feel no ways tired From where I started from Nobody told me that the road would be easy He brought me this far to leave me Who are these colored folks sitting there listening to her say this and not rebuking her not getting up and walking out I'm not calling to the carpet. What do they do? They just they just sit there and clap That's the problem right there. If you have a problem figuring out whether you're for me or Trump and you ain't black Unchain Wall Street You're gonna put you all back in chains You've got politicians who think that they know how to speak the lingo and that they have this relationship to wear it to What's where they can talk to us how they want to what's something that you always carry with you hot sauce Really? Yeah I want you to know people are gonna see this and say okay, she's paying her in the black people Is it working She didn't deny it Her statement was okay Is it working? Well, apparently it is Apparently it is because what you now see are people latching on to people on the liberal left and I'm not and I'm not necessarily speaking in terms of Political parties. I don't care if you're a Republican or Democrat But what's happened is not only do we have certain people in certain political parties who want to pander to the black community We now have blacks doing the exact same thing and again 60 years ago you've had this warning come out from again I'm not a proponent of Malcolm X's teaching but he was spot-on on this today You could point to a large number of Negro leaders who have consistently betrayed Negroes in a whole host of areas. They aren't really Negro leaders These are puppets that have been put in front of the Negro community by white liberals These are parrots that have been put in front of the Negro community You've got these people that want to pander to us and talk down to us and kind of pat us on the head While they're giving us something hoping to gain our loyalty and allegiance as long as you give them something Needs yours so you can talk down to a dog as long as you're giving them treats as long as you feed them As long as you pat them on the head you can keep them loyal to you You can keep them coming back to you as a matter of fact You can kick the dog as long as you keep feeding them and give them some treats and and pat them on the head He'll stay loyal to you. Well, I'm not the kind of person that wants somebody pat me on my head and feed me Just to get me to be loyal to you I'm going to be loyal to two things the truth and God and what I don't need is for you to give Me a pass or my community a pass for bad behavior I wouldn't give you one I wouldn't give anyone anyone a pass for bad behavior But when you do so you treat us as though we're the person we just can't get right We can't help ourselves. We can't we can't control our our actions our minds our thoughts It's almost like what was said about the on the bell curve that we do need to be graded on a curve that We can't compete and so we need you to help us and you want us and the reason being so is because if We are helpless. We need someone to come help us and I refuse at least I do myself Being a victim of any of this foolishness and it's gotten so bad that these so-called black voices and black leaders have gotten in bed with the with the liberal left that all they want us to do is to fall right in line and Bag at the same trough the same government trough that they beg at why because it think about it. It lines their pockets You don't see very many of these people these spokesman Who are who are giving us these excuses who are giving us a pass for this bad behavior in the black community? You don't see very many of them on food stamps as a matter of fact you see them doing very well Financially speaking right? I don't know how many of you have actually seen the interview that Roland Martin did with the king I think King Rand I can remember the guy's name young fellow 21 year old who he and I guess some friends Were bothered by what was happening in Georgia in his in his community in Georgia so they they bought a school building and bought a school bus and they're trying to Offer a different sort a different or alternative to the the bad education. They're getting in their town in Georgia And so what Roland who wants to do is simply pad his pockets? Who is beholden to the left who's beholden to the Democratic Party again? I don't have an issue with you've been a Democrat or Republican, but you clearly see his motives Rather than promoting this young man for doing the right thing He wants to attack him because he doesn't believe that voting is what's going to get the black community out of The position they're in well newsflash Roland. That's not so you don't believe you don't believe that Government government policymakers play any role whatsoever in being able to impact the lives of black boys and others in Georgia If we take them out of that government system We don't have to worry about that. How do you remove someone out of a government system when? We all live in government systems So you can do things to take yours to remove most government from your life How as far as trying to get yourself out of food stamps, how to get yourself You got to go work. You got to get jobs. You got to get out here and go and do it if somebody doesn't have a job Mm-hmm Are they not applying to government for unemployment benefits or insurance?  I didn't see anything idiotic about that So when you say do for self like what explain that or simply getting up and going out and do it I'm a question you're your type that I'm young black in America and I can't do anything because somebody's holding me down Question you would you nature's winning go ahead me and some teenagers went and bought a school And we just bought a school bus simply from going out and doing work. We decided to go fix our own communities I'm not expecting anything from no politician I'm government plays a role in being able to change the condition of the lives of people He believes that it's the government's job to get us out of whatever situation we're in not ourselves Not like it was in the Indian community or in the Pakistani community or in the Chinese community Or in the Jewish community or the Italian community. No, no We're the only ones who need help from the government and then it's caused this new breed of white folks Who've decided to play into it as well because hey you might as well go ahead and get on the gravy train And you've got these so-called thought leaders. What is the name Abraham X. Kendi? Why someone would listen to this foolishness? I don't know if white people Claim they are anti-racist and they should be asking questions like why is it that unarmed black people are being killed by police? But but armed white people are being arrested Why is there a growing racial wealth gap in this country?  I'll give him credit for this first and foremost Not every black person is an expert on racism now This is this the same black person who is concerned about what's happening to black people and concerned about racism Who would attack a judge Amy Coney Barrett for adopting black kids who by the way He didn't do anything to help He didn't help anybody black but look at the tweet that he put out about her some white colonizers adopted black children They civilized these savage children in the superior ways of white people using them as props in their lifelong pictures of denial by cutting the biological parents of these children out of the picture of humanity. I Don't even know what to say to that other than you you would be wise to leave him alone Ignore everything. He says of course Here's another person who's enriching himself getting thirty to forty thousand dollars per speaking engagement having over ten million dollars donated to his Organization by Jeff Bezos. Yeah, I think he's doing fine for himself because he's profiting off of the race industry And if you look back at Roland Martin's clip notice what's scrolling at the bottom He's asking you to give money to donate money to him So there's no secret as to their motives as why they're asking us to be beholden to someone else helping the black community You want us to to blame everything on racism? You even have people now blaming their obesity on racism? The research says that black women when we do the same diets as white women We lose less weight and we lose it slower even when we're following the diet than our white women counterparts It's literally that the racism that you're experiencing and the struggle to make ends meet Actually means the diet don't work for you to say and now we've even gone so far as even saying that some of the things that we know are true You've got people out there that are saying it's a myth. That's not true The concept of the absent black father is a myth It's not real and then there's been studies that recently came out that says that like the whole like black dads aren't involved or whatever It's just not true. It's just not true.  I Know what you're gonna say though You're gonna say that even though they're not married, which by the way makes a difference even though they're not married They're still involved. Well, you tell me because you only got 24 hours a day You tell me how this father who has a child over here and a child over there Let's just say only two has two children how he's involved in both of their lives Though he only has eight hours a day because he's sleeping eight He's working eight if he indeed is working and then he only has eight hours How he is dividing up those other eight hours, I guess for for this child for for that child. How's he doing so? Every day he has no life of his own. He's not eating He's not Working on a love life of his own. I don't know you tell me how this person is doing that Stop with the foolishness Call out sin call out bad behavior so that we can fix it so we can address it and move forward So what's the solution? What's the issue here? What do we do to fix this in first Samuel? The people beg and ask for a king and what does God tell Sammy said don't don't be upset.  They are rejecting me And so he tells Samuel tell them what will happen if you want a government or in this case a king For your God he says in verse 10 of chapter 8 So Samuel told all the words of the Lord to the people who asked him for king And he said this will be the behavior of the king who will reign over you He will take your sons and appoint them for his own chariots and to be his horsemen and some will run before his chariots He will appoint captains over his thousands and captains over his fifties Will set some to plow his grounds and reap his harvest and some to make his weapons of war and equipment for his chariots He will take your daughters to be for perfumers cooks and bakers He will take the best of your fields your vineyards and your olive groves and give them to his servants He will take a tenth of your grain and your vintage and give it to his officers and servants And he will take your male service your female service You're your finest young men and your donkeys and put them to his work Let me drop down to verse 18 And you will cry out in that day because your king whom you have chosen for yourself And the Lord will not hear you in that day obviously He's referring to to israel but some of that can be gleaned for us because we want Rather than god being god we rather government to be god rather than let god be god and be our source We want government to be our source the government can be a resource but not our source And the way we made progress Prior to the civil rights movement was one focusing on god the church was central in Our progress as a country did we have sometimes where things were kind of set against us? Did we have instances such as black wall street in tulsa? Or what happened in rosewood florida sure we did those things would happen But you notice those episodes began to decrease As our trajectory went up the more we became successful the less you saw these things happening to us Because what happened was people began to respect our community What we had gone through was obviously horrible And no no community at least in this country maybe the the native americans could say that they'd gone through anything like it But what we didn't do was we didn't complain about the plight we instead focused on the future So we focused one on god on faith, but also on family In 1922 1945 we had 22 of our children born out of wedlock Now it's 72 That's devastating to the black community. And so if you ever want to see us to be the community the group that we Had expected to be the one that we dreamt about during the civil rights movement We've got to get back to that. So whether it's some new policy or whether it's some new academic theory None of that is new and none of it works What was working was those two things an emphasis and a focus on god the father and on family Because what happens is if god is the head of your life Then naturally your heart has changed and the love towards the mother of your children you marry her And you take care of them And what we do is this when you get on an airplane they say in the event of an emergency they say first Take care of yourself put the oxygen mask on yourself and then the person that's next to you Why because if you die obviously you can't help to resist say the next person you can't help the next person Same thing in this Take care of your family first. Take care of home. Let's work inside out work on your family Be the father if you're a man listening to this be the father to your children that you're supposed to be be the husband To your wife that you're supposed to be Be the person that is the one that your children and your family looks up to And then let that kind of go out to the the rest of the community Let it go from from your house to your neighbor's house to your community And then watch it spread because if we get enough men being at home like every other community Like the nigerian community like the like the jewish community like the asian community If we get enough men at home and we're talking about people who aren't even christian But that principle works if you get enough men at home, you'll start seeing young men and young women going to school To get their education you'll start seeing uh less of a dropout rate less of a crime rate Less of an incarceration incarceration rate You'll see all the negative things that we focus on start dissipating and all the positive things that we look for Start increasing But absent of god the bible says that those that wish to build the house if they do so without god They what they labor in vain. This is not a mystery. This is not something new We don't have to wait on somebody new getting out of college coming and telling us What's going to work and that how racist we are and so forth as though They've even seen anything Remotely graces to what we've gone through in our lives and even my parents lives and my parents parents lives and so forth So let's just be smart about this. Amen