So my name is Brad Urani, I work at Procore. This is a talk about Object Relational Mappers, ORMs, specifically comparing, contrasting Ecto and Active Record. Ecto is an ORM for Phoenix, which is a web framework for Elixir. So Elixir is pretty a relatively new programming language that was created by this guy, Jose Valem. He was a longtime core member of Rails. He kind of split off and started his own programming language. It's a really neat language. It's very, very, very fast. It's a functional language. It's got kind of a rubiesque syntax, and it's designed for very, very high concurrency. It does that very, very well. And Elixir actually compiles to Erlang byte code. So Erlang was this language. It's made for massively scalable, soft, real-time systems for requirements on high availability. Erlang was invented by this guy, Joe Armstrong, way back in the 80s for telephone systems. So this year, he was working at Ericsson at the time. He wrote software for this telephone switch, which ran a million lines of Erlang with nine nines of availability. So this is the kind of thing. So if you wanted to design a phone system, for instance, to serve the entire continent of Europe, you figured out how to do that with this incredible technology. It's really sort of amazing. It was invented way back in the 80s, but it kind of fell out of popularity when the internet sort of came around in the 90s, and we didn't need that kind of high concurrency, real-time systems, and Perl and Java kind of became the de facto languages of the internet. Erlang kind of was forgotten about a little bit, but it's sort of made a comeback recently as people have realized that there are use cases for that kind of stuff on the internet. And what's really, really neat about it is if you have a bunch of servers running Elixir or Erlang, you can run thousands of processes concurrently, and they can all communicate with each other, and they can communicate across machines. So these little green boxes symbolize processes, right? So imagine this is telecom technology. So imagine you're routing thousands and thousands of phone calls in real-time, and you have this server deployment. They kind of automatically cluster and give you these real-time distributed systems, which is neat.  It's this incredibly fast, neat technology with this like really difficult kind of weird syntax that's not very user-friendly. So along came Jose, and he created Elixir, which is basically runs on Erlang, but with like sort of a Ruby-esque kind of syntax that's real nice and pretty. Really the similarity with Ruby is kind of only skin-deep. It's a functional language, so it's really different how you use it. But if you're used to Ruby, Elixir will look kind of familiar to you. So now it's sort of like a pretty Ferrari, right? So these guys sort of combined, and now they've got this car that's not only fast, but beautiful to look at. And then Phoenix is this MVC framework built with Elixir, a productive web framework that does not compromise speed and maintainability made by this guy, Chris McCord, and it has a lot in common with Rails. So it's MVC, it's got the routes, and the generators you're used to. It's got this package manager called Hex, which kind of takes the best of both Gem and Bundler. It's got this thing called Mix, which is like Rake, and it has an ORM called Ecto, which is what I'm talking about today, which has similar features set to active record queries and migrations and validations. So a lot of people say Phoenix is like, it's sort of like the next evolution of what Rails should be, you know? We'll see that that metaphor holds partially, but not entirely. And it is fast, like I said. So often an order of magnitude faster than Ruby and Rails. D.H.A. says, man, I wish Rails was that fast. He's a race car driver, too. To be fair, it's not really Rails that's low, it's more Ruby that's low, so it's not really his fault, but Elixir or Phoenix are very fast. What would you do with that? Like a real-time communication system would be a good example. And what's kind of interesting is if you build, for instance, a mobile app like this, and you've got Elixir with all these processes and this sort of automatic clustering or whatever, when you send a message from one phone to the other, the message goes server to server. And that's kind of built into the Erlang VM. Contrast that with, for instance, ActionCable, which is this new feature in Rails 5, what happens is the server first gets written to Redis, which has this PubSub, which goes so-called server to Redis and back to server again. That's not what happens in Elixir, it's the server's cluster and the real-time messages go between the servers. So it's a fundamentally different model, a fundamentally faster model. But why stop at simple text messages, right? So using this kind of technology, you could build, for instance, a video chat system, like a video conferencing system you could do an MMORPG real easy for real-time data. The one I have pictured there, that's League of Legends, which is or maybe was the most popular game in the world, it predates Elixir, that their back-end systems are actually written in Erlang. And you can do this real easy, because remember, this is an NBC web framework built on top of telecom technology. So it's like Rails with this more powerful subsystem. But actually, that kind of stuff isn't really what I'm talking about today. I'm talking about ORMs, I really don't have much experience building those real-time systems. So I'm talking about a different part of Phoenix, the design of the object relational mapper, and comparing and contrasting that to active record. This is my own personal journey of ORMs throughout the years. These are the ones that I've developed against. These are a lot of Java and C-sharp ORMs. I landed on active record relatively recently, and Ecto even sooner than that. And actually really looking at this list, the one that stands out is sort of like the one that's different to kind of odd duck is really kind of active record. It has a pretty unique design. But before I get to ORMs, I need to talk really quickly about functional programming. As I said, Elixir is a functional language. I describe it as a stylo program that avoids state and mutable data. I realize that it's not. That doesn't mean like a whole lot, right? And I don't have time to get into a full description of exactly what functional programming is. But if you're coming from Ruby, probably the things that will surprise you most are that Elixir has no objects, right? So like Ruby has modules and classes. Elixir only has modules, which also means there are no methods, right? It has functions that you can call, but it doesn't have that like sort of like methods and objects like in methods and data, like in the same class, that encapsulation. It's not object-oriented. It's functional and no mutations. So that means like in Ruby, you can have like a hash and you could change one of the values. You can't do that in Elixir. If you have like a kind of a hash, it would be a struct, but if you have a struct and you kind of change one, you change a value, you get back a new struct every time you do that operation. And if you have a reference to the old one, it's still there. It uses a mutable persistent data structures. So it's fundamentally different under the hood the way it works, which means you have to write it in a different way, even though the syntax is similar. But let me jump first into Active Record before I get to Acto.  So it's a bit rehashing, but I think it's important to sort of start at the basics here just so that when we get to Acto, it's a conversation not just about how and how you do things different, but why. Like what is the philosophy behind these designs? How do the like top level architectural designs of Active Record and Acto differ really? So I made a little demo app. It's called Hallway Track. As you can see, in addition to being an engineer, I'm also a graphic designer. But the joke is that so you go to a conference right and they have multiple tracks, like they may have the database track, the front end track, the Ruby track. The hallway track is kind of a joke. That's like the people you meet in the halls. So like, hey, what's your favorite part of the conference? Oh, it was the hallway track. So this little app is like, so people can like sort of self organize in the hallways and get together with like what they're interested in. So you set up like a little meeting and it shows like here are the people who are going to the Phoenix Fanatic one. It's meeting in the lunch room at three o'clock there. So what we've got here is we've got a conference, right? Which is RailsConf, which has a party, which is like Phoenix Fanatics, which has users. So my database looks like this. Conference has many parties, which has many users. So like we start up setting up active records. So here's our party class. We have a scope for conference. We've got a scope for starting after. We've got a scope for ending after. So each of those are like little reusable bits of queries, right? That's kind of what a scope is. It's kind of a reusable bit of a query. So then I might combine those together into the scope for conference and time. And I'm changing these together. So here is one of ActiveRecord's strong suits. It's one of these really nice kind of English style syntax. For conference.startingafter.endingbefore. It reads real nicely. That's sort of a nice feature for readability and stuff. ActiveRecord, it looks nice. Donna, I've got HasMany users and I've got this scope for active users. And then on the user I've got this active scope. So there's another little bit. And now I call this the controller for conference and time. So standard Ruby stuff here, standard Rails. And then in my view I do this, parties.each. And for each party I do parties.activeusers. And I display that list of parties and I display the users for each one. And kaboom! Oh, what happened? Oh man, that does not look right, does it? So this is the n plus one problem. If you've done enough ActiveRecord you've probably run into this. And the reason it does that is because, well, I start with these parties and for each one I'm calling .activeusers and what is that? That's an ActiveRecord relation, right? We all know that if we use ActiveRecord. It's an ActiveRecord relation and that thing has not been preloaded so it's running a query each time it does that. So how do you fix that? Well, okay, in my scope for parties, topic and time I have to add this preload in there. That is kind of, all of a sudden my English looking my scopes, I've kind of added this like only kind of preload thing in, right? So it's kind of polluted my nice English looking syntax with something a little more computer-y. I could move it, I guess. I could take it out of the model and put it in the controller but realize here what I've done is I had a parties model, right? I had a scope Active on users and now I've got this preload here on controller. I've got my query spread out across three files, don't I? It's only one SQL query but it's spread out across three files. Now this does look pretty nice but that's a little, that can be tough to track if you're like looking for these queries in places. It's a trade-off. It's a trade-off in, it's hard to find the SQL in here but it reads nice and reads like English and it's very convenient. It's very fast, easy rapid to develop. I get the queries I want which is good but what happened here, right? From like sort of a higher level why did this happen? ORMs are kind of this leaky abstraction. So if like SQL's a dog, right? I want to treat a dog nicely. I want to like treat and feed a dog food, take it outside, right?  You have to know it's there and you kind of have to know SQL and you kind of have to do both so you can't just use active record naively, right? You have to remember that there's a dog under that cat and that's called a leaky abstraction, that's the term of that because you can't just use the abstraction without also understanding how it works which is why our active record are nice like English-looking syntax starts to kind of, starts to kind of get a little uglier when we try to make the SQL right, you know? So concerning object-oriented programming, Joe Armstrong said about objects, you wanted a banana but you got a gorilla holding the banana so we're running this query right and we're getting data, data's the banana. What we got is this active record model which is an object and it's got all this like behavior mixed in. That's kind of the gorilla, you know? And that can be difficult to reason about sometimes when you start passing these models all around, all over the place and you've lost track of the queries and you've got this thing that's a gorilla holding a banana and you really want the banana and you end up calling the gorilla, you know? So it's interesting. So as I said, we got the queries here. You could use a join instead and make it into one query but there's another performance problem associated with that. We fixed our M plus one, didn't we? But I think there's still a performance problem here and that is, in my opinion, well, the select star because, you know, normally in these tables we've got a lot of stuff on these tables including our time stamps, for instance, which I'm not even displaying on the page but I'm pulling them back anyway, aren't I? Even I'm pulling back a lot of stuff that I don't need and active record kind of encourages this. I call this problem seeing stars, right? Seeing stars is this indiscriminate use of ORMs that's where it's always select star and we can fix this, you know, by adding a dot select but then you've got that ugly active record stuff with like the strings because we have to alias our tables and all that stuff. It's easy to fix but it's also easy to forget about, you know what I mean? It's a pretty common problem I've seen in a lot of big Rails products is just select star everywhere because people don't take the time to do selects and if you realize also, part of those scopes are supposed to be reusable, aren't they? But once you start reusing scopes, each scope, each time you reuse it, each time you reuse it, might have different columns selected so you're reusing a scope from one model but you're tacking on different select statements and other parts and that all of a sudden also becomes real, hard to keep track of like what's querying what because we've got a query spread out across so many files. So just to sum it up, like sort of the Rails active record philosophy here is that it kind of favors English over SQL, right? We have extracted away the SQL which is good for readability, good English, Rails active record reads really beautifully. We've got objects, not data, we've got gorillas with bananas, domain models over relational models. So domain model, like it just means like we've got a class that represents something in life. So I had a party table, like a party is a real thing, a user is a real thing, a conference is a real thing and our classes match those. Our classes match like real world entities, things that we actually have to think about in real life versus a relational model which is tables, which is specific to database, which is a more computer oriented thing, less of a real world thing. Rails is big on productivity. If you've been in the Rails community long enough, you've heard about the 15 minute blog, right? It allows you to develop things really, really, really fast, which is if that's what you need, then that's a great feature, it's awesome. It's tough on scalability because it's so easy to do those N plus ones and forget because it's so easy to forget about the select. There are a few other performance related things that I'll talk about later. I kind of do favors developers over DevOps. Why do I say that? Well, because a lot of times like your DevOps or your DBAs are looking at the query log and like, oh wow, look at last night, this was the slowest query that ran.  Where's that query? And the developers are like, oh well, let's split across 12 scopes over four different models. Kind of all chained together, you know? It makes it hard if you just want to find the slow query, right? Find that query. It's kind of tough to track it down sometimes. And SQL and Rails are they really friends? I don't know, they're kind of frenemies for that reason, I think, just because it is hard to think in SQL and also think in Rails, you know? So this is what I see at scale when you get huge ActiveRecord applications with a lot of people using amazing plus ones, the seeing stars problem, app level constraints. Those are things like unique constraints in the model which is this weird kind of anti-feature, I think, that it's not safe against race conditions. Transaction management, I see, you know, the way in ActiveRecord you can just like take a model and like dot save kind of everywhere you want. You know, it seems like people forget transactions a lot. It's lazy, right?  You can pass it all the way to the view before you start looping through it before it actually runs the query. So it's hard to keep track of where the actual query is run. We're Java champion forcefully protecting programs from the cells. Ruby included a hanging rope in the welcome kit. This is DHH. And that's kind of true in Rails of ActiveRecord too. It allows you to get things done fast. But to its credit, great English-like readable DSLs. It's conceptually simple. It's comfortable for beginners. You know, it's kind of, if you're not really used to SQL, it's really easy to get started.  And overall, I'd say ActiveRecord, this is my opinion kind of, but convenience over explicitness and performance. So it's real fast and easy and convenient to create, to kind of chain these scopes together. But that explicitness that like, here's what's actually happening. Here's that SQL that's running is lost a little bit. And it's easy to make performance mistakes. Explicitness, by the way, ding, ding, ding, that's our word of the day. I'm going to be saying this a lot today. So look out for this word. So let's move on to Ecto now. So Phoenix is not Rails, as Chris record. And Leah Chalade says, Rails or Phoenix or Web Perks to share a common goal. So they are and they aren't the same thing. They're very, very similar. If you do like, if you're doing like sort of like a crud app kind of thing, they are very, very similar. But then Ecto has, or Phoenix has this like superpower of real time communication. So if you're doing that, then they're very different, of course. But the way that Ecto works is it's a lot, it's a little different. So there's not just a simple model. There's a model file, but there's not a model class. It actually has four things. A repo, a schema, a change set, and a query. So already it's conceptually a little more. There's more to think of, right? So here, for instance, is the first thing is the schema, right? So in the model file for party, it's got a model file, but not a model class. So first of all, you have to define the schema. We know that in active record, you don't define the, you don't pre-define the fields, right? It's all dynamic. In Ecto, you actually have to define them. But you can see it's got has many and belongs to in the same kind of way, but it's explicit, right? So there's that word, explicit, because we're telling Ecto what fields we have, which allows us to do some, it turns out to be convenient. It's a little more boilerplate, but it turns out to be convenient. Here's our controller. So that first line is kind of weird. So for our index action, the connection, that has the request and response and stuff. It's passed in, it's not global, right? There again is that expliciteness. That little funky thing with the brackets in the first line there. That's like a, it's a pattern matching. It's kind of destructuring, getting the conference ID out of the request hash. And then we have repo.all. So repo is this module that represents our database, and we're passing party.forConference, which is what gets our query. So it's kind of two pieces. So we've got a repo that represents our database, and then we're party.forConference returns the query, and so then they get run, and then we're explicitly calling index.html and passing it the parties. So it looks kind of like Rails, but a little more explicit. And we've got kind of two parts to our query instead of one. We've got a repo, and we've got this for conference, which returns a query. If you're big on like design patterns and stuff like this, this is called the repository pattern. It's Martin Fowler to find this in his, one of these, in his book here. Versus the active record pattern, an object that wraps a row in a database table or view. So active record pattern, like the original definition, kind of describes like the instance methods on active record, but active record, the Rails thing, is actually sort of like a melange of like, like the class methods are more like repository, where the instance methods are more like active record, and they're hints of datamapper, and other things mixed in there. So well, active record is sort of this like meta pattern that's kind of grown over time to encompass more and more. The patterns in Ecto are a little more finite. I actually was lucky enough to be on the RubyRogues podcast, and Avdi Grimm was on there, and we were talking about this, and someone said, hey, will someone define active record in repository? And I went and defined him, and I got it totally wrong. He was like, actually, Brad, that's the opposite of what they mean. So this is, so if Avdi's in here, this is for you, I wanted to show you that I got this right. But what's also interesting about Phoenix is that, well, it has no save method, and so you can't just like query something, change a field, and hit save, and like save it back. I'm gonna get to writing in a second, but, and it doesn't return objects, it returns structs. So it's returning bananas, not gorillas. It's just returning data in this sort of struct that you throw around that doesn't have methods hanging off of it, and then it's immutable. Those structs come back, they're immutable. You can't change them. Once they're there, they're there, which means you have to design your programs a lot differently. Interestingly, it returns structs, not objects, which means it's not an object relational map, or I'm a little bit embarrassed to say I didn't quite figure that out until after I had proposed this talk. The title is a tale of two ROMs. One's not actually an R.M., whoops. But that's okay. They serve the same function. Okay, so here in the model, I need to put together a query, right? So here's my query for conference. I pass in a conference ID, and I've got this cool syntax from party and party, so I'm getting a little alias there, where party.conference ID, and then also check out the select. Select party.name, party.startTime, party.nTime. What's kind of cool is if you get in your mind, well, for one thing, this really looks like SQL, doesn't it? The select's on the bottom instead of the top, but it looks really SQL-esque, doesn't it? It's almost like SQL written in Elixir, which is kind of cool. And then also the select syntax is really nice, much prettier than the Rails one, and if you get in the habit of always putting that in like you're writing a query, you're not going to forget it as easily and have the seeing stars problem, are you? If we want to preload users, we can, just like that. It's still pretty SQL-esque looking. If we want to group by, I thought this was kind of cool. We have that group by. Oh, that should be user ID, sorry. But then select party.id and count of user.id. I thought that was kind of cool, real SQL-looking. Maps real nice. Does anyone know where they got this syntax from, actually this idea of this kind of like SQL-looking syntax inside the code? It actually came from csharp.net, .net MVC. It's a rare case of like an open source world taking a cool idea from Microsoft, right, instead of the other way around, instead of vice versa. Yeah, it feels like, yeah. Yeah, nice dance moves, Bill. Where'd you learn that? Yeah, we're still mad about 86, you know.  Now, you can write this in a way that kind of composes them and reuses them, but it's not very dry, because they all three have the same wear condition. In an active record, you would make a scope and you'd reuse it, it'd be more dry. Here we're repeating more stuff, and this is a little bit more of my own opinion than something forced on you by ECTO, but there is some merit to that, right, because it's real easy to track down those queries. It's real easy to find them when you look in your query log, and oh, here's the one that locked to this table last night. It's real easy to go back and look at them. It's real easy to imagine this, to go from ECTO back to SQL and back again without sort of getting lost in all these model chaining, all these scopes together. If I ran this in the, Phoenix has a console like Rails, so if I run this in the Phoenix console, I get parties, I get all the parties, right, and then I get the first one, notice list.first of parties, that's where functions, not methods, right? It's not parties.first, it's list.first.parties, it's a function, and I do first party.users. I get this association not loaded. In active record, this would be an active record relation, and it would actually load it, wouldn't it? It would actually run another query you can't do that in ECTO, you can't do it, that's a null object that, for one thing, this is immutable, so it can't just load the new stuff in, it can't run another query and load stuff into that object because it's an immutable object anyway, but this solves the N plus one problem, you cannot do it, it's impossible to write an N plus one in ECTO. Now that means you have to sort of go back to the model error and think ahead and write your preload back down there, but you know, which is a little more boilerplate and a little less dry, but that might be a good thing. It's eager too, it's not lazy, so all the querying is actually done in the model error, there's not that sort of laziness where you're passing this active record thing all the way up to the view, or God forbid, the view helper, and then running it in a loop and then firing off a query. I've seen big Rails projects where it's like, okay, I'm gonna look at the query as this request runs, oh my gosh, there's one in the model, one in the controller, one in the view, and one in the helper, oh boy.  So now on to writing, right? When you write, whether that's an update or an insert, we've got these things in Ecto called change sets. So here's a change set like for creating a new users, right? I know that I define this change set, I'm gonna, it's gonna take the name, the email address, and the age. Cool, so that might be like your form that, you know, your signup form, for instance. Okay, and this is what it looks like, that funky little arrow thingy that's called a pipeline operator, it's kind of like a Linux pipe, it's an Elixir thing, but look closely at this. First of all, there's actually explicitly casting, right? Rails automatically casts, Ecto explicitly casts, and it's got required and optional params. We explicitly do the validations right here on this method, and then we tell Ecto that there's a unique constraint on email. So that's one change set for your signup form. If we want one for like update, say you just update someone's email, we have to make another change set, we don't share the change set. So the top one is an insert operation, the second one is an update operation, two completely separate change sets. So contrast that, for instance, with an active model, an active record model, you know, you can kind of just like freeform it, like set a property and hit.save or set a couple properties and hit.save. You know, you can't do that here, it's like you have to explicitly define each write operation. This one's an update and it looks like this, it has these validations, this one's an insert, it looks like this, it has these validations, which is more explicit. There's that word again, right? Ding, ding, ding, explicit. And also you can allow these to have separate validations, so you don't end up with a lot of like convoluted if statements on your validations and stuff. A little more boilerplate to set all this up, a little more work, but increased explicitness, increased flexibility in having multiple different sets of validations and things like that. So definitely a different approach.  So here we've got three, I've got a topic insert, a party insert, an update conference, and then you kind of wrap these in this transaction and you can get the, you can pattern match on the result, okay, or error, and handle the result as a whole, right? This is kind of cool because if you get in the habit of using these, so like every time I have a post, I'm gonna do my writes in a multi, then you never forget to wrap that in that transaction. Very common mistake I see in big Rails apps is the saves are kind of scattered all over the place and it's real hard to sort of wrap them all in one transaction or people just forget to wrap them in a transaction. This kind of helps you with that, and it's a little cleaner too, in Rails you'd have to do like, if topic.save and party.save and conference.save, here you just kind of create this multi and you save it and you get either an okay or an error. So you're thinking transactions now, instead of models and domain models, right? You're thinking in terms of, this is a single database transaction. So yeah, separate validations, a little more explicit, better security also, we don't have to deal with, we don't have to worry about the problem of strong params. There's less text passing around, so less opportunity for SQL injection because it's got a better query syntax really. And again, explicitness. Functional programming is about making the complex part of your program explicit. In most web apps, the complex part is a lot of this database querying and how you're sort of translating from that user input and shaping the data and getting it into the program or how you're taking that relational data, querying it, mixing and matching, turning it around, reshaping it and passing it out to the view. So Elixir makes that a little more explicit, a little easier to track down to figure what's going on, like at a slightly lower level at not as high of an abstraction level. So also, if you're big into big terms, Ecto follows the command query responsibility segregation principle, which is that read and update use two different models, and we saw that. The queries I had had joins in them, right? But the updates have these explicit change sets. It's not like one model for reading and writing. It's a separate thing, a query for reading and a change set for writing. So that's conceptually interesting, but there's also kind of like, right at the database level, kind of a real compelling reason to do that, think about a query, you know, in anything non-trivial, a query is going to have joins. A query, most queries like in any, in big complex apps have a lot of joins, and when you get that, you get back a certain set of columns that does not match what's actually on the table. You're getting back columns from multiple tables. So your queries have a certain set of columns based on what joins they have, but your writes don't have joins, do they? The writes always write only to a single table at a time, an insert. An insert only inserts into a single table. An update only updates a single table, but your reads read from multiple tables, yet, for instance, in Rails, they're sharing the same model. The fact, even though they're pulling back different data, different sets of properties, they're sharing the same model, we have that responsibility segregation here in Ecto, so they read an update using totally different paradigms, totally different sets of columns, totally different, well, you know what I'm trying to say. So, just to kind of like sum up, Rails has objects, Phoenix has data, right? It's gorillas of bananas versus bananas. Rails has methods, whereas Phoenix has functions, and then Rails stuff is mutable. You can pull back an object, change a property, pass it around, do whatever you want with it. Phoenix is immutable, once you query that data, you've got that struct, it doesn't change. On the SQL level, or I guess at the ORM level, Phoenix or Ecto, right? It favors SQL style syntax over English style syntax. It looks more like SQL, it feels more like a relational database. Overseeing stars, I won't say it solves that problem, it definitely doesn't, but I feel like with that kind of cool select syntax, and the way it kind of looks like SQL, you have that query, I feel like it makes it a little easier to remember, not to just indiscriminately select star every time, which, if you're not at scale, it may not matter, but at big scale, when you've got dozens of web servers firing on a single database server, the database server becomes your bottleneck, and those select stars are a performance killer. Rails is lazy, Ecto is eager, all those queries kind of fire when you'd expect them to.  Rails is dispersed, the query gets spread around across scopes, across multiple files, where in Ecto it's more confined. It's all in that model layer. So what's the downside of this? Well, it is more boilerplate, we have to set up all those change sets, we have to define our schema, we have to create those multis and stuff. There's more typing involved. You know, you're gonna end up with more code to kind of set that stuff up. It's a little bit more complex of a mental model because in the world of ActiveRecord, we've got domain models, oh, I've got a user, that's a real life thing, I've got a user class, an ICE connection there to think about where is, this is more complex, that command query responsibility segregation means I've got to think about this differently when I read than I do when I write. It's less dry, we've got more repeated code because we're reusing it less. A little less readable, oh, that depends what you're used to. If you want code that looks like English, if that's what you're used to and that's how you like to code, then it probably will be less readable. If you're used to SQL and writing queries, then you may have the opposite experience. It may be a little more readable. It's kind of like robot talk, instead of users and conferences, we've got change sets and schemas and queries. But that might be more natural if you're used to talking in computer terms. I like talking in SQL, for instance, my wife's like, Brad, will you do the dishes? I'm like select dishes from sync, insert into dishwashers. She's like, what are you saying, Brad? I'm like, oh, sorry, sweetie, I was talking SQL. She's like, you are so weird. But then, right, so we get, I guess the trade-off here is sort of the opposite. We've got like, it's explicitness, there's that word, right? It's explicit what we're doing. Performance, there are, I won't say it's better performance, I'm saying there are few caveats, right? Fewer pitfalls that you can fall into. You still have to be mindful, of course, but there are fewer pitfalls you can fall into for performance, you can't do M plus ones, you know? Over-convenience, it's not quite as fast to develop. I wouldn't want to do the 15-minute blog in Phoenix, but you know, I bet you could do it at 30, you know? So it's just a different set of trade-offs. And that's really what this is about, is that neither of them are better or worse. It's just a different set of trade-offs you get with these different designs. Also part of the act of philosophy is just to sort of like, let the database do what it's good at, you know? It adds constraints by default. In your migration, if you set up a foreign key with references, you get that constraint by default, you know? It does not have polymorphic associations like Rails, which if you come from the world of SQL, like I did before getting to ActiveRecord, yeah, that is just so weird. I don't know where that pattern came from. It does not have these app-level unique validations, you know, like so active. If you want a unique validation, you put it on the database. It doesn't have that application-level one where you can do unique validation in Rails. That one is weird. It runs a select query first before doing the insert. It's not safe for race conditions. So you can't do that. And it's kind of clever, like Ecto has some neat ways. The downside of relying on the database is that the error message is uglier, but Ecto has some neat ways around that. I don't know if you remember, but in the change set, I defined unique constraint on email. When it gets like a unique constraint failure, it says, oh, which one is the unique column? Oh, it's email. Let me generate a nice error message for you. So it's really clever. And then there's the testing store, you know? I don't have any slides about the testing code, but believe me, the testing ends up being easier when you've got this more explicit model, when you're passing just data around between your functions. You tend to do less mocking because your business logic is not sort of like mixed into the model. You're not sort of like blending together business logic. So like say you had this financial app, you might have like Calculate, Interest Rate or something. That's not in the model. It's a function and you're taking the data, you're running the query, taking that data, passing it into that function, getting a result back. Well, that function then becomes really easy to unit test. It's a pure function. That's one of the benefits of functional programming. So just sort of the way you're forced into this paradigm, a slightly stricter paradigm with Ecto, you end up with more pure functions. You end up with less stubs and mocks, which is really nice. Also because this runs on Erlang VM, the test runs are massively concurrent. You fire off like the test suite and it starts up like 30 at a time. Like in parallel, which is really awesome. It does have a cool, cool more features. Like so JSON B, that's that thing in Postgres where you could save JSON in Postgres and query against it. It's got support for that in a real slick way. And they say there's a Mongo adapter coming, which is kind of cool. You can also take Ecto and like supply your own adapter for it. So someone like, someone found a way to write an adapter that hits the GitHub API. So it's Ecto, but instead of reading from a database, it's hitting the GitHub API and you get that same SQL type query. That's kind of cool. If you wanted to like swap out a database implementation with an API implementation or vice versa, you get that same, you don't have to change any of your app level code, which is kind of cool. That's kind of neat. But you know, in the end of this, realize that ORMs are a choice that you get trade offs with each one and one size does not fit all. So obviously I think I've shown, this is completely unbiased, right? I see these frameworks as, no, I like to act away, but that may not be for you and that's okay. If you value the kind of convenience that it gives, then this will be it. And also realize you have a choice, even if you're stuck with Ruby, you know, there's another gem out there called SQL, which has some similarities with Active Record, but with also a different set of trade offs. You know, it doesn't have the N plus, I don't think it has the N plus one thing. You know, so it's, you can swap this out in your Rails app. Use the ORM of your choice. Trailblazers, another one, which it actually uses Active Record, but it's got like a application architecture on top of that, including something that looks a lot like Ecto's change sense. So, you know, again, different trade offs if you want to use this. You can also use Active Record in a way that looks more like, you know, some of these other design patterns, more like Ecto if you want to, maybe by adding a service object or something, or you may just use Active Record as it is. Just realize that, you know, just because you're using Rails doesn't mean you're forced into the Active Record way necessarily. So a few resources here, a couple great articles. This Bikeshed podcast with Jose Valem is awesome. That's really, really good. If you're interested more in immutability and those immutable data structures, those persistent data structures, this is changing the Unchangeable. That's a talk I gave at RubyConf, which explains not just why, but how those things work. And then if you're interested more in services and how you can change the way you use Active Record, I also gave a talk there at Amitabh and Santa Barbara, which is, and there's a link to that one for you. If you're more interested in Phoenix, check out Friday, Brian Cardella. He's the CEO of Dockyard. He's giving a talk just on Phoenix. I haven't seen it yet, but I'm betting it's pretty good. So check out that one on Friday. Who am I? My name is Brad Yorani. I tweet at Brad Yorani. Follow me, I follow you back. I'm really a Twitter addict. Connect with me on LinkedIn. I've got this blog. I don't update it very much. I've worked at Santa Barbara at Procore. Procore makes construction management software and it's an incredible place to work. This is the view from our office. You can whale watch while you program. It is one of the coolest places to work. It's the coolest place I've ever worked. I moved all the way from St. Louis, Missouri to Santa Barbara just to work there. We're hiring crazy Rails architects. JavaScript front end, which is React and Redux. Pretty much every cool thing you could think of. I'd love to talk to you about that if you're interested or they're also about 15 of us here, mostly wearing Procore gear. So come and talk to any of us. Finally, HallwayTrack the app is live if you would like to use it, right? To get together with your fellow programmers here and set up a little HallwayTrack meeting. It's really raw, but it does work. And you do have to wait for that Heroku spin up time when you load it the first time, so be patient. But it is live and it does work. So any questions? Oh, you mean the devil incarnate? Yeah, those don't exist in Ecto. He asked about callbacks. Do callbacks exist in Ecto? And no, I don't think they do. If they did, I didn't go looking for them. But there are other ways to solve that problem, right? So you might put like a service layer or do it in the controller where you kind of run everything in that. I showed you that multi where you're kind of doing all the writes in one multi. You just use the controller or a service layer to kind of put stuff in a multi and run it all at once. Oh, cool. Thank you very much.


