Thank you all for coming. Thank you Quintero for hosting. Hi, my name is Philip Thompson. I'm here to talk about specifically distributed NoSQL databases. So to give you some context, I'm a software engineer at DataStacks, where I work full-time contributing to Apache Cassandra, which is a NoSQL distributed database. It's going to be one of the case studies I'm going to be examining in my presentation. I'm also the maintainer of an open source project that developers and companies use to mock full Cassandra clusters on their laptop. That's CCM. So we're all very familiar with a client server architecture. Here we're talking about a database. So really it's more of a database server app server architecture, where the app servers are the clients of the database. And then those app servers have the users as their clients. This is a really simple abstracted architecture where we have a single machine. That's sort of the traditional way we look at it. Historically a long time ago, that's how things were. You had your one database. You build it on a very large machine. You build a lot of redundancy into it, so it never went down. And it had to handle your entire applications load. So why would we leave that architecture? Why would you want more than one server? Well, there's load. It comes down to the fact that scaling up has diminishing returns. If you have a single server installation and it needs to handle twice the load, what changes do you need to make to that box for it to handle twice the load? There is no formula for that. Doubling the memory the disk and the CPU might not get you twice the load. It might get you 150%. You might need to quadruple the size of that box to handle double the load.  Failure. As redundant as you can make a single machine, something can and will go wrong to it eventually. You will suffer downtime as a result of that until you can fail over to your backup, until you can fix the problem, until you can restore it somehow. And ultimately maintenance, if you need to bring down that machine to perform manual maintenance, you're causing that downtime. For a lot of the customers I deal with at work, downtime measured in minutes equates to millions of dollars. That's a situation that many companies don't want to or cannot be in. And thus that's the biggest reason for moving off a single server architecture. So this is a sort of a settled issue that happened a long time ago is they came up with a master slave architecture. You have one master, which has many slaves. All rights go into that master, all rights come from your slaves. The master is responsible for forwarding the incoming rights to all of those slaves. That allows you to take all of your read workload off of the master. So we're in a multi machine setup, but really one machine is still responsible for all of the work. Potentially in some master slave setups you have failover built in.  There, however, are issues with this setup. The biggest one is slave lag. If the amount of data you have coming into your master node exceeds matches or even approaches the amount of data it can pump into slaves, eventually due to network hiccups or downtime, those slaves are going to get further and further back in time to the point where it's possible they might never catch up. There are real cases of people who have to take a physical disk, plug it into their master, fill it with data, walk it over to their slave simply because that's more bandwidth and more throughput than they can get over the network to catch those slaves back up.  Scaling, ultimately a master slave architecture can only handle the amount of data the master can take in. You can scale reads infinitely, you can add as many slaves as you need, but ultimately write data is still bound by what the master can handle. There's partition tolerance, which is to say if a partition occurs where the master is unable to communicate with the slaves, you might have a situation where reading from different slaves is going to give you different results. That could cause issues in your application if that's an assumption you made that it would never happen. And finally, it's really hard to add more masters to this setup. I don't know if any of you have ever had to take a master slave setup and horizontally shard it manually, double it. I've had to do that on my SQL. It is incredibly difficult to set up an active active system on a database where it was not intended to do that from the start. You have to manually split your data so that half of it will always be going to one master, the other half will always be going to the other master. If you want to split it into more masters, you still have to keep manually sharding your data. There are external tools to do this on relational databases like MySQL and Postgres, but ultimately it's a lot of work. So where do we go from here? Well, I want to take a quick aside to discuss the cap theorem. I'm sure this is something some of you are familiar with. It was presented by Eric Brewer in the year 2000 and it discusses a certain incredibly important tradeoff that you have to consider when building any distributed system whatsoever. It is regarding what you do when you have a partition. The C stands for consistency, the A is availability, the P is partition tolerance. It's considered a pick two system, which is to say you can't have all three of these at once. Really, that's a bad way to look at it. The way you should look at it is if you have a partition, what does your system do? Does it choose consistency or availability? Because to not have partition tolerance is not an option. To say I'm not partition tolerant means you're choosing consistency because you're saying whenever there's partition, my machine just shuts down. That's what it means to not be partition tolerant is I refuse to answer the client application. That's choosing consistency over availability. So what's going on here is, this is actually the great workplace situation, is if you have even a two machine set up and there is a partition, they're completely unable to talk to each other. So these are two databases, database machines in your system. A client sends a right to the database on the left side of the partition and it says, here is some new data. What is that database going to do? It has two options. It says, okay, or says I can't take this. Ultimately, it's sort of a force binary there. There's no option there. So if it says, okay, you're choosing availability, you're choosing the ability to respond at the cost of consistency, which is to say, all of your machines agree. So if we accept this, this machine still has an old state. It has a state that no longer matches what the client thinks has happened. The client has sent a right, it's gotten acknowledgement, it is positive that whoever it talks to will agree that that data is there now. That's not the case. However, you are inconsistent here. You could have chosen to say, no, I can't accept that right, because I can't make myself consistent. That's choosing consistency over availability. You are not responding in the case of a partition. So you might think of a partition as a hard stop, absolutely no connectivity. But partition is anytime there's a lot of latency. If you have to wait for a all nodes to reach some sort of consensus protocol, whether that's Paxos or Ramp, or then dealing with some distributed lock, you're choosing consistency there over availability. You're saying, I have to wait to answer, until I am positive that I am consistent. That availability is not a full loss of availability. It's a increase in latency for the benefit of consistency. So are there any questions about that? I think I have a question. Yeah. Pretty much. What would be the safe bet? Would you prefer consistency availability? That absolutely depends on your application. There are many databases that make the consistency choice. There are many databases that make the availability choice. And they're both equally valid options. It really depends on your needs. Can you give examples of applications that would like to prefer minor data? Well, I work with, I'm going to give examples of databases that follow on the other. That works. Okay. So I have four NoSQL databases here to discuss MongoDB, Apache HBase, Aerospyke, and Apache Cassandra. So MongoDB is, by many measurements, the most popular NoSQL DB. It reached that popularity for a number of arguable reasons. One of which is it is incredibly easy to set up, is incredibly easy to use from a developer standpoint. If you are a web developer and you're dealing with JSON arguments, this is the most friendly database you could ever have. You just open up a connection, you hit save on that and pass in your JSON object in whatever language you're using with your MongoDriver. It's in the database. Totally schemaless. You can search on any subfield in your JSON document. Beautiful. The issue you're onto is performance. But we're here to talk about distribution and what choices each of these databases made. So MongoDB, despite being such a popular NoSQL database, didn't really experiment with distribution. So the way MongoDB works is it splits into replica sets, which are just master slave subsets. Each one handles a section of your data, just as we discussed, charting with a typical relational database. The difference here is Mongo will handle that charting itself, which is nicer for you, a bit easier to set up. But ultimately, you're going to run into all of the same issues you had in master slave setup. If the master goes down in a replica set, you are going to, it has automatically failover built in. So you have to wait for an election to occur where they choose of all the slaves a new master. So this is going to cause, for that period of time while you wait for that election, a loss of availability. You're not going to be able to put in new rights from the database that that replica set is in charge of. So we gained here automatic charting, but we didn't gain any increase in availability. We kept the same amount of consistency. So MongoDB is absolutely a what we call a CP system, it chooses consistency and partition tolerance versus an AP system, which is availability and partition tolerance. So just to describe the high level architecture of Mongo, your client, your application server using its driver is going to talk to a specific Mongo node called a query router. The query router knows which replica sets are in charge of which sets of the data. It's going to forward your query to that or those replica sets, they're going to answer. It's going to send that back to you. If you are depend some queries, it is unable to determine which replica set is responsible, and it's going to ask every replica set. So when you have replica sets that are down, due to a loss of master, you're going to see problems with those queries, you're not going to get responses. That's going to come back to your application as a time out error or an unavailability error, some sort of response that it could not meet the consistency you needed. One thing Mongo has, which we will see that everyone I'm demonstrating, but HP has is configurable consistency on a request. When you send a write or a read request, you can tell it how many replicas in a replica set you want to check. That is because essentially the slave like problem we discussed earlier with a master might not have gotten all the data to the slaves yet. They might be at different points and catching up to what's on the master. So they might have different ideas about the state of the data. So you can increase the consistency, which is to say you can check more replicas of the responses from those replicas. You can find the one that is the most correct, and then that is the response that will be returned to you. On a write, you're saying, I want to make sure that at least this many slaves have received the right from the master before my application feels comfortable knowing that this data is in the database. So next is Apache HPACE. HPACE is also a consistency first system. HPACE has a pretty complicated architecture. It has a master or a number of masters. Masters are responsible for region servers, which are not quite slaves. Regents servers all hold up to they recommend 100 regions. So regions. So the best way to start of it is the bottom up. You create a table in HPACE. You start running that table. That table has one region which corresponds to all of its data. As you keep writing to that table, it will realize this is too much data. It will split that region into two regions each containing half your data. That process continues forever as you write data. So the regions are split onto region servers. Regions are files on disk region servers are physical machines. The master or masters of your HPACE cluster are responsible for assigning and moving regions between region servers. So if you have certain region servers which are handling too much load, the masters will take regions off of those region servers, assign them to other region servers to balance your cluster. If you have a multi master setup and what you really have is a master and backup masters which are managed by Zookeeper. Zookeeper is an external distributed locking system. You use it to achieve consistency in distributed setups like this. HPACE is sort of the most popular user of Zookeeper. So what would happen here is if a master goes down, or if Zookeeper believes it goes down, it would contact backup master and format that it's the new master. The new master would then begin taking over that role. While your master is down and new master is being chosen, you can continue to read and write from your region servers. So the loss of master does not cause a loss of availability. However, the region servers do need to continue to be managed so that master cannot be down indefinitely. Ultimately, you'll you can have downtime there on the master, but that's on the matter of minutes, maybe hours, absolutely not a longer than that situation. The region servers hold many regions each, each region belongs to only one region server. So you might consider here that data is only stored on one machine at most. Well, HPACE sits on top of HDFS, which is the Hadoop file system, which HPACE uses for replication. So HPACE will be reading and writing to and from HDFS. HDFS is handling the replication of data. So you can rest assured your data is durable and replicated across multiple sheens, even though at most only one region server is ever handling your clients interaction with that data. So ultimately, because HPACE of data is only on one region server, there's no configurable consistency amount on queries. The way we'll see with these other databases. Any questions on HPACE or Mongo? Yes. Okay. You said MongoDB was most used no SQL database? Yes. Isn't it Microsoft's Active Directory? Isn't that the most used no SQL database? Active Directory is definitely a non relational data store. But I would say it does not market itself as a no SQL database. I'm not defining no SQL as everything that isn't relational here. Yeah, I'm thinking it specifically as the databases that define themselves as no SQL. It's sort of an opt in buzz word. Okay. Aerospike. Aerospike is an availability first database. It, I feel at least has a much better architecture than HPACE or Mongo. So it has exclusively masterless, completely identical nodes. So you go back to them. They have a hash, hash algorithm. I don't know exactly which one Aerospike uses. But what it does is the output of that caching algorithm, you can think of as a circle from the minimum value, maximum value, module all the way around. Each node in your Aerospike cluster holds a value. That value matches a value in a range of the caching algorithm. When data comes in to the Aerospike cluster, it can be sent into any node that node will hash the primary key of that data. It will then look on this ring, see the hash of this value, it will go, this is the node that owns that data. It will walk that ring, define the ring with who owns the slice of data, who owns the slice of the caching output that your rights primary key fell into. That's how data ownership is chosen automatically, completely algorithmically. So you can horizontally scale this just by adding nodes will take up new slices of the token of the token ring. And you can other way around, you can also remove nodes, your data will be distributed back out to the machines that now own what previously were their slices. Thank you questions. Is it really like this is a primary key, really primary key like is it unique for that data or can you help do this? I would say you should not think of it as the way to think of it for relational database. There is only one row with that primary key. I don't know that Aerospike's on that architectural potential. I would say I'm more than 80% sure it works exactly the same as Cassandra, where there are no different bits of that primary key. But I can't guarantee that. When you say identical, it doesn't mean that data is identical. Yeah, the data is not identical. But no, no, it holds a special designation for any other node. There's no master, there's no, I have a special responsibility. Every node is just a member of the cluster. It holds, it owns a subset of the action ring, and it gets whatever data falls into the hash ring. You then specify a replication factor that is to say, in addition to the node that owns me, how many other nodes should I be on? This is for a few reasons. One, durability. If you lose that node, you want your data to be in other locations. Two, availability. If that node goes down, you still want access to the data it owns. If you have set a replication factor of one, you don't have access to that data until that node is restored. So if this is where our data fell, you specify replication factor three, just choose the next three nodes. It's a very simple system. Easy to reason about where your data sits on the cluster. Easy to reason about why you have hotspots if a certain part of the ring is getting too much data. So they're this? Yes. So they use a tool replication factor? So you specify your replication factor. You decide how many machines each row of data should be on. So this is all happening within a data center. Aerospike allows you to define other data centers, which exist as separate clusters. You then run a separate process on each of your aerospike nodes that are informed of a sort of larger data center topology, which I've demonstrated here, you can set up active passive, you can set up active active, you can set up a really complicated start topology where you have three active active active databases and each one has its own passive data centers. Sorry. So all of these data centers are going to be holding all of the data that is in your aerospike cluster. So if you have a row of data replication factor three, it's going to be on three replicas in every data center.  The default is to write to all replicas and read from only one that ensures it guarantees consistency with the defaults there at a loss availability. If any single node goes down, you can still keep reading but you cannot keep writing. You can configure that consistency to use fewer replicas that you stay up even on note failure. So in this, they use the distribution hash table? Yes, it's absolutely distributed. Including the index within the cluster or only data? I don't know how. So the primary key indexes are is how it's distributed as far as secondary indexes like on other columns. I don't know how I respect doesn't. I would expect again, same way as Cassandra, they're very similar in that each node is responsible for indexing the data it owns, only locally. So finally, I have Patrick Cassandra, same master list, identical node setup. And again, partitions data via hash algorithm. I know which one we use it's murmur three. The biggest difference is the cross data center replication. Cassandra, all data centers are active, which is to say they can all accept rights at any time and they will forward those rights to any and all data centers. The cross data center application is built in. It is not something you need to set up a separate process for. The reason it's a separate process on aero spike is nothing technical. It's simply a the open source doesn't have it and the enterprise version does. So they sell you that separate process. A limitation Cassandra has that air spike does not is is the active passive and the start topology. You can set up something similar and simply treat one of those data centers as passive by not writing to it. But everything is always active. Here, same thing as air spike, you specify replication factor. Here we're using replication factor three. So it's going to three nodes in each data center. And same system, you can configure the consistency of your requests. So on rights, you can go to as many or as few replicas as you need. Same with rates. Cassandra is also an availability first database. So you can like our spike take down nodes still continue to serve requests. They operate on what's called a ventral consistency, which is to say that all that the database is not consistent that every replica might have different opinions of the state of the data it owns, they might disagree with the other replicas. That is because you might have chosen only to write to two before getting a response. And the third one was down. And when it comes back up, it is missing data. Both systems have ketchup mechanisms built into them. Some are automatic. Some require manual operator intervention. But it's something you need to build into your application, the assumption that if you're writing them with a configurable consistency, that might mean that replicas disagree. You have to assume replicas will disagree all the time. And what are the difference? HDFS, it will write once and delete many times. Cassandra is reciprocal or C? Cassandra does not use the Hadoop file system whatsoever. So HBase sits on top of HDFS. HDFS is I's typically used for bulk analytics. You know, it is the Hadoop file system. I don't know what HBase does to get it up to transactional database speeds. But HDFS there handles the replication of the data. But it does not handle serving the data. HBase is doing that. And every single HBase slave, which is a reason server, controls, has a monopoly over its section of the data. Because they would say in the Cassandra, the use of knowledge and data sets, the faster the scrums, because they write faster? Yes. So that that is unrelated to the distribution mechanism. But in Cassandra, the reason the rights are faster is it's a log based right system. So it does not read before right. So when you insert it, it depends to a log and it will handle checking for duplicates on the read. So rights are faster than reads. So any questions? So if you have an application, so like, how do you basically verify that the consistency is where you need it to be for your application? It's sort of like critical importance, I guess. Yeah. So typically, what users will do is read and write both at a consistency of quorum, which is the same more than half of the nodes. Get that information. If you read a quorum and write a quorum from, you know, CS 101, the pigeonhole principle, you're guaranteed to always get the correct data back. Because there must be an overlap of your rights in your reads. So when you get that read back, one of those replicas must have the most up to date information. So what you get back is the most up to date information. That allows you to suffer a loss of one fewer than half the replicas in your cluster at performance setback. Obviously, you just lost a significant number of nodes, but no availability or consistency loss to your application. Very, very rarely do users use the all consistency levels. Simply because that adds high P99 latencies and a lot of difficulty when you're performing maintenance. So these seem to have wildly varying complexities and probably administration. Absolutely. So can you give ballpark numbers of like, if I know I'm going to start with one machine and I need five, I use Mongo. Absolutely. I know what the party line is here. But I would say the IRC users in the wild, say if you're not going to, you're never going to have more than five nodes, don't ever ever bother with the Cassandra. That's simply because they recommend just staying on postgres in that situation or Oracle or whatever your relational DB is. If you don't need to, if you don't need the scale, if you don't need the multiple data centers, and a very nice thing about Cassandra and Aerospike is these data centers can be anywhere in the world, all around the world. If you don't need that, it's better.  If you have, if you're using Hadoop heavily, if you have all your data in HDFS, if HBase is going to put up the performance numbers you need it to, because ultimately it is constricted by the speed of HDFS, HBase might be right for you. If it's a personal project, or if it's okay if it goes down, or if it's not going to handle a lot of load, you're okay to stick with Mongo. But I would, I would never point a customer at a Mongo installation. I was watching, I mean, I'm absolutely biased in every way. But I was watching a presentation earlier today by Macy's. They were examining a number of different NoSQL solutions for a new system they were setting up. All the numbers were coming in really close to each other. It was a tough decision, except for Mongo, which completed none of their tests at the scale that Macy's was operating. So, AirSpike's documents say 10 to 100 node clusters, 5 to 1,000 nodes for Cassandra. HBase clusters, I have no idea, I think it's in the same scale of 10 to 100. That's mostly because HBase is capable of being incredibly, incredibly more data dense than a Cassandra installation is. If you need 10, 20 terabyte servers, you should be writing HBase. If you are going to run 102 terabyte servers, Cassandra or AirSpike are more up your alley. Anything else? Just a broader question. What's, what's the general cause for a node going down? Is it like hardware failure? Yeah, any sort of hardware failure? Any sort of corruption? Most of the time, a partition issue is that node is slow for whatever reason. And all the other nodes think it's down, or it's responding so slowly, it's effectively down. It's never the one who's meeting the requests because it's simply taking too much longer than everyone else. Or, you know, it could be your, if the database system you're running, you've over, you've knocked it over, you know, that happens a lot. We've definitely seen people have issues with Cassandra, with Couchface, with Mongo, with really anyone where you set up a cluster of a certain size, and you scale too far past that size, and your nodes are falling down simply from out of memory errors, from too much garbage collection, from getting caught up in IO, and they're, they can't handle it and it appears that your own system's down. Yeah. I remember hearing, at least a while ago, that people kind of screwed up with MongoDB by overwriting their same data too much. And, you know, it was a really bad use case. It's in the documentation. Yes. If you're, if you write a document and you write a longer document to the same key. Yeah. It doesn't like that. Or, you know, are there similar branches with the other systems? Yeah. So a lot of that with Mongo is they have write locks to achieve consistency. Also, when you're overwriting, you're rewriting the entire document. HBase and Cassandra are both node-wise Google Bigtable architectures, which is to say they have column families, which is to say that overwriting is great, really. They have that log-based architecture. So an insert is always going to just be written immediately to disk. Then on the read, what's going to happen is they're going to find all of the results for that key. And they're going to say, which one is the newest? They're going to be back to that. Then as an asynchronous background process, they're going to be compacting the files on disk together and removing all the old duplicate data. There are, I mean, absolutely gotchas with those systems. But I guess I would, I'd like, need you to narrow it down more than just gotchas. Nothing jumps to mind, does he know here's a beginner mistake you should connect with? Oh, okay, then that's definitely easy. Deletes. If you have a queue-based workload, you're inserting data and then deleting it later. Due to the eventual consistency these guys have, they can't just delete data on disk. Because if two nodes delete data on disk and the third one didn't catch it later when you read, the data is still there. So what they do is they write a tombstone. That tombstone is to say that at this time this data was deleted. If someone else thinks it's there, tell them they're wrong. Those tombstones persist for a long time. In Cassandra, it is a week. I don't know how AirSpike handles it. So what I'm saying is deletes are building up data on disk. They are creating data that the processes in Cassandra and AirSpike have to read through when doing reads. They have to handle those tombstones on compactions. And essentially you're bogging down the database with not data. So if you have a delete heavy workload and eventually consistent system, it's not going to be for you. You're going to want a strong, leak-consistent system. So also if you have a legal requirement to delete data, that more or less borrows the systems over there? No, so the data is deleted. Oh, just, okay. So the data is But it writes the tombstone just in case another machine is missing it, like hasn't gotten that delete yet. And then the asynchronous catchups or the operator intervention, which is not an unexpected intervention, it's like a once a week, you kick off this process that goes and catches up everyone and everything, that will cause the guarantees of the delete. But if you have some sort of delete SLA measured in minutes or hours, not days or weeks, it's quite probable that it couldn't meet that. Yeah. Absolutely. Anything else? And after Google how old air spike is to answer that with any authority on the replication systems are incredibly similar. But that's the same with react and dynamo DB. These are all children. So actually, yeah, they're both stealing off Amazon's dynamo, white paper, dynamo DB. It was the originator of this cross data center, this token ring management distribution style. It is arguably for cross data center replication, the best. No one makes it as easy to set up and handle automatically, multiple data centers around the world all active the way that the way dynamo and it's, you know, children databases do on on node, like how the query language, how each node handles data, their capabilities, errors by Cassandra react dynamo, they all get really different all of a sudden. But it's at this higher level where they all do really identical. A big difference is vector clocks. So when you have multiple rights coming in at once for the same key that are conflicting, Cassandra is a last right wins policy. highest timestamp is correct. If you need a transaction like system, you say, I need to absolutely guarantee that this is the right that works. What we allow you to use Paxos as a consensus algorithm, but that's intended only for very small subset of your workload where you're like, I like usernames like I need to make sure only one person has this username kind of deal. react and dynamo use vector clocks, which is where they get both and they give them vector clock values and they sort of return it to the client on the read to say, you sent me both of these deal with which one is right, let me know so I can update them. We wow that may be more useful for most workloads. Ultimately, it's a case by case basis. And we felt last right wins was better. Okay. Do all these database systems have PAM support? I don't like well authentication module? Yes. Yes. Yes. I don't know about I was like, but I want to I want to say almost certainly I mean, it has an enterprise edition. Usually cancel that without authentication of some sort. All right, thank you.


