Scott Keck-Warren
0:04
Hello developers, and welcome to the Community Corner podcast, where we have conversations with members of the web development community. I'm your host, Scott Keck Warren, and today we're talking with Mark Niebergall about his talks at PHP 2024, one of which includes a very interesting sounding, uh, tutorial track and a vacancy on the PHP FIG board. Mark Niebergall is a security-minded PHP staff software engineer and team lead at a cybersecurity software company. with many years of hands-on experience with PHP projects. He is the Utah PHP User Group core organizer, a regular conference speaker, and a PHPFig secretary. Mark has a master's degree in MIS, is CSSLP and SSCP cybersecurity certified, and volunteers for the ISC2 security exam development. Mark enjoys endurance sports, being outdoors, and teaching his 5 sons about writing code. Thank you, Mark, for finding some time to talk to us today.
Thank you. Good to be here.
Scott Keck-Warren
1:02
Yeah, absolutely. So you're one of the speakers at PHP Tech 2024. And one of the topics you're going to be talking about is PHP applications at scale. Can you give us just like a little introduction to what that talk is going to be about?
Yeah, of course. I've worked on projects in the past that are thousands or even millions. The last couple of years has been at the billions scale. So we're dealing with data that we have multiple billions of data records. We're trying to make things faster. So we have this data aggregation problem, we have processing problems, we have problems processing files that are in the tens of gigs of size. And so this is a talk that's bringing my lessons learned from working at that scale into how to use that with PHP. We found a lot of little tricks, little ways to speed up processing, especially that size, that normally doesn't work. It might seem counterintuitive. There's different strategies to take in that I'll be going over and talking about. I'm also doing some benchmarking on some PHP functions, and I'll present my findings there, basically going over what's fast and what is not. And so watching for some anti-patterns, some things that might seem nice or handy to use but are actually really slow, and also different coding strategies to help keep the memory size down as you're working through trying to solve problems. That's really the focus of that talk is how can you take your PHP application, maybe change some things you're doing to be able to make the code run faster, especially as it goes to bigger scale sizes.
Scott Keck-Warren
2:44
I've been lucky enough to start out at companies where we were very small and we only have thousands of rows and then have scaled up to millions and billions of rows. And it is like the, just like the counterintuitive thinking that you, you know, like you just have to completely change how you think about data from like the small dataset to the huge dataset, right? Like it's just totally like a different perspective. So it'll be interesting to kind of hear some of that information. Um, can you tell me a little bit about like, I'm, I was intrigued by the, like the performance of the, uh, PHP functions. Like, is there, is there anything that like you found was like staggeringly like slow in comparison to other things? Or is it just kind of like, you know, just this little thing gives you like a 10% boost or so?
A lot of them are small little boosts. Um, there are some more dabbling into, uh, the, you know, Copy-on-write. So when, you know, when an array is manipulated, how do you handle that? Doing like foreach loops versus for loops, switch versus match, trying out different newer things in PHP as well versus old things, seeing what scales and what doesn't. Also going into things like single quotes versus double quotes on strings and how big of a difference does that actually make? Comparing arrays versus objects. And so it's really getting to the nitty gritty, the small things, which, you know, might be a little bit when you're dealing with small data, but when you're running through millions and millions of data points, it makes a big difference over time.
Scott Keck-Warren
4:15
It'll definitely be interesting to hear like what, what the results of that are. Cause I, I'm sure that like there's probably something I can learn there cause I don't generally worry about, um, you know, like the performance of PHP itself generally, like on, on applications, like MySQL is the bottleneck for everything. So we're always waiting for MySQL to return data. So, but it'll be interesting to see what, like, what you have found with all of that. Um, especially that double quote, single quote thing. Cause I know like for the longest time it was single quotes and don't do string concatenation inside the string. So it'll be interesting to, to kind of hear about that. In the abstract for your talk, you also talk about data database denormalization, which is like a concept that I find fascinating as well. Um, it's actually something that I'm going to talk about briefly in my talk. Um, cause we have like the same kind of thing where it's like, here's a bunch of data, and then we needed to be really fast on reads, so we denormalize the data. So it sounds like there's a whole lot of content to, to see in your talk.
Yeah, we found that, say, putting the denormalization on there really speeds it up because you cut out that join, which sometimes might seem like a fast join, but depending on your database engine, may or may not be. And so it may be causing major bottlenecks. So while you might have to store more data, it's going to be significantly faster and save some some processing for you in time.
Scott Keck-Warren
5:29
Yeah. And we've started doing, uh, table mirroring. We have like tables specific for specific subscribers in order to speed up just their performance. And so, but we have, you know, like we have the, the normalized version in one table and the denormalized version specifically for them in their own, which is another huge thing to help with that kind of stuff. We'll be right back with more from Mark, uh, after this word from our sponsors. Attention all PHP developers. Did you know that one of the best ways to improve your skills is to attend a conference? It's true. And have I ever got news for you because PHP Tech is returning for another year of leadership, expertise, and networking all in one event. It's a relaxing atmosphere for tech leaders and developers to share, learn, grow, and grow professionally while also providing you the knowledge to solve your everyday problems. You'll learn things like building for the PHP command line interface from Steve Grunwell and the dark corners of the SPL from Omni Adams. Join us April 23rd to 25th, 2024, just outside of Chicago, Illinois. or online as all talks will be streamed live. If you can't make it during the conference itself, all talks will be available later for you to watch at your convenience. You'll even get access to last year's talks. Tickets are on sale now at tech.phparch.com or use my link in the description for a discount. And now back to the video. And we're back with Mark Niebergall. So the other talk that you're going to, or one of the other talks that you're going to give at the conference this year is the PHP coding competition, which is actually in one of the tutorial tracks. So it's like a 3-hour block as opposed to the normal 50-minute or 30-minute block. Can you talk to us about what people can expect when they go to that?
That's a great question. I've been to a lot of conferences, tutorials, and I feel like usually you're walking to a conference, you're there to learn, you're there to get a feel for what other people are working on, get a feel for what the community's— where it's evolving. But this is really a Fingers on the keyboard. We are going to code. We are going to write things. We are going to have fun. It is supposed to be first and foremost fun and exciting and challenging. And so there are just a few rules. There are going to be 5 total challenges, each one with a different— I will not go into the details of what they are. I do not want to spoil it, give people too much of a heads up. But I will tell you that one of them is based on scaling. And so there's going to be some different challenges to take on, and people can work by themselves or they can work in pairs and try to finish these, see who can get the farthest or be the first one to complete the challenge. There are some prizes, including elephants. So there's a pretty serious prize there, thanks to John at Pure Architect. So I'm pretty excited about it. Working through some of the different rules and what the objectives are. And I'll present it there. So the format will be, I'll do an introduction. We'll go over the rules. And then we'll show the challenges. And people can then start working on them. We'll have a time limit so they can start working on it. And some of the challenges are the first one to complete it. Others are the first one, or whoever gets the best result by the end of the time. At the end of the time limit, we will then go and review who the winners were for each category. I will have people share their code, show what they did, how they did it, a little presentation, and award the prizes. That is kind of the format there. It is really supposed to be fun and challenging for people to actually be writing some PHP code and maybe challenging themselves more than maybe a different way than they normally do at a conference.
Scott Keck-Warren
9:15
And so if somebody is interested in participating in this coding competition, they should have like their laptop with them and maybe PHP installed, or what are the things that people should have in to be prepared for this?
Yeah, great question. So to be prepared, bring a laptop. You can use whatever IDE you want. I will be using GitHub. You can make a pull request on some of these to show your code. And that way you can also limit the time, you know, get the pull request open by a specific time. And so coming with just that, that's all you really need. I will be testing it on PHP 8.3, so it should be compatible with that, but pretty flexible with that too.
Scott Keck-Warren
9:55
That sounds like a really fascinating, like different thing than I've ever seen before. Can you just from, from my perspective, like how is it that like you're preparing to to do something like this? Are you like testing this with people or how? Because like, to me, I'd be like, oh, I have to talk. This has to take 3 hours. I don't know how I would go. This is a reasonable amount of time for 3 hours or it's not. So how did you, how have you been tackling that?
Yeah. So I've done a lot of interviews, interviewing people where we often will do a code kata or code exercise, which has helped me kind of get a feel for how long it takes to do some of these challenges. I'm also working through them myself, so I'm not just blindsided walking into them. And so I'll have an idea of how long they should take. And also, that's also why I made some of them, you know, the first one complete them, the other ones where the more time you have, the more you can complete. So there will be— there absolutely will be, you know, people will be working up to the last minute trying to get the best results, the best things done in order to complete it. So time-wise, it'd be about 2 hours total of coding. That's about 30 minutes before and 30 minutes afterwards with Between the introduction and the actual presenting the winners.
Scott Keck-Warren
11:06
Okay. It sounds like a really fascinating concept to me. I mean, I probably have said this too many times, but it does sound really fascinating to kind of see how this flows, especially as somebody who has also given tests like, here, go do this thing, write this thing, and then they'll tell us if you're a good match for our team or not. So it'll be interesting to see how this all works out. I'm curious to see how How you're going to— like, if you get 100 submissions, how are you going to review 100 submissions in like 5 minutes, right?
Yeah. And there are a few of the challenges, a couple of them where people can show me locally on their laptop. So that will help alleviate that because I have thought about that problem. OK.
Scott Keck-Warren
11:41
Yeah. So is there anything else you want to tell us about this talk at this point or anything that anybody else should know?
No, that's— Pretty good introduction to it. Hopefully that helps people feel comfortable jumping in and trying it out.
Scott Keck-Warren
11:57
Is there anything else you'd like to direct our listeners to before, before we let you go today?
Hey, you can follow me on Mastodon @mbniebergall. I'm also a PHP-FIG secretary. There's a vacancy. So if anyone's looking for somewhere to volunteer in the community, that's a great way to become involved. There's a Discord channel for PHP-FIG and you can reach out to any of the secretaries. to become a new secretary to help out.
Scott Keck-Warren
12:23
Well, so can I, can I ask a little bit of a follow-up on that? So what is, what is the role of a PHP-FIG secretary?
Yeah, so PHP-FIG secretary, um, help with some pull requests, merging things, um, but, uh, help with a lot of the administrative side of it. So recently I ran the last elections that went through for core committee members and for secretaries. So keeping track of who's coming, who's going, and also helping projects, the different PSRs and PIRs like Perseus moving along, just keeping them, the projects, the standards progressing over time. And so just keeping an eye on the working groups to make sure that there's progress being made.
Scott Keck-Warren
13:07
Obviously someone who's, you know, who applies should know some PHP. Is it more of like a project management documentation type role?
Yeah, there is more of that side of it, more of the project management side for the secretary. And really, there's not like a lot of coding I have to do for it. You know, if we make a website update, that's another one I do. It's just running a little Docker container and doing some Git merging and things. So nothing too big.
Scott Keck-Warren
13:37
Okay. Yeah, that sounds like an excellent opportunity for somebody in the community. So I thank you for your time today.
Yep. Thank you, Scott. Great to be here with you.
Scott Keck-Warren
13:45
I have to say another heartfelt thank you to Mark for his time today and yours for listening. If you're not already a subscriber, make sure you subscribe with whatever your preferred method is so you can get episodes as soon as they're released and leave us a review or a comment as it does really help others find us. And maybe share this with a coworker so they can learn from it as well. This podcast is available both as an audio version on the PHP Architect website and a video version on the YouTube channel. This is Scott Keck Warren for the Community Corner podcast, signing off and reminding you to keep listening, keep coding, and keep reading.