Welcome to the drum history podcast. I'm your host Bart van der Zee and today I'm joined by Pete Jarvis who is a drummer percussionist a ranger performer composer conductor Pete you have a lot of hats welcome to the show Thank you very much part. Yeah, so I am really honored to have you on the show. You you've really really had an amazing career I want to give a quick shout out before we even start to Tim Northup and Jim Messina Who both were talking and said we got to get Pete over to Bart to get him on the show and a couple days later Here we are. So I love how quick it was. Yes, and I would like to thank Tim and Jim as well Yeah, and alright, so the topic for today, which I mean I just want to talk about you and your life but I think the key thing that we're gonna kind of take away from this for people who are listening because I like to have a topic is Really how to have a career that's that's long and that's multifaceted and it's not just One gig and then you're kind of done or you're waiting a year for the other one when we spoke on the phone yesterday, I Got up a lot from you just of once you're doing one gig you got to be working on your next one So that's sort of what we're gonna get to and you've done a lot of film TV Conducting Broadway just an amazing amount of stuff, but that being said why don't you tell us about You first like what got you into drumming and music and how you became the sort of Renaissance man that you are today at an early age For me and it seems like an early age 10, of course some people start much younger I just took the opportunity to join the school band when that opportunity became available And I immediately became interested in drums And it was not on a particularly serious level. I loved it and I Immediately became completely immersed in it it took over all of my my interests Yeah outside of school in other words until then I was more involved with the league baseball and things like that and I Became far less interested in those things and immediately gravitated toward music and From that point forward there was really just no turning back. It's just been a Just a straight course ahead with music. Yeah, I always think it's pretty amazing to think of just You don't realize as a little boy in school that this thing that you're doing in this class is Going to shape the rest of your life, but I guess that's true with a little kid boy or girl who likes science They might become a scientist. You don't realize when you're that young when you're 10 years old that oh I'm gonna be doing this for the next 50 years 50 plus years It's pretty cool Yeah, it is amazing. I mean I certainly I mean what 10-year-old kid really Well, there's certainly be very rare 10-year-old kid that had a sense of what they wanted to do with the rest of their life At the age of 10, and I'm not sure I did in fact. I'm reasonably sure I did one thing. I do know is That playing drums and being in this school band Was the thing that I enjoyed more than any other thing. That's great. So Then how did you then take it from something that you love? To something that you get paid to do, you know, how did that switch happen? Obviously not as a 10-year-old. I'm sure you played for years and played with school band, but how did you kind of? How did you go from an amateur to a professional? I studied at the end of high school before I? when I chose to go on to College to major in music. I was fortunate get connected to an exceptional teacher exceptional drummer Joey Cass and I remember The first lesson very first lesson I had with Joey was he asked me what I wanted to do with drums and I told him I wanted to Play on Broadway and play shows because I'd done them in high school. I just I just loved them And he said okay, that's fine, but not the answer I'm looking for And he went on to to explain that what I needed to do at that point Was simply play everything that came up Take every opportunity No matter what it is and say no to nothing because I didn't know enough at that point he pointed out to me to make such a Decision of a sort of a specialized Nature aspect of of the business he said what you need to do now is get yourself exposed to everything you can get You're exposed to learn as much as you can learn and go to school for music And then after a while you've been to say Well, this is where I would like to Yeah Focus this is where I'd like to turn some focused attention And I took that advice and I started playing in everything I could play and I played in the local marching band on the Memorial Day Parade 4th of July and so forth The New York, New Jersey volunteer fireman's association marching band That's an awful and we did and you know, we did we did these gigs and On those days and we made a little bit of money for it. I really enjoyed that And I got in a rock band and Just it kept playing in the school bands tried to do the Summer productions and all the musicals just tried to do absolutely everything that I could do Following Joey Cass's advice Then when I went into college I met another one of my mentors who had a very specific course of study and I get I took that very seriously studying new music and percussion ensemble and then of course with that comes studying malice timpani and you know all the many aspects of And I went on with that and felt like I got a little bit of training that Perhaps enabled me to Branch out and and see where I might be able to fit in. Hmm. That's awesome So I just love First off out of all of that. I just love the idea of saying no to nothing Which it's just very cool because I think you need to take on a lot of experiences which you know sometimes it's easier said than done because it's like that's a lot of work and It's it's kind of easy to say no, I'm gonna do this. I'm gonna be a rock drummer, but When you're not saying no to things and you're just going alright, I'll do it I'll do it. I'll do it. You'll you'll get so much experience and and that Those experiences had to also make relationships with people which I'm assuming we'll learn about this more later But relationships with other musicians and people in general as we all know as musicians is so important. So I think you Getting all this experience with not only the players and performing But just working with a bunch of different personality types and and all this things that that had to be helpful in the future Absolutely critical as as I look back at it at the time I was just doing it and I was enjoying it I did find as I was moving along especially at that stage of my life my first Was advised to do that You know, I was a high school kid at that at that stage of my life You know, I just enjoyed everything. I just enjoyed just playing period. I didn't care what it what it was I was fortunate to get the opportunity to play in a big band and That was a wonderful experience. So while I was playing in the marching band and rock bands I was also playing in a big band and doing everything I could do and Although I had already been into it and interested in it for years That same teacher Joey Kass really stressed the importance of reading music and That there was no no substitute for that and you just simply needed to put in whatever time was required to Sure, I'm proficient at that. Yeah, don't let me get ahead here But you you've got I just think a really cool Subject that you've worked on is is I know this didn't happen right out of college or whatever I'm sure it took some time, but I'd love to discuss And we can jump around chronologically, but your your work on film TV And and even getting into Broadway and stuff like that, but I've had some people ask about How Film drumming works Particularly with movies that have a very drum focused Score like people typically think of like Birdman with like Antonio Sanchez and things like that now you have worked on You worked on Moonrise Kingdom by the film by Wes Anderson Which just was just awesome his movies are all just really really cool and and the music is great How did you get into? That Role and then I want to talk about the actual process of what it was like to record and and scoring a Movie like that a big big Golden Globe nominated movie for the best score. What was that like and how did you get into? making music for film Well, it's almost a funny story how I got into it, but it's I just second But it does directly tie into what we were just talking about I think one of the reasons that I Was first contacted by West's office was because my experiences Were so vast I had my hands and so many different things that it Aspects of music that I think it made me seem qualified to at least get a shot from them that is to say He was looking for somebody Do the movie the friend who has seen it for those of you have not the movie has a lot of percussion moments in it where it's sort of marching band type Music behind these scenes of Boy Scouts marching Fed Norton and so forth and West wanted somebody who was a composer a percussionist a Conductor and Someone who had access to a lot of percussion players So that's four very specific things. Yeah, and and I had that I don't know exactly how it worked I imagine I don't know this but I would imagine That he had one of his interns or somebody search for Those Qualifications or search for somebody that met those qualifications and I guess it is Search my name came up because I had never done any film music There's a brand new experience today Yeah, and I and I guess if you're looking for again a conductor percussionist composer and Somebody who has access to percussion players and you search for that it's not going to take a long time before my name Comes up because I was a director of the New Jersey percussion ensemble I've been conducting for years composing for years and Playing for years. So, uh, I think it from there He just gave me a shot and the funny part of the story that I alluded to earlier was I Was in the library one of the schools where I was teaching and It was the first week of those school, you know first week of September or if you know very early September the first week of school and like most of us I tend not to Open emails when I don't recognize sure the name the sender Yeah, so here's an email from a name. I didn't recognize I was just about to delete it And I said, you know what? It's the first week of school. Yeah Perhaps it's a student who has a question about registration and somebody wants to get involved and you know Doesn't quite know the ropes yet And so I said, what let me open it up and so I open the email and it turned out to be from West's office saying west sanderson Uh, we'd like to invite you to come and talk to him about his movies. Oh, man. Would you be interested in doing that? Hey, geez good thing, you know delete that Uh, yes, you know, I'd be interested in doing that and then uh Yeah, for sure. Um, I I hope that he would have found me one way or another. That's the funny part But I mean, I was one of the nicest breaks I had and I I came Within seconds of deleting it Uh, and never even seeing the email you're obviously a very established musician You've done some very big things, but I think for everyone in the entertainment You know overarching Like subject, which is all of us Were you just like over the moon? I mean to be invited to do like to work on a movie That's like a very specific special kind of of thing. I mean you must have just been blown away Yeah, I was I I was blown away. Uh, I was surprised, um because I didn't know what He was looking for so I didn't know that There were three or four so particular things that I happen to have experiences. So I was wondering why He was contacting me to be perfectly honest with you. Uh, so Yeah, I was over the moon to say the least and uh, I got back to him and then we set up a meeting and I went and met him in new york and watched the movie uh Some of it's still on green screen and he said what he wanted this that the other thing and uh asked if I could Get that done and I said, yes, I could get that done and he gave me a chance and uh He ended up being satisfied with my work. Wow and here again. It was he did say In the interview in our meeting that He wanted to be sure that I could Have access to any number of percussion players that we might need it turned out we needed Four besides may uh, and he said he wanted to be uh Sure that if something needed to be conducted in the percussion music that I could do that and we just went on over there for basic Needs that he immediately had for this project this aspect of the project and uh He was satisfied that I was qualified and he gave me a chance. Hmm now, uh From so once you get the gig and all that stuff, um, I want to talk more about even the specifics of how it works because I've had um a request for an episode a while ago from Uh, owen van houten. I think I'm pronouncing your last name right owen about film Drums and film and animation and he actually specifically said uh Isle of Dogs which was a west anderson movie which which had like taiko drumming With the like it's almost like claymation kind of stop motion stuff on screen But we're we're still I think we're we're pretty darn close with a west anderson movie that had a lot of drumming So I think we can speak to it a little bit. Um All right, so how did that go? Were you then because you're in you're in new york at that point I'm assuming west anderson was doing things in in california Well, his cutting room is in new york or maybe I should say maybe I should say one of his cutting was for all I know he has more than one but but here in a cutting room in new york, uh And it was working out of there all the time and I live in new jersey just 20 minutes outside of new york So yeah getting getting back and forth all that was Just just no issue now. Did you choose a studio to record in your so obviously you composed The music you did know that but did you choose a studio of your? Uh liking to actually do the recording or was it like a west anderson kind of approved come into the studio set up How did the recording process go? uh, the recording was done at Uh electric lady, which is a studio that in grenadette village, which is of course jimmy uh the studio jimmy hendricks designed and built uh I guess back in the late 60s uh Middle or late 60s and west west chose that uh for a couple reasons They do Have an incredible mixing board as I understood it It's one of only a handful. I think under five remaining in the world. It's a very unique Mixing board and it's An incredible recording studio. I mean it really is it really is top of the line and of the engineer That west works with or one of the engineers west works Certainly the one he was working with on this project works out of that studio And it was just right in grenadette village. It was just right, you know, it was very accessible to all involved So uh now west west picked that it it seems very west anderson to to record there I think everyone who's familiar with this work and if you're not google it There's the royal tenon balms and darjeeling limited and and all these isle of dogs all these movies are great They have a feel no one can deny that there is not a west anderson Style uh life aquatic. I mean it just you can watch it for 30 seconds and go. Oh, that's a west anderson movie No question about that. Yeah, so that that feels like that So so you then would perform your pieces. Would you have a screen up? Watching the uh film or were you more just I know what I need to do He would he would he would be running uh the scenes For us that we'd be and we'd be playing Watching the scene that the music was for Uh, actually when you mentioned some of those other movies and had their uniquely west's Uh style and and so forth. I I couldn't agree with you more That was one of the things that helped me that one of the observations that helped me Move the project probably in a way that helped me ultimately get the final gig because the very first thing I did was Get all of his movies Of course, uh and and watch all of his movies and One of the things I noticed right away was exactly what you just said Uh, you know, you can watch just just very brief moment of it and you realize right away This could only be west anderson and although they were all uniquely his style and uniquely his work They were in no way similar. No And so I realized that uh from watching all those movies the one thing or one of the things I didn't want to do was Try and duplicate or emulate in any way the the music that was on these other The soundtracks of these other movies that sometimes you'll find That happens in movies, you know, the music ends up sounding sometimes Similar as stage you might seem similar or other aspects of it might seem similar when you're working with the same director But in west's case it seemed like in each movie the music fit The character of the movie the particular scene and so on and so forth and It had to be unique to the moment and so that I felt to be liberating When it came time to actually compose in music Yeah, so I didn't feel like I needed to try and and sound like somebody else or You know work along the lines as somebody else worked I just needed to look at the scenes deal with the scenes and write the music that I thought best fit it and that was uh Uh That was real as I say that was really liberating. Yeah, and it's a unique film where it's the the little kids who were kind of having like a the Boy Scout Uh camp it turns kind of military and with that sort of drumming that you're talking about and I need to re why I haven't seen it in a few years. I need I need to rewatch it now that we've been talking about it and I can Uh, it's almost like you hear it in a different way when you know the person involved So I kind of oh, yeah, sure rewatch it but all right, so uh one last thing about the film stuff and then I want to maybe Talk about some other things with your career, but get to the point of like how can people take you as an example and uh learn from it and make their own 50 plus year career. Let's talk about boardwalk empire which for people who don't know was an HBO series that was uh Just really cool. It was about Atlantic City. It had Steve Buscemi and a bunch of great actors I really enjoyed it. Um Martin Scorsese directed it. Is that right? Produced it. I didn't think there were various directors. It was on for five seasons I think throughout the time different different people got involved directly, but but martin squish easy was uh The the producer so did that come directly because of your previous film experience? That was obviously post moonrise kingdom correct, right and that's a another kind of story that in a very loose way ties back to The very first thing I talked about where you know do everything. You never know what's going to come out of it uh as my first uh mentor suggested it We were recording moonrise kingdom And I stayed on wait after one session. So all the percussionists were gone because we were going to add a timpani part to a benjamin britain piece which was all strings Uh and west wanted to add a timpani part to it. So I wrote the timpani part and when it came time to record it It was just going to be me playing so all the percussionists, you know, we're done and they left and that was just me and west and the engineer and uh Uh The music supervisor and the music supervisor, which I didn't know at the time Uh just through my experience the music supervisor plays a very important role in in every aspect of the music on a movie and uh Music supervisor was there and it happened to be The same music supervisor for boardwalk Empire so now we're finishing up this recording session We're adding the timpani as I said and uh in moonrise kingdom And they were about to add some music to a scene In the second season of boardwalk empire um I could describe the scenes that stands out so much a lot of people remember that happened to be on the boardwalk and it's kind of violent scene the A couple of people end up really beaten down on a police officer and marty bayne comes around the corner and um anyway, uh, they were about to add some drums to go along with frankly the violence of the uh Of the scene and There was somebody there who wasn't really a drummer but played a little bit of had a little bit of drum experience and he was going to play And uh, I happened to be there finished the other one and music supervisor said would you like to stick around and play for You know another hour or two and I said, you know, absolutely. Yeah, and uh, I said, what do you have in mind? He said, well, we're gonna add some music to this scene in boardwalk empire And it was just they were just filming the second year and I hadn't seen the first season so I really didn't know what our boardwalk empire was. I mean, I had not seen it and uh I said sure. He said we're going to do a scenes where and when he said that it didn't light up my face or anything he said Have you ever seen I said, you know, I got to be honest. No, I'm afraid. I don't I don't know what that is and uh He said well, you want to explain to me was an hbo series and so forth and he said so would you like to uh Improvise some drums over this scene and I said yes and then did that uh and then from there Apparently he was satisfied with my work because I went on to be To include music over the next the remaining four seasons. Wow So that was a case of Being in the right place at the right time. I mean I finished up Of recording session The music supervisor was the music supervisor for the next recording session And he said well Why don't you just go play the drums for this and I said love to and then I was in boardwalk empire for the next five years and I mean it's uh You don't know what's going to lead to the next thing I I've had that experience with working on the dialogue Stuff that I've I explained to you on the phone that I that I've done where you fix people's lines You do all this stuff, but I've had it where it's the person who's like the the adr mixer Or whatever's on the on the line with you They might say oh, I like that studio Let's work with them again or and then maybe three or four times in Like I worked on a bunch of the dick wolf like chicago med Uh chicago pd law and order and it was like the same person and it was like Oh, yeah, they like you they can trust you no one wants to go out and try New people all the time and have different results like with you and boardwalk empire It's like oh, yeah, Pete's great get Pete back, you know Yeah, I was lucky and he didn't even have to to get me back I mean I was standing there in a room there was percussion equipment all over the place Yeah, the guy said you want to go play drums and there was a drum set. You know, I said Yes, I do I always found it fascinating that that work where you were just speaking about that you do with the uh Yeah, the dialogue replacement voice Is synchronization also that you're working on? Yeah, I mean it's been COVID. I haven't done it in about a year and a half or whatever But yeah, so it'll be a couple different things where uh, um, like the the actor sometimes they'll be turned They're like uh, my my boss worked on uh, like the hunger games where pita, you know the the josh, um Hutcherson I think is his name his back was to it and he's like yelling and it got kind of messed up So you can when their back is turned you can put in whatever you want, you know like you can if you don't see their mouth you can have them say whatever they want, but um If you want if the cat if the actor's facing you then yeah, you do you drop in your three beeps And then on the invisible fourth beep. That's when the actor would drop in his lines like um Like I did uh speaking of HBO. I worked on the deuce, um, which was a you know, uh, James Franco and Maggie Gyllenhaal and all these people I worked on like a smaller kind of side actor who was in town, but but yeah, his mouth is on screen So you'd I would have my cue sheet. I would um line it up where I used actually I think the drumming the the it's kind of minor but the rhythm of beep beep beep Come on, baby would be like the line that he did it was really short He just needed to fix it of saying come on baby or something like that So I used the invisible right on that fourth beep is when he does his line And I roll six or seven takes of it. Uh, I loop it and I just send the the crew from HBO or whoever them film whatever it is The the file, but if you do animated stuff, it's totally different where there's no sync to picture Uh, you're just recording Dialogue like the newer the latest one I did was the trolls movie and you're uh, you're just recording lines There's no they don't have the um animation yet. So you can just record um You just record it out in the wild and I I just think the crazy thing about this is let's say on a movie It it's kind of a testament to west anderson and those guys you're an electric lady recording these drum parts He's simultaneously got people recording Dialogue replacement with all these other actors when all the other actors are probably in different cities or countries working on their next movie the the orchestration of Getting everything done is just unbelievable. You know Yes, uh, the the scheduling and the overlapping of the tasks and so forth is uh An art form world to itself. Yeah, absolutely It's cool stuff now now to keep again with our theme of advice for people to have a long career What tips would you maybe give to our listeners or a student of yours or anyone? I know that it's just don't say no to things just keep doing it but Is there any tips you would have on how to get into working on? Uh films of any level. I mean you're not going to start out day one working on west anderson movies. Um Any tips you can give people? I really wish there were because I would suggest I could make a suggestion But I don't know that it would lead to anything and one of the things that I would first suggest to A young composer or any composer who wants to get involved with film would be to get involved with film and One of the ways you need to do that I think is to be willing to take some chances Be willing to invest some time in something that you know Might not necessarily Go where you would like it to go and that's one of the chances I'm talking about taking. Yeah, so I would say And perhaps this might be a little bit easier in the new york area because there's so much Film being made on all levels. There's a lot of Schools universities and colleges and film schools There's just so much film being made by by students and they Very often need music. Yeah, so I would say if you were a young composer you should Find these places And get down there and meet the young filmmakers You need to establish In my opinion and this goes beyond filmmaking, but I think you need to establish relationships with people of your generation uh, so if you're A young composer you should try and get involved with some young filmmakers. They tend to see things perhaps through uh A similar lens because of the Their their age might be similar and they have a similar Sometimes view of of the world and and where we live And that makes it perhaps easier to Relate to one another. You're not trying to relate your art to their art when You have such different points of reference in your life. So I I think uh, just by How long you've been alive? Uh, I think it's very important to get down to A film school and and get in there and I don't know maybe go at lunch time Meet some young filmmakers and say hey, are you you know Young film here you're making a film, you know, I Want to write some music, you know, perhaps we can collaborate and Things like that. I think you just need to go to where the film is being made And get yourself involved just just introduce yourself to the people and meet people and and watch and keep an open mind and Be willing to be part of something is very important not necessarily feel like You're running something it's very important to realize that It might be looked at as you producing music For someone else's movie not to find a movie that fits your music and and be willing to to Look at it in in Ways that don't necessarily Put you right away at the top And and be willing to to work on that and when I said earlier you take some chances Well those projects could take months Then months and they might just absolutely flop And and and now you've invested months Uh, so patience is in order Uh, no one likes to hear that but it's true. Yeah Patience is in order and of course You want to try and use good judgment involve yourself with Things that you're interested in things that you think you can Add to or things that can You know, you can mutually compliment each other and Have some patience trying to trying to put it together And I think use your judgment with anything It just seems like also you need to If if you're working with people in a film where you go, this is weird This doesn't feel right. This is like shady something's going on here Um, you don't want it to hurt your reputation by being associated with something where they're not paying people or or things are getting um Just you know use your use your judgment too I think is is key and I want to also ask you so this seems We kind of skimmed over it, but so You're a drummer like and a percussionist now. How does a drummer percussionist become a composer? Are you? Uh Literate in writing music for all different types of instruments. Do you play other instruments? How how are you? Able to be a composer if you're a drummer and a percussionist Well, I do not play other instruments But I feel quite literate in many many instruments certainly of the Perhaps western orchestral World You know the strings the wind I feel I feel pretty good about Knowing something about those instruments Of not it not at all how to play it's like when people can read a language, but not speak it kind of thing I can understand what you mean there, but uh, there were a couple ways where I felt like I became comfortable with other instruments first Through playing chamber music okay, uh Where you were playing with In oh say a sextet that has one percussion and five other instruments or something like that It's just a random example to be anything. Uh You have to begin to become familiar with those instruments in order to make the music work in order to make the music When be comfortable and do all the things that we know music needs to do all these things We're familiar with in order to do that You've got to spend some time Working with people playing those instruments and Trying to get to understand what they do and and let them see what you do and and through that that work You can begin to develop some of that some of that experience and knowledge, but then secondly Perhaps more importantly on some levels Uh, perhaps I don't know I became a conductor very early on once I got to uh The university level of studying and I was fortunate enough to get to conduct a very good group and I was fortunate enough to Also get to conduct students and that I learned a tremendous amount from that because there was no rush You know when you're conducting a professional situation very often You just start rehearsing and before you know what the concert comes up There's not a lot of time to do everything. You know, you're working with professionals Everybody knows what to do And you do it and you kind of help organize it and stuff like that, but You know, everybody already Knows their job and and knows how to do it or they wouldn't be there. That's one situation. Sure when you're conducting with students It's a different situation and there's not usually a deadline You can start working on a piece for example at the beginning of a school year in september or october Maybe not have a concert till march and maybe in that in that Interim you can have 20 rehearsals Well, that's where you can really take stuff apart and put it back together and really get to understand somebody intricacies of how these instruments interact with one another and and All the things that we know they do so conducting students and conducting professionals ideally At the best at the same time and then even better When you have a professional group that is well mented by students Uh, it's that can that could really be a an ear opening experience We can constantly compare the two and see What makes one one what wakes the other the other? Yeah, so conducting I think is uh The very short answer to your to your question So yeah, that's no that's perfect and I mean As we you know Getting towards the end of the episode. I'd love to just kind of focus in on on what we said originally was the real topic at hand here and you told me some great stuff when we spoke on the phone the other day that I'd love to share with people about um Really how you play on for a long career and just talking about how you're planning for your next gig Because one key takeaway I've gotten so far is is you're not Uh, I'm sure people like there's many drummers who just do Broadway and it's great. They just do film stuff It's great, but you have taken the route of having um a very very diverse career and and obviously That's led to you having many different jobs over the years What would you recommend? Let's take some time to talk about what you would recommend for people on having a a long um Like I said diverse career Actually, I'd like to say at the outset because I think it's relevant My experience on Broadway is is really quite minimal. Um, I haven't I haven't played on Broadway much at all but it didn't take much for it to become relevant to me in terms of how to Just have another tool Sort of that available and and use what I learned in that experience in other experiences and I think that's really important to to to Get what you can learn from from situations no matter where you are in your career And have something else to apply to the next next day You're never finished learning a sort of quick answer, but not not You know to really have a long career.  That's just what you do. Uh, and you never finish but One of the things that I was saying which you just alluded to in your question was in the planning I do tend to plan long term and short term and to a younger student perhaps When I'm thinking of by more longer term Would be perhaps a little more difficult to relate to because perhaps some of them are at very early stages and are 20 years old but when I started composing I did it planning for what would happen 20 years later And I was already in the middle of a large part of my career. Why was that? Well, it was actually in 1998 I already even though I was playing for when I was 10. It was really when I got to college that I started getting Professional gigs and that was 1977 78. So In 1998 I had about 20 years in and I started planning For what I would be doing 20 years later, uh, I started to think that Percussionist and I had noticed percussionist retiring a little bit earlier than perhaps some other musicians because of the physical Demands of it schlepping equipment and getting around said I'm just just was physically demanded as a percussionist, I would say almost in the same way where A basketball player's knees give out And even though they they still understand basketball and they can still be in great shape and they can still do all the things that they have to do but Their knees don't work anymore Uh, you know these kinds of these kinds of things. Well, I I thought percussion Playing and I feel like I had seen it with other percussionists happen And I simply didn't want to be out of the game at that point That was one of the reasons I started composing Uh Because I wanted to start then because I figured some 20 years later Which is now two or three years ago because this was in 1998 I was hoping if 20 years later, I had to stop playing which I have not I don't intend to stop for quite some time But if in 20 years or so when I reached around 60, I had to stop playing I didn't want to have the next part of my career Have to be approached as a beginner Yeah, I wanted to have 20 years of experience Composing so At the point where composing might take over As the focal point of my career I wanted a couple decades of experience so I might be able to actually do something and enter that world Uh as something other than a beginner. So that was the sense of of what I would consider to be longer term planning and I have plans for You know 20 years from now, but in shorter term I simply Try to never be doing a project without another project In my mind if not in the planning stages so that went up because sometimes when you finish a project There could be that sort of moment of Avoid Yeah Well, you don't have anything to do and you got to look for the next thing to do or wait for the next Thing to do or feel like okay. That's done now I'm going to spend some time catching up on all the things that I neglected and all these things that we know about but Of those I think the most important one is finishing a job and you emotionally can have a moment where Now nothing's happening and it can be hard to get out of that it can be Hard to find something to start and and trying to get that level of passion up that You concluded your last project that so I try to overlap them Whenever I'm on a project I I know what the next project is It's not what the next several projects going to be or at least what I would like them to be Or I'm trying to move in that direction That keeps me moving and as long as I'm moving and moving forward I feel like I can stay in the game and then Like I said the longer term planning Gives you a direction to try and move in so what I what I just Do is not necessarily random. I mean if I have nothing at the moment And something comes up. I'm going to do it just about no matter what it is, but I try and Pick and choose the things that I involve myself with to help Realize my long term plans Yeah, I mean that is just So many things in there are just so uh, I mean the key takeaway is just always have something Next in the books. I I have a client who I do video work for Every other week and it's I mean it's a substantial part of my income and but the downside of it is Is this is one guy where I go and film and I do these I live well during coven I live stream these seminars that are six hours long for Psychologists not drum related, but again if you're going to do video and audio you got out You're not it's not all working on movies and stuff so But if if he cancels one day out of the month, it's like oh geez there goes a check that is Uh a substantial portion like I said of like a monthly income So it's you you're so smart to be planning ahead and I think that's cross It yes, it's drumming which is what we're here to talk about or playing music, but um, that's kind of smart in life in general It's just to to kind of have something going on on in the you know around the bend to be working on to be growing to be um kind of moving up always growing Is a key thing that I think you you are obviously Very smart about what motivates you. I mean you have to you're a human You have to have these days or months or weeks where you're like, I just don't feel like doing this I'm I'm I'm happy with how things are right now. What what pushes you forward? A couple things push me forward, but one of them is the reality certainly in the new york area where If you don't answer the phone a couple times or you say no too many times in a row they stop asking There's a lot of cats around here and that can be An advantage or perhaps a disadvantage, but if you say no to gigs too many times there are an incredible amount of people who will take that gig and once a producer Who's ever running a gig director of a group whoever it might be Gets used to one person saying no And another person saying yes the first call goes to the person who said yes sometimes You have to say yes to things that you might not necessarily Feel like doing at the time, but you just know that that You don't want to lose your Sort of uh Spot on the on the front of the mind of the contract So part of the time and again is it's it's thinking of of longevity that just comes with the nature of the business that that You know what I hate to put it, but you know, what have you done for me lately?  I mean that that's that's probably critical to to producing Producing good work, you know one thing that That sort of ties into a couple of the things that You you mentioned and as you said we're getting near the end Uh, I could speak with you all day, but whereas we get near the end One other bit of advice I would Offer particularly to to younger players Is to follow the advice Of people Who know what they're talking about Now that gets a little vague know what they're talking about. What does that mean? But I and I don't know that I know myself, but I do know that there's a lot of students who ask their teachers questions or just have Information volunteered from their teachers and they just don't follow the advice Yeah, and they don't understand that they they don't have the perspective of somebody with more experience and You need to follow the advice in my opinion Of those who have these experiences Behind them and I really find that to be perhaps missing in in some younger students who naturally are a little bit less patient and really want to like Jump right to the end game And sure skip some of the steps that might be advised to them a long way I do not recommend that no and I also think too one last note that I've always kind of found and I've spoken about on the show too Is you never know who's watching you play? You never know who's listening like I with every episode I do of these shows It's like you never know where this is going to take you and who's going to hear it So make every episode count make every performance count Um, because again, even the simplest little gig if you kind of throw it away. Oh Uh, west anderson might have been in the audience or something like that, you know, oh boy Yes, and yes, um, and now yeah, I I hope everybody, uh Really heard and paid attention to what you just said Uh going back again to what I was just saying about following advice Even if you have to take your time at that another one of my mentors I have three or four and another one of my mentors Told me back in the 80s is significant that it was the 80s because the first piece I wrote was in 1998 And he told me back in the 80s that He thought college students Should spend time composing Conducting and performance Now how that time gets divided up Would be of course based on what your majors if your performance major then, you know The lion's share was going to be performed, but you still need to Compose and conduct and of course your composer the lion's share will be composing and so on and so forth but he did say that it it's He felt it was important for Performers to know what a conductor is is thinking and trying to do and the way to do that is to learn something about conducting and vice versa and composers need to be able to Think somewhat like a performer to some degree to understand what performers Needs are and performers need to be able to put themselves in the shoes of composers so that they can and and the way all of these three things can relate to each other and I remember that that advice very very, you know, really Took took root, but I was focusing on my playing and conducting very strongly at the time very slowly many many hours, you know, just really focused work and In 1998 which was now about 15 years or so after he told me that or at least over 10 I said okay now i'm gonna finish that third Step that I was told was critical Uh, so it took me 10 years to get started, but then I started composing And that was another reason that I started composing a question. Yes, really it was because one of my mentors said you need to compose conduct and play to Really get perspective on this and I was already playing in conducting so I thought at time to uh follow the man's advice and start composing Yeah Absolutely. Well, you gotta I don't know you have to be a little bit of a self starter too on top of all that and just And I just love it take people's advice and all that good stuff and um, I think this has been awesome. I want to um again thank uh tim northup and Jim messina for connecting us and having you share your time with us today And I hope everyone has really enjoyed Getting all this information and just hearing about someone who's had a very very very long career that has not stopped at all Um, pete has been uh kind enough that he's gonna hang out for a couple extra minutes And I want to ask him about another movie he worked on which is ang Lee's Billy Lynn's long halftime walk, uh, which has a really cool story about kind of recreating a marching band kind of Uh sound and the drumming and there's no music and he had to do it anyway And it's a really cool story So if you'd like to hear that bonus episode and all of the other ones that i've done Over the last couple months you can go to drumhistorypodcast.com And there's a patreon button and you can click that and join up and uh, I really appreciate everyone who's been doing it recently got a bunch of new patrons for the show which just helps keep everything going so um On that note, pete, where can people Find you is there a good place that if they want to get in touch with you? Um anything like that? Yeah, but before I give that information, I do want to take a second to thank you Sure for having me and to congratulate you on Your your podcast you've been a hundred and Eight and I guess now maybe this is the hundred ninth that is a lot of episodes. Oh, yeah And congratulations on the great work because uh You bring a lot of information you allow people to access a lot of information They otherwise might not be able to access so Not only congratulations, but thank you It is my pleasure the the the best part is getting to talk to people like you and uh, And have people who I trust recommend people Like you and I I hope it's providing You know joy and I I always get notes from people saying hey, it's really great on my drive home or my commute or Um, you know what i'm working out or sitting out by the fire drinking a beer I listen so I love hearing that stuff. So thank you for saying that. Um And uh on that note pete. Thank you for being here my pleasure. Thank you If you like this podcast find me on social media at drum history And please share rate and leave a review and let me know topics that you would like to learn about the future Until next time keep on learning