Felly gofyn yn ddod, mae'n gweithio'n gweithio'n gweithio yn Llywodraeth. Gŷn nhw, beth yna? Yn mynd i'ch meddwl. First of all, dweud i'n meddwl am y dyfanyddol, mae'n cwestiynau yn mynd i'n ddod. Efallai, mae'n amddangos, ddrygedd. Dyna'n ei gweithio. Felly, mae'n ei gweithio? Great. I just back here, I've been back in the UK kind of since April, kind of just dividing between here and America, kind of more moving towards being here. Work here is kind of just a lot of things on the go and trying to sort all that out and keep abreast of all that. I keep busy. I keep busy, you know, so we're talking about the devil makes work for idle hands, so I've got to keep busy. Otherwise it's like kind of from the too many distractions. First to and Pylton, West Pylton and the Prefabs, and then on to Muir House and the Masonettes. So I kind of grew up in sort of Leith, Pylton, Muir House, mainly Muir House. Good upbringing. Ah it was a good upbringing, it's like because everybody kind of in that local community knew each other because they all came for the same neighbours that we had in the tournaments in Leith, neighbours were in the Prefab in Pylton and again they kind of moved people by streets. So you knew everybody basically and you kind of knew everybody and your parents kind of knew each other and their grandparents knew each other. So it was a kind of very, even though it was dispersed along the history, it still had that kind of very strong community feel to it. And how was schooling and stuff in Edinburgh? Terrible at school, I mean comprehensive schools were kind of in the North Edinburgh and like Kingsley Park, Craig Royston, they were basically there to service the industry that was like Parsons peoples for Anties and United Wire and people kind of basically were factory schools, you know that was the idea that you would get a job in the local factory and then the factories closed down basically so there was no employment in the area and things kind of, you know you could see that the area was starting to decline and just through lack of employment you know. And really you know when I grew up though, when I was growing up in Muir House you never saw drugs at all, nobody's even smoked joints. I mean it was like kind of McEwen's Expo or Tennant's Lager was the strongest drug you could get and maybe a nippa grouth if you're really hardcore. If you had a bit of money. So in school and then when you left, were you a musician at one point? Or trying to be a musician?  The great thing is I mean I do music now and I really enjoy doing it and we've been more kind of successful now about it but because it's like you don't have to have musicianship skills to do music you just have to kind of be creative basically now but you know I just don't have my brain and my fingers aren't wired correctly for playing a fretboard or a keyboard and I could never master, I went from guitar to bass to trying to play keyboards and all that and I just didn't have the dexterity or the nimblness to do it and something's not connecting up properly here fast enough. Yeah fast enough but also kind of it's just a matter, it's a kind of a comfortableness for the instrument and I think that because I was so obsessed with music and still am I'm kind of if it didn't sound like the people that I really looked up to or it wasn't at that standard, I got very despondent about it but you can't be at that standard, you have to work up to it and I think because when I moved to writing and I didn't really have literary heroes as such there was no reverence on that part, I just was an arrogance I thought I can do better than anybody else. No role model. Yeah because there's not people that I'm really kind of looking up to in the same way there was that I was intimidated by who were brilliant at music. Was that your passion then when you left school to be a musician? Yeah I was obsessed with it and I was like I used to go down to London during the school holidays because my uncle Alec was a train driver and Manage SUV married down there was a nurse and they kind of they moved from Fwllham to Southall so I got sent down there getting on the road for a wee bit so it was great for me because when the punk thing kind of kicked off it was an easy transition for me I could just kind of go down there and I could kind of almost like that. You had a second family you could be looked after and you kind of everybody thought you were kind of sort of living in some horrible squat and I was going back to this very comfortable house and getting kind of cooked sundae roasts and nourishing meals and all that and like show you get in performing that Sam. It was great so I was inducted into London Life in a kind of in quite a risk free way and obviously when I got into it I got into sort of the squat and saying and got into sort of kind of messing around in different bands and all that but it was a very smooth kind of introduction to it for me. So the squat and saying as well what was that like back then? Terrible, terrible.  So when did you start making your life choices then to get into the life like the screenwriting and did that become habit or by chance that happened? Well it was but you know what it was doing when I realised that the songs I was writing they were actually interesting because they were ballads they were telling stories basically and ballads are just stories set to music and I thought well the music's not working I'm getting the elbow to every band I've ever been in I mean there's one time when I went to one of the record stores on Inverness Street in Camden and I saw this sign and it was like you know you have the little sort of bassist wanted and all that drummer wanted and all that and I saw this I recognised the phone number and there's bassist wanted and I thought that's my fucking mate in the band you know it's like kind of and I'm the bassist so I'm getting sacks from my own band but you know it's like I thought this is terrible so I went round the phone box phoned them up and I sat down and put on an accent and I go oh and I lost his bassist thing and he goes yeah I've got him on my mind he's fucking bassist now but he's shit I'm going to get rid of him you fucking cunt so I just realised that this was going to be a recurrent theme you know I was going to get to a level of kind of expertise but no more after that like you know so that was like that was a kind of eye opener that was never going to have the requisite musicianship skills to do anything in music but now it's interesting though you know you have all the you can do everything from a laptop you have all these software packages you don't need to be a great keyboardist you can just note something out and then sample it and just loop it and the same way you know you've got all these kind of drum patterns and you've got all these kind of bass lines and you know it's like my mate Steve his studio is just pulling machines and he's just absolutely brilliant he can get every sound from every error from all these different sort of synthesisers that he has from all these different times and all that you know so it's like kind of I mean that's really sort of not something broad in my musical education but also kind of allowed me to to be able to write songs with kind of with lyrics and harmonies but have it actually realised musically without being a musician basically so it's an amazing thing it's a bit like when I started writing I mean if I had to write long hand you know like George McKay Brown the old boy in Orkney that won the Booker Prize he used to write everything in ballpoint pen and then he would hand it to the local typist and she would kind of sort of do it out and I thought God I could never write anything long hand I would never be a writer if it wasn't for the technology the technology enable me to be a writer basically What was the first thing you'd ever written? I think it's funny when I was at school I used to write essays like you know you have to write compositions and all that for English and one teacher of Mrs Tate who was fantastic and she was always incredibly encouraging but she goes this is great this is fabulous and when I left school I was working as an apprentice TV mechanic and I was doing my city and girls at college and I kind of ran into her in the street and she said are you still writing and I went what are you talking about why would I be writing you know I've left school you know this is something you do when you're at school and you do it in the English class but it was strange because I was doing this apprenticeship that I didn't really like it and I didn't have any particular aptitude for it but it kind of shamed me it made me feel maybe I should be thinking about doing something like that something creative and it kind of you know so I think the stories that I wrote at school were probably the first things that I did Did she see a talent in you then? Was that why she asked? I think she did yeah she did I've been in touch with her since then she said that you know the stuff that you were writing about was like kind of fun you're writing about all daff wee stories for the scheme basically like you know but they were kind of fun they were obviously sort of they were obviously based on some kind of reality but they were kind of hyper real as well we had that kind of sort of mad crazy mind and all that and when I think back I just used to laugh at the time you know but when I think back in it obviously the genesis of all that is in all that kind of stuff nothing's kind of nothing that you do is wasted and I think that there's clues there's always clues to what you're going to become what you were when you were a kid for your path so all the rejection as well you receive from the bands and stuff that this hasn't yet any time that other that kicked you on and go fuck this I'm going to make some for my life both both I think you have to you kind of I think that I'm quite lucky that I'm kind of quite resilient you know and I think because I grew up in quite a multi sort of a multi household family in a way you know because you go you tub your tea then you go your aunties basically are in the corner and you get another tea there like you know you got your baskets and you get a big fat bastard thinking like but yeah so you kind of got you always felt a lot of love and belonging growing up I remember like Manny Betty used to say to me she used to grab a huddymi and you know in the hallway she goes you're the best and I'm all son you're going to go on and do great things and I would go like you know I think this is great Manny Betty seeing the special talent in me I can't let her down I've got to go for it and then I realised she was not only saying this to every other kid in the family she said it to every fucking kid in the street you know she's a positive motivator that special bond in somebody giving you that motivation in your mind sometimes you go right I don't want to let them down do you know what I mean I always had a lot of affirmation my mum and dad were really always positive and said do what you want pal go for it go for it you know sort of fun and everybody you know I think because I was quite bright and quite sort of fun quite kind of cheeky but kind of trouble but kind of you know I was quite globby and all that and quite articulate so they kind of gave me a lot of leeway and it's like kind of and it's like my mum was always like I every says he's intelligent but his school grades are shite he's left school when they qualifications and you've just indulged him and I'll come good he'll come good at something so it was like it was interesting there wasn't a big kind of paper chasing kind of sort of culture about it but there was a belief that if you were left to your own devices you know whether it was like you find something whether it was like music or kind of fun you know or writing or kind of carpentry or plumbing just let something do what they want to do and just let them continue to do that seeing you were doing your jobs and stuff did you always feel I've got more to give did you always feel that you could shoot for greatness well I always felt that I was looking for something that I wanted to do find your passion yeah I mean it's like kind of what I knew through all the jobs that I was in I never wanted to be doing I never wanted to go I never wanted to work for anybody basically in the sense that I didn't want to go in to work every single morning in a factory or an office I mean sometimes you love to go into a factory or an office because your pals are there and you have a laugh and all that and you do a good bit of work but nobody can want to do that every single day of their life I mean you must think there must be some days that you think fuck it's a Tuesday the sun's out I don't want to be in here I want to do something different and all that and that's kind of I wanted to do something that gave me these kind of choices that I didn't have to do that to live that kind of regimented life and it was important for me to try and find something that I could be more self-directed at it didn't really it would have helped if it had been something creative that I could express myself in some way it didn't have to be it just had to be something that was that was kind of it was just going to give me a bit of autonomy basically Do you struggle being in the same place at one stall at a time? Yeah I do tend to move around a bit and it's not so much a struggle but it's like kind of an enquiring really I just want to see what's around the corner so I've always tried to travel and I think it comes back to to me being allowed to to go down to London for the summer holidays as a kid and to go up to Nair for the summer holidays and spend a lot of time kind of on mowing doing mowing stuff and getting involved in mowing stuff so it's always been I've felt comfortable in doing and I get kind of I do get kind of I mean I like to have a place that I can go and recharge the batteries and all that but I do like to get out and see things and do things as well So how did you start making your money in London? How did you survive?  Yeah I've been clean for years basically How long, when did the heroin addiction take control?  I think it was kind of therapeutic I think alright in this therapeutic though I mean I think it's because it was in some ways it was personal I needed to get it out there was a very therapeutic element to it but even when I've written books that aren't seeming to be so personal they've still had that impact for me you know they've still made me feel as if like a kind of you know this is good, there's some kind of a boil here you know I feel much more kind of at ease and relaxed and all that you know the only thing is the dangerous thing for me is when I turn the book in or when a film wraps or when a play comes to its end I just think wow it's time to party and then just get back to work get back to work that is the part where that's that middle part where the free time kicks in do you know what I mean the worst thing about it is you feel that you've earned that free time you know and you think just well I've earned I've earned the right I've fought for the right to party I've earned this holiday to an extent but in some ways I think that and I've got a lot better kicking back and relaxing and all that now and it's like kind of you do I mean I kind of meditate now I can sit on the beach in Miami and I think to myself shall I go for a cocktail no actually I won't sit on the beach I'll take kind of deep breaths and I'll look out what's going on here and I'll just get a one with myself get the breathing right and all that but I think that keeps the demons at bay the breathing exercises to really appreciate life fabulous I would recommend it to everybody because I was up in the mountains and one doing my friend Ned, Neil and Jerry and we do a lot of Wim Hofstaff which is breathing exercises this guy runs up mountains in his pants and he controls his central nervous system where he's breathing so he goes into ice cold waters but because it's so cold the body goes into shock it's breathing through it what happens as you go wait a minute I'll adapt to it it's like anything in life you can adapt to any situation it's just try to focus on okay there's a situation here that I need to work on but okay I'm going to accept it and let's find solutions instead of finding the problems yeah well that's the thing when the you know the body going into shock and kind of fighting through it and all that that's one of the things that that's the things that Miss Brad in the despairing like you know bang you know fighting through it breath through it breath through it it's just your body going into shock aye because you were punching me go on to Edinburgh's son which is Brad Welsh I haven't met the guy who came on my podcast and we clicked straight away we had big plans to do a lot of homeless stuff in Edinburgh and Glasgow massive 100 mile an hour great guy how did your relationship with Brad come about oh I've just I've known him since he was a kid basically you know but he was like it's like when all the all the younger kind of casuals kind of came on the boss and all that I remember kind of it's only about 14 something like that I remember looking at him I was thinking who's this wee guy he's just he's really cocky you know and I remember he kind of he came up to me and he goes and I must have been about 24 or 25 or something I was living in London and he goes your name is Welsh and he goes aye he goes you live in London and he goes aye because he says you're fucking fancy yourself now this is a 14 year old wee guy and I'm like what the fuck and he goes like Leith Welshes or Southside Welshes and he goes well Leith Welshes what about you Southside who's this wee bum like you know he kind of like you know I sort of like he kind of you know I knew he was a boxer so obviously kind of fun I was interested in what he was doing and all that and he he started going out with Emma who was my friend Titch who grew up with Muirhouse's daughter and Titch was saying here is Brad Welsh he's got a bad reputation he's gone out with Emma she's my pride and joy what's going on here and I kind of said no no Brad's brilliant he's top class he's a giant and all that so we kind of it's sort of he started kind of boxing together he started going to the club and it's like he's kind of he always knew when I was back at Edinburgh because he knew everybody all the taxi drivers and all like Irvine what are you up to and he was like so we all we just always kind of sort of you know we'd fun each other every other day basically you know we'd always if anything happened this flat got burgled and he was the first person I called I'll send a joiner right around so the joiner Chris is round in a second just redoing everything up and he was always like when we were in the town he was sitting in my life like I'll get you a car I'd have a car for it to drive around and all this stuff he was just like he's such a great loss to me personally a great loss to so many people because he was so kind of fun he just took such an interest in people basically but a massive loss to the community for all the stuff he did through the help and hands and it's great that his nephew Jake's been brilliant and just kept all that going Jim Slaven's been brilliant and all the guys in the Hollywood boxing club they just want to carry on his legacy and just kept it all going like amazing because the help and hands stuff are people watching check out the Facebook pages and it's good to see people taking the reins from that and really loving his legacy because it's only fair they did that and it's great to see that he's got more backing and people are really helping out with him it's good man it's refreshing do you know what I mean because again it's the kids it's a massive loss for because it was thousands and thousands of kids with food banks helping out and the most important thing about Brad to me was like anybody that walked through the door of the club you know whether it was like say it was like kind of a woman who's just had a kid and wants to get a figure back or whether it was a a guy who was preparing for a professional amateur senior fight he just wanted everybody to be the very best possible version of himself and he didn't and he wanted to be the very best version of himself and that was his kind of whole path he was on he just kept getting better and he certainly made me a better person for being friends with him but I'm a lot better person than I would have been otherwise and it was great to see him in training spotting too yeah it was great it was like of course Brad being Brad is just telling Danny Boyle how to direct it just take a back seat and let Danny do his job because he's like let John write his script you want to write the book you want to go back in time and write the book how long did it take you to write the first book training spotting well it was working it was in a strange situation because I got sent to do an MBA at Harriet Watt University and that was so I was getting involved and sort of in the rave scene and going everywhere and Raven had started Dejan with Chris Needs and I was doing the invisible insurrection thing Kevin Williamson was putting on all that stuff in the unemployed workers centre and I kind of got involved in doing all these kind of readings and stuff with him and I was kind of doing it piecemeal I was writing these stories that would kind of become training spotting and a guy called Duncan McLean kind of a really good writer who was a friend of Kevin's and he got in touch and he's seen this kind of story that I had in this magazine and he goes if you've got any more of this because he was signed up to a big publisher in London and I said yeah, yeah I have which is a lie I'd fuck all this so I thought I'd better start doing more so I had some pressure on and he said he told me to send it to his editor basically down in London and there's a guy called Robin Robertson who's an editor then he's still my publisher so I sent it off and the manuscript off and I went away on holiday when my ex went away to Spain and when I came back there was this string of messages on the answering machine it was a posh Scottish voice that's Robin Robertson from Jonathan Cape publishing here we love the novel we really like to publish it we should talk about this and I thought this is one of my mates doing the pub taking the push basically I just ignored it and then the next one comes up it's Robin Robertson here anybody else made another offer for this and it's like then the the offers kept coming up he kept raising the money and I thought fuck it, hell I'm into this man so and then I thought it was all junk mail I noticed all these kind of circulars but they were all from the publisher so I got back in touch and it was this kind of you could feel the need in them basically it was great and they were treating me like I lived in London half my adult life but when I went down there they were kind of the London kind of literature to take me around some fucking kind of stick of the dump just came with it this is London, this is great as it gets and I was like I was playing up to it, I was playing this kind of hasty guy I fucking tried to grow up but I was keeping all that quiet and I was just just kind of allowing myself to kind of feel my way into that so fake it till you make it kind of thing I basically had made it because it was really strange because after all the failure and music, the failure the knockbacks, the humiliations and all that the first thing I've ever written gets sent to the biggest publisher in London who publish it and it instantly becomes a big seller then it gets made into a play then it gets made into an internationally kind of a claim full on then it becomes an international best seller so I mean it was just like kind of and this all happened, it was a gradual climb that happened in about two and a half three or four years and all the other books kind of that had done and the best thing I did the very best thing I did was I just kept writing I didn't stop at the train spot and I kind of had the acetows came out, then Maribu stopped nightmares and full effects to say crime, glue and all that I just kept going on and because of that I wasn't kind of bamboozled by kind of the glitz and the glam the glitz and the glam, it was bamboozled but it was kind of everybody wanting to take me out and get drunk with me if everybody wanted to shag me it was all fun it was a terrible life but I fought through it with fortitude and with dignity but that's because you found your passion you found your love there's nothing that I want to do more than that this was a thing that was really I thought this is what I'm enjoying doing, I'm writing these stories I'm enjoying the fuck out of it, I'm putting these books together I'm starting to write these screenplays I'm putting that together, I'm getting involved in film and I'm going on TV and stuff like that this was just great so everything else all the trappings of that you can do that or you can not dip into it it's not important though did you realise how big it would have been once you'd finished it, not just for yourself but for even the people who played the parts and the film, the plays how many lives it's actually changed did you realise that, did you have a gut feeling that this is going to be massive no, you think at the time if your mates will read it and probably enjoy it and maybe some people kind of in Edinburgh or read it but you don't really think of it as being it's not the book you would think about as transferable because so much of it is written in the Scottish vernacular and you think people aren't going to get this but why are people in like Australia and South Africa and kind of why are they reading it but the translations apparently really work as well it's like people say I think the characters are universal everybody knows to some extent a big bear, a spud, a sick boy, a renton and it's like people in Moscow say oh we know this big bear character we know this renton character we know a spud, don't we and so these characters are fairly universal archetypes but I think also what's kept it kind of so prominent are the themes of industrialisation and the redundancy of human beings and what do we do in the post-work world how do we adapt to it we're changing now we've gone from the medieval era into the capitalist era kind of the feudal era the capitalist era now we're into this conceptual era but we don't actually make physical goods we just manufacture ideas and they're harder to sell so there's not a commercial marketplace so we're in this kind of de-industrialising kind of kind of non-profit, non-wage era so it's like and when you think about it, every time you have a transition you have the transition from feudalism to capitalism you had a plague and we had the black death came in and that was because people were pushed together in these in sanitary conditions and now I think the new plague on drugs and not necessarily not just illegal drugs but all the big pharma and the massive prescribing of drugs for every ailment and that's because it is the last stand I mean it's like kind of it's like the impact on neoliberalism and housing and education and now it's kind of happening in health and we'll keep you alive until you're 100 or 150 but you'll be fucking miserable for half these years and you'll be dependent on these products so we have to keep you going like these pills so it's a that kind of that kind of creation of not a market because markets are supposed to be competitive but a captive audience that you're feeding this kind of product to and that's the new plague it's like a psychic plague we're not kind of crushed together in these in sanitary conditions but now we're kind of we're overloaded with information and disinformation and we have to sift through that and it's psychically it's just too much for people basically a lot of people's minds are breaking down suicides on the rise as well social media is not far behind it social media is playing a big part in people's lives or living a great life anybody can promote a great life on social media everybody does, I mean I do it myself on Instagram it's like it's amazing everyone's got their own discipline I mean I'm a total cunt on Twitter I mean it's the bastard to everybody I mean it's like fuck you fuck this cunt fuck that because it's just nasty fleeting thoughts that you fire out like whereas on Instagram it's like oh look at me I'm having fun man obviously it can be a bastard but he can utilise that to your advantage see when you're picking the characters for transport and did you have a say in the actors well we talked about the casting of it and Danny was really keen on Ewan McGregor cos he worked with him on Shallow Grave and it was fabulous and he was also keen on Christopher Eccleston was on Shallow Grave to play Begby cos Christopher Eccleston was a really big guy he was a fantastic actor Christopher Eccleston so it would have been interesting casting but they went with Bobby who was like the wee guy basically and it's like the kind of there's something horrible about you know it's sort of like a big hard bastard you know you think fuck me I'm going to get a kicking for this big hard cunt but a wee hard bastard you think fuck me I'm going to get a kicking for this wee hard bastard and even if I give this guy a fucking kicking there's no glory in it you're just picked on this little cunt so you think fuck I've lost before I even start so it's like but there's something in Sendery about the crazy wee guy basically so Bobby really inhabits that kind of space and he made Begby a completely different character to how I envisaged him in the book I saw him as being a much bigger physical presence and and Ewan was in the play the train spot in play Ewan Bremner was in the train spot in play and I really liked Ewan as an actor so I kind of put him in Susan Viddler who was in the train spot in play because I'd seen them both in that that Mike Lee film Naked they were the two kind of young kind of Edinburgh street urchins lost in London who were having this big argument with each other on the street and walking past I thought fuck me I'm actually hearing two Edinburgh kids because it's usually a Glasgow accent when you see kids playing these kind of characters God it's two Edinburgh I wonder who these guys are they'd be brilliant for this play so we've got in touch with them we've got them cast for the play and Danny really liked them so he had them in the movie and Johnny Lee Miller I didn't know anything about Johnny but at that time he was probably kind of the most Hollywood at them all like he was kind of the most successful and um Is that about what he was married to he was the hardest he used to be married to Brad Pitt Angelina Jolie, yeah he was married to Angelina Jolie for a while like yeah How does that make you feel as well to creating these A-list stars already to have their talent anyway but for that big break is the relationship still great with you as the cast it's funny because when we got together a few years ago to do Transpot in 2 it was interesting that we kind of um we'd all kind of not collectively but individually we'd all maintained relationships and friendships and you know some more than others obviously but you kind of do if you run into people if you're going out to LA to my managers and to my agents you just keep running into them you run into them in the offices in CAA you run into them in certain kind of like so house and bars and stuff like that and you're just into that little you know that world is just there and it goes on you know but it's like and you have a laugh and you go out and have a few drinks and everybody knows that it's not the real world that they live in it's just this little bubble that we meet in basically How did your relationship with Danny Boyle come about Well what happened was that Danny, Andrew and John were kind of they were very close when they did Shallow Grave it was like John's screenwriter Andrew the producer and Danny the director and Danny had got in touch and he goes like I really want you to see Shallow Grave because I think that with your characters and the energy in Shallow Grave it would be a perfect kind of mix I saw Shallow Grave and I thought fucking hell this is perfect this would be great this fucking Newtown Ponces of which I'm the one actually ironically here we are in the fucking Newtown but get rid of these Newtown Ponces and get some fucking real punters for the schemes involved get some lethers into the mix and you know that would be and with that energy that would be just perfect the perfect balance for you know and so that was how it kind of so he sent me a copy of the the film I think it was out he just sent me a copy of it I should have pirate it so he goes like he said he said I'm I really like Shallow Grave and all that and he goes well my guy will be in touch and we can see if we can do some business and I had no agent at the time but I was just this naive part basically and everybody used to say to me like first minute to Hollywood and who's your agent who's reffrin you know we're one of your right first no it's just me there's a fucking village in Scotland missing an idiot it's not how we do things here so but anyway I was living in Amsterdam and it's like Danny has said we're ready to do the deal and this guy gets in touch with me and he goes like I really want to buy the rights to train spotting and I was well how much are we talking he gave me this sum and it was a lot more than Danny had mentioned but I thought this guy was Danny's producer because Danny said my producer will be in touch like and so he gave me this guy made the software and I thought this is fucking great and he said the guy actually said that Danny Boyle would be fantastic for this he said yeah brilliant he'll knock it out of the park so it was like a misunderstanding so I stole the rights to the wrong guy basically I didn't sell the rights to Andrew Danny's guy and Danny sent me this really hurt note and he's going like what the fuck I thought we had an understanding me and Andrew and John just work together we're indivisible you've got to take and I said well it's fine I sold it to the wrong guy oh fuck but he also said it's funny three times the money we were going to offer that's good for me but I can't direct it that's not so good without Andrew being involved producer and John screenwriting so what I did was what they did is they got in touch with the guy who bought the rights and fair play to the guy who sold it back to them for the same price but they had to pay more they had to pay me more and they would have paid that so it was great so you won both ways you'll know his daff you'll know his daff sometimes something's that stumbling naively through the minefield means that you can miss all the mines basically if you don't know where they actually are it's when you're aware of where they are once it gets released you're rubbing shoulders with all the A-listers so the temptation wasn't there to slip back into old habits because you'd focus more on the writing yeah I got right into the writing and I was like by that time I was starting to map out different books and different ideas and deadlines I was dipping my toe and all that stuff and we were going to Cannes and showing the movie and we were going out to LA and talking to studios and stuff like that working for them and all this kind of stuff but to me I just wanted to get back to what was really into doing which was the writing which was knocking out more books it was important for me to keep that engine and keep that focus going and it was funny it was like James Kilman who was a fantastic Glasgow writer and he had won the Booker Prize and I was talking to him and he said when all this bullshit starts what you do is just get on with your work and it was the best advice but it was what I was actually feeling myself and that's what he does and that's what all people that in anything do you can't even bask in praise it's not anything to do with you in a sense you've created something people appreciate and they want to be a part of it let them get on with it and go on to the next thing the next thing might not be as commercially successful it might not hit that kind of zeitgeist in the same way as the last thing but it's not really what you want some of my most most satisfying books I've done have been least commercially successful so it's like it's like when I wrote Filth for example that was like it was a difficult book to write because the protagonist was very difficult but when that actually got filmed seeing James McAvoy who's kind of he's just an amazing actor he's one of the best actors in the world just now I think he's certainly when you see him and you could argue that if you look at all the films that he's done you could argue that's maybe James' career best film I think the one he played the split personality fucking phenomenal part when I saw this when I saw the rushes from that film that John Burt had done and John was showing me the rush and he said watch this scene here and that's the scene where he's like kind of he's watching this video his wife and kids and he starts making an abuse of phone call to his best mate's wife and he starts wanking off at the same time and he's looking at that and he starts crying when he says that you know and I think if you watch the emotional transitions in that scene you think how the fuck does he do that that was a mind fuck that film but when you see him just doing that scene all of life is in that one scene how the fuck does he do that does he make these transitions so effortlessly but so completely real you know and I'm like fucking hell man that's acting I think he's a great actor he's up there one of the best now so when you obviously created Trainspot on it it's global success what made you even think about writing a second one because that can really go Pete Tong but it was an accident again when I wrote Porno it was like Porno was like I didn't intend to make it about these characters but it was like the sick boy character had a different name it was about this guy and this woman and about their relationship basically and I realised this character is just sick boy everybody's going to see that his sick boy is exactly the same character and they crashed into this book so I thought well I've told his story so I've got to tell the rest of the gang story again I've got to find a way to get them back into this so it was like it was an interesting book to write because sick boy was the main character in it and Big Bay and Spud are just they do what they do basically but Renton was the one that I couldn't find and it took me a while to get back into thinking about Renton again I kind of lost that character but I went into when I wrote Dead Men's Trousers I thought I'm going to focus on Renton and try and find out what he's all about what's been happening to him more so yeah so it was it was an interesting kind of it's an interesting thing to see these books together and see where they're all can you shout yourself to like that yeah I was but you shout yourself to everything you know and the book I'm writing now is just a completely different thing but you know you shout yourself again you think to yourself if you're not shouting yourself you're not doing your job like you know if you're so complacent about it you know you've got to have this thing like when you finish a book you've got to think to yourself fuck what's my mother going to do you have to have that feeling and it's a horrible feeling but it's also comforting as well if you don't have that feeling you know it's going to be crap you know you've got to kind of get that kind of have that reaction from yourself you've got to have that fear of complete social humiliation and embarrassment and all that I think it's um that's actually a very good thing to kind of try and fight through I think it's good for you psychologically I think so because life begins at the end of the comfort zone as cheesy as it is it's through I think that's where growth is and obviously because I train sport it was massive global success it still gets spoke about 20 or years later so for you to do the second one there must have been a lot of pressure on you have you ever felt the first time around yeah I mean um you know it's funny again it's like I don't actually feel the pressure about you know the business and the commerce side of it you know I almost feel that I've written the book I've done the best I can whether people like it or they don't like it or they're indifferent to it's kind of out of my hands now I've given it my best shot you know so over to you guys it's not minds anymore basically how was the when you approached the cast for it for the second time did they just all agree straight away yeah I mean it's like we had a very tight window basically you know so it was like that had been the problem of trying to get everybody back you know it was like so fun because you've got to have not just the four main guys but you know some of the other people involved in the cast as well but also the everybody's availability to be together and you've got to everybody has their own different projects they're working on so to get all these different people is maybe about kind of maybe about 20 or 30 people above and below the line they all need to be together again you know so it's difficult to do that so going forward for the future with yourself are there possible trains spotting free fill them wise I don't know I mean I don't think so I mean it's like can you think you know you think about the Godfather 3 the Terminator 3 you know it's like kind of it's a temptation to do the you know the Holy Trinity and I'm hoping that that kind of it might evoke Danny's inner Catholic about you know trying to do the Holy Trinity but I'm not sure I think and you know it's like it took us long enough to work up the bottle to do two I mean they'll all be in the rest of them by the time we work up the bottle to do three so we'd have to get moving on it pretty quickly and I think that um yeah I don't know I mean it's something that I mean it would be massively interesting to me but I mean the one that I would like to do would be that kind of bag based stand alone the blade artist there's just a short little you know a kind of 90 minute film with Robert Carlisle going nuts kind of I think that would be fucking just hearing through the streets of Edinburgh fucking with a machete basically so for the future then which are plans then well we've got just short creation stories the kind of McGee biopic so we're getting that done I did this big novel that was kind of very ambitious and it probably wasn't working as a novel but I've sold it as a TV show in America so I'll be working on the development of that working on doing some kind of being working on scripts for two of my novels for television and I'm working on another novel now so I'm kind of firing on that yeah that's a good thing so yeah you've got to kind of keep going as we've said the busier the better sorry just before we finish up because I know you play parts yourself in some of your films which is a good thing I would be doing the fucking same but for the trainspot in two you've got the boys from the Alton Athletic in yeah I mean they were in Trainspot in one as well they're just inspirational guys and Davey Bryce is another great character that's kind of slowly slowly missing Glasgow and Davey is just an incendiary force basically like you know but these guys are brilliant and they really they've backed us up all the way and they've just been an incredible part of the project and I think it's great that you give guys like this a chance to work with people who are A-listers to yeah and Davey Bryce what he's done for Calton for people with addictions all around Glasgow and Scotland it's been phenomenal and yeah I know he's sun it's like why don't they give people like Davey Bryce Knight who is instead of paying files and fraudsters basically so that's just phenomenal what they've done and I think that's amazing that you give people a chance in getting to see and work with people it gives people hope and inspiration and coming on today mate and telling your story it's been absolutely phenomenal it's been a pleasure buddy an inspiration for what you've achieved and what you've done it's amazing and people take a lot of inspiration for that so thanks a lot it's been an absolute pleasure cheers buddy