Hi, my name is Megan Wanchuck and I'm a master's student at North Dakota State University. I'm in range science and I'm working under Dr. Devin McGranahan. We are comparing cow-calf performance on patch burn grazing, rotational grazing, and traditional seasonal long grazing pastures and determining why differences in performance may occur. We are trying to determine which methods will provide the most stability and predictability in livestock performance over years where you may have differences in precipitation throughout the grazing season. So we have three years worth of data. We found that cow weight gains on patch burn grazing are greater than traditional continuous grazing and on twice-over-rotational grazing with nearly an additional pound of day of extra gain on the patch burn grazing pastures. Animals on twice-over-rotational grazing generally also underperform the season-long grazing pastures. The cattle on the patch burn grazing pastures have consistent gains whereas the continuously grazing pastures showed variability in the gains, although this variability was not different from zero. On the twice-over-rotational pastures there was also variability that wasn't different from zero. We also found that there was no difference in doing a spring-only burn on the patch burn grazing pastures or a spring and summer burn. There was additionally no differences in calf gains between patch burn grazing, continuous grazing, and the twice-over-rotational grazing. However, it appears that calf gains do come at the expense of cow gains on pasture in the continuous grazing systems and the twice-over-rotational grazing systems. So the livestock performance is largely driven by forage quality differences on these pastures. Although there's lower biomass as produced on the patch burn grazing pastures, they have very high quality forage which attracts the cattle to these patches throughout the grazing season. The percent crude protein on patch burn grazing pastures in the burn patch is consistently higher than unburned areas. There's also a higher TDN and relative forage quality on the burn patches and lower amounts of hard-to-digest components such as ADF, NDF, and lignin. A general declining forage quality is seen throughout the patch burn grazing, rotational grazing, and continuously grazed pastures which is expected in a cool season forage stand. Burn patches have a higher mineral content compared to the unburned patches, especially in calcium, phosphorus, zinc, and copper. Recently, there's been some work done at the Central Grasslands Extension Center and Headinger Research Extension Center, which has found that livestock gains on drought years in patch burn grazing pastures are higher than a traditional season-long grazing pasture. This is likely due to the ability of patch burning to mitigate drought by buffering forage resources through crude protein availability and also by maintaining animal performance. So all in all, patch burn grazing pastures have stable cattle weight gains likely due to increased forage quality from burns and therefore there's better livestock performance on these pastures.


Bismillah ar-Rahman ar-Rahim, I start in the name of Allah, the All-Merciful, the Ever-Merciful and they have a lasting curse beyond the Satan and his followers. Allah's blessings and peace be upon Muhammad the Prophet and upon his pure family. Our respected viewers on the 10th of Muharram al-Imam al-Husayn alayhi salam faced the army of Obaidullah ibn Ziyad and he addressed them with the following saying, If you do not believe in religion and do not fear the hereafter, then be free from tyranny and arrogance. Our respected viewers, Allah's blessings and peace be upon you and welcome to who is Imam Hussain. A series of episodes in which we talk about the different stages of Imam Hussain's life starting from his miraculous birthday, talking about some of the events and stories happened to him during his holy life, mentioning some of the traditions said in his right by his grandfather, the Prophet and ending up with his unmatchable martyrdom. My name is Hassan Hadi al-Manar to be hosting this program. Our respected viewers in the last episodes, we spoke about the fitna or sedition in Kufa and we are still talking about the same topic. Our respected viewers, Hani ibn Arwah, Allah's blessings and peace be upon him, was brought by a group of his friends and relatives to the palace of Kufa's new governor, Obaidullah ibn Ziyad. Almost immediately the interrogation began, ibn Ziyad accused Hani of lending his house for the purpose of organizing seditious activities against the rule of Yazid bin Muawiyah, of gathering like weapons and meant for an uprising and of harboring Muslim bin Aqeel Imam Hussain's representative sent to Kufa. At first, our respected viewers, Hani ibn Arwah denied the charges directed towards him, but bin Ziyad continued to press him. After more denials, ibn Ziyad finally called for his spy. Muqa'bel, do you know this man? ibn Ziyad asked him. It did not take more than a moment to dawn on Hani ibn Arwah that Muqa'bel was nothing more than ibn Ziyad's mole among the Shi'a. However, Hani ibn Arwah was more clever than that and he moved forward. Our respected viewers, Hani ibn Arwah, Allah's blessings and peace be upon him, went on explaining to ibn Ziyad that Muslim bin Aqeel was not invited into his home. Rather, he had approached Hani asking for a place to stay in and he was too ashamed to refuse him. Therefore, and after all, to do so would be against Islamic custom and Arab hospitality. Hani ibn Arwah went on saying to ibn Ziyad. However, in keeping with both of these traditions, as soon as ibn Aqeel was his guest and the duty to protect him also fell upon Hani ibn Arwah. Then his affair developed as you have been informed. He said to obey the Allah ibn Ziyad, If you wish, I will give you sworn testimony that I do not mean you any harm or danger and I will come and give you my allegiance and a guarantee of my immediate return. Then I will, with no doubt, go to ibn Aqeel and order him out of my home and he will no longer have the right of protection and whatsoever over me. Our respected viewers, this is the end of today's episode. Until we meet again, let's pray that Allah the Almighty hasten the reappearance of the master of our time to interpret the message of the grandfather who says I only desire to spread good values and to prevent evil. Thank you very much indeed. Wassalamu alaikum warahmatullahi wabarakatuh.