Latest / Talk Python To Me / #105: A Pythonic Database Tour
Transcript
- 0:00There are many reasons it's a great time to be a developer.
- 0:02One of them is because there are so many choices around data access and databases.
- 0:06So this week, we take a tour with our guest, Jim Fulton,
- 0:10of some of the databases you may not have heard of or haven't given a try yet.
- 0:15You'll hear about the pure Python database, ZODB.
- 0:18There's Zerodb, an end-to-end encrypted database
- 0:22in which the database knows nothing about the data it's even storing.
- 0:25And NewtDB, spanning the world of ZODB and JSON-friendly Postgres.
- 0:30This is Talk by Thunderby, episode 105, recorded Thursday, March 16, 2017.
- 0:37Developers, developers, developers, developers.
- 0:40I'm a developer in many senses of the word
- 0:43because I make these applications, but I also use these verbs to make this music.
- 0:48I construct it line by line, just like when I'm coding another software design.
- 0:52In both cases, it's about design patterns.
- 0:55Anyone can get the job done.
- 0:57It's the execution that matters.
- 0:58I have many interests.
- 1:00Sometimes...
- 1:00Welcome to Talk Python To Me, a weekly podcast on Python,
- 1:04the language, the libraries, the ecosystem, and the personalities.
- 1:07This is your host, Michael Kennedy.
- 1:09Follow me on Twitter, where I'm @mkennedy.
- 1:11Keep up with the show and listen to past episodes at talkpython.fm
- 1:15and follow the show on Twitter via at Talk Python.
- 1:19This episode is brought to you interruption-free by GetStream.
- 1:23That's right, GetStream, a new sponsor of the show,
- 1:25has a really cool offer for you guys.
- 1:27If you're building an application that has some form of activity stream
- 1:31like you might see in Slack or Facebook or Instagram and others,
- 1:33then you owe it to yourself to have a look at GetStream.
- 1:36They provide scalable, reliable, and personalizable hosted API feeds as a service.
- 1:42The feed is the most intensive component of these types of applications,
- 1:46yet there's no need for you to reinvent the underlying feed technology
- 1:50when GetStream has the infrastructure and a Python API already in place.
- 1:54Go from zero to scalable feed in hours, not weeks or months.
- 1:58They even use advanced machine learning to serve up personalized results to each and every user.
- 2:03Stream powers the feeds for over 500 companies, including Makerspace and Fabric,
- 2:09with a total of 70 million end users.
- 2:11Try the API yourself in a short five-minute interactive tutorial at talkpython.fm/stream.
- 2:18Be sure to create an account and try it for yourself.
- 2:21It helps support the show.
- 2:22Jim, welcome to Talk Python.
- 2:25Thank you. It's nice to be here.
- 2:26It's great to have you here.
- 2:27We have a whole bunch of really cool topics generally around data, but not all data, right?
- 2:34So we're going to talk about ZODB, something called ZeroDB,
- 2:38which is something I'd never heard of and really interesting, actually.
- 2:41NewtDB.
- 2:42And then a little bit more process with some agile concepts and continuous integration and so on.
- 2:48But of course, before we get to all those, let's start at the beginning.
- 2:51What's your story?
- 2:52How did you get into programming?
- 2:53I was exposed to programming fairly young, although back then it wasn't very common or very accessible.
- 2:58I'd say I really got hooked in grad school when I was doing research on rainfall runoff model calibration.
- 3:06And I had to hack some alternate statistical techniques, calibration techniques, into a rainfall runoff model.
- 3:13And I found that I enjoyed that quite a bit.
- 3:15That became, for years, I was a civil engineer slash hydrologist.
- 3:20And the software aspect of it kept pulling me and pulling me until it finally extracted me.
- 3:27I think that's really interesting.
- 3:30A lot of people get into programming that way and somewhat grudgingly like,
- 3:35okay, I have to learn this programming thing to make whatever it is I'm doing actually work, right?
- 3:39But I sort of went down that path myself to some degree.
- 3:42And after a few years, I realized, actually, what am I doing this other stuff for?
- 3:47This programming stuff is really great.
- 3:48I'm just going to go do more of that.
- 3:49And it's funny how life is sort of serendipitous like that.
- 3:54But it's also good, right?
- 3:56So was that original bit of work?
- 3:57Was that in Python or was that in something else?
- 3:59Oh, no.
- 4:00That was in Fortran.
- 4:00Oh, yeah.
- 4:02Fortran.
- 4:02I mean, I went through a lot of languages over my career.
- 4:07That work was in 1981.
- 4:11Okay.
- 4:12So probably not Python.
- 4:14Yeah, definitely not Python.
- 4:16Because it was 10 years before it released.
- 4:17But, yeah, I've used a lot of different languages.
- 4:20I used Fortran for a long time.
- 4:22I used PL1 for a little while.
- 4:24I used ADA for a little while.
- 4:27I really like OO languages.
- 4:29I used – I couldn't afford Smalltalk for a long time.
- 4:32So I used a language called Actor for a while.
- 4:34And then much later, I did an interesting application with GNU Smalltalk, which was an adventure in and of itself because it was fledgling and the garbage collector was broken.
- 4:44So I had to use a special branch with a non-broken garbage collector.
- 4:47So anyway, I've had lots of fun with different languages over the years.
- 4:50Yeah, that sounds like you've really been through a lot of them.
- 4:53So are you doing mostly Python these days?
- 4:56Yeah.
- 4:57Although I did – a couple years ago at Zoap Corporation, we did a bunch of Android development.
- 5:02I got to use Scala, which I really enjoyed.
- 5:05I like to describe Scala as a beautiful evil language because it just invites so much abuse.
- 5:12But it allows you to produce beautiful code within the JVM and just insane, mind-blowing notions of type-based development where you – people do interesting development tasks in the compiler.
- 5:26Wow.
- 5:27That sounds interesting and evil.
- 5:30It was a lot of fun.
- 5:31I haven't done any of that.
- 5:32I did some Rust lately, which kind of reminded me of a lightweight version of that this last year.
- 5:37Sure, sure.
- 5:38Okay.
- 5:38Yeah, I've been wanting to learn Rust, but I haven't really gotten into it.
- 5:41I did look at Go recently this year, but I don't know.
- 5:44I'm just not sold on Go.
- 5:45I still like Python a lot better.
- 5:47We'll see about that.
- 5:48I'm actually very anti-Go.
- 5:50Yeah.
- 5:50I think it's bad on multiple levels, but I like Rust quite a bit.
- 5:54Okay.
- 5:54Well, that's interesting.
- 5:55Maybe I'll be learning Rust eventually.
- 5:56But what do you do day-to-day these days?
- 5:59You're not still at the Zope Corporation doing Android development, right?
- 6:01Nope.
- 6:02Nope.
- 6:02At Zope, I did a ton of different things.
- 6:05But towards the end, we were doing some Android development, among other things.
- 6:09But these days, I'm splitting my time between paid work to sort of keep the lights on and
- 6:15open source work.
- 6:16I got an opportunity to work with a company called ZeroDB about a year ago.
- 6:21That and also my sons are grown and they've moved away.
- 6:25And so we were sort of downsizing.
- 6:27So that was an opportunity to sort of have enough money and reduce my run rate and focus
- 6:33on some open source stuff for a while.
- 6:35And so that's really what I'm doing right now is paying attention to some open source
- 6:40projects that have been neglected for a while, as well as exploring some new ideas.
- 6:44That's really, really great.
- 6:46And it must feel really good.
- 6:49It must just be great to just stop, look at these projects that are pretty mature and say,
- 6:54okay, I'm going to work on these things.
- 6:55And I don't have to go to meetings.
- 6:57I don't have to hit some silly deadline that's not realistic or work on some feature that I
- 7:04think adds no value, right?
- 7:05Just be able to focus on what you want, right?
- 7:06Yep.
- 7:06Yeah.
- 7:07Excellent.
- 7:08So we'll be touching on some of these projects, I'm sure.
- 7:11So let's start with one of the older projects, I guess.
- 7:14It's been around since 1996 with ZODB.
- 7:16What is ZODB?
- 7:17So ZODB is an object-oriented database for Python.
- 7:21And when I say object-oriented, I contrast that with object-based because lots of people
- 7:26refer to databases that are object-based that I don't really consider object-oriented.
- 7:32The original goal of object-oriented databases, which were a pretty exciting thing back in
- 7:37the, I don't know, late 80s, maybe early 90s, was to try to reduce or eliminate the impedance
- 7:44mismatch between programming languages and databases.
- 7:47So in databases, you know, you have a very different computational model than you do in a programming
- 7:53language, especially some of the, you know, especially object-oriented programming languages.
- 7:57Yeah.
- 7:58You have hierarchies of object graphs in object-oriented languages, and you have highly
- 8:04normalized data that work to minimize duplication and let you approach the data from any angle
- 8:12you want.
- 8:12But there's always this.
- 8:14I pull it into Python and build it into an object graph, and then I tear it back into part
- 8:19into all the other tables and put it back again, right?
- 8:22So these object databases, they try to just say, let's keep them in the same shape, something
- 8:27like that?
- 8:28Well, again, I don't think there are many object-oriented, I don't know, I'm not sure I know of any object-oriented
- 8:34databases today other than ZDV.
- 8:36I mean, I'm sure there are some.
- 8:37My sense is that a lot of the object-based languages let you get objects, but they don't necessarily
- 8:43avoid having to do queries and doing assembly.
- 8:46Like, for example, some databases referred to as object-based seem to be more like graph-based,
- 8:50where you have the ability to query graphs, but it's still somewhat of a foreign object.
- 8:58I see.
- 8:59Like, when you use ZODB, there are some exceptions, but you have to subclass a special
- 9:03base class, and you have to identify transaction boundaries, which that latter aspect is usually
- 9:09automated, depending on your situation.
- 9:12But beyond that, it's literally just as if you were working with objects in memory.
- 9:17You don't really query a database.
- 9:19You know, the way you query a database is the way you query something in Python.
- 9:23You maybe look up a key in a mapping, or maybe you access an object's attribute.
- 9:28Accessing an object's attribute might cause data to be loaded from the database, but that's
- 9:33transparent to you.
- 9:34Okay.
- 9:34How interesting.
- 9:35So does it use, like, interesting descriptors or something like that for attributes to do
- 9:40that?
- 9:41That's where the base class comes in.
- 9:42So the base class, I can't remember.
- 9:44There must be a meta class.
- 9:45It's been so long since I've implemented it that I don't remember if there's a meta class
- 9:50lurking.
- 9:50I wouldn't be surprised if there was.
- 9:53But basically, yeah, the base class does a couple of things.
- 9:56I've actually had a project that I've wanted to do for some time, which is to get rid of
- 10:00the base class.
- 10:01I have some hacks in mind involving weak reference data structures.
- 10:04But basically, the base class, it watches attribute accesses.
- 10:09And so when you modify an attribute, it marks the object as dirty.
- 10:13And when you access an attribute, if the object is something we call a ghost.
- 10:18So in ZODB, when you first load an object from the database, typically by referencing it from
- 10:22some other object, it's loaded as a ghost.
- 10:24And then when you actually access an attribute, which includes any method, then the ghost is
- 10:30activated and its state is loaded into memory.
- 10:33I see.
- 10:33There's an in-memory object cache that is effectively an incomplete database replica.
- 10:40At transaction boundaries, any changes that have been made in the database by other clients
- 10:45are then cause any objects that were affected that are in your cache to be invalidated.
- 10:50And so then the next time you access them, they're loaded automatically.
- 10:53So the data in memory is always consistent with the committed database as of some point in time.
- 10:59Okay. Yeah. So you have transaction support and all those sorts of things as well.
- 11:03That's pretty interesting.
- 11:04So I can get an object from the database and pass it around.
- 11:07And maybe it was passed off to some other module.
- 11:10But eventually, that reference will be updated because someone committed a transaction.
- 11:15Right.
- 11:15The only sort of caveat there is that the data...
- 11:19So when you access the database, you open a connection.
- 11:21And on that connection is a root object.
- 11:23And then all other accesses you make are from that root object, possibly through many steps.
- 11:30And then there's an object cache associated with that connection.
- 11:32And so that connection, its cache, can only be accessed by one thread at a time.
- 11:36So you couldn't hand it off to a different process.
- 11:38And you couldn't hand it off to another thread and have both threads operating on it.
- 11:42But you can have multiple threads with their own database connections.
- 11:45And they're essentially coordinating their activities via transaction commit.
- 11:50Very much in the way that software transactional memory either was going to...
- 11:55I'm not sure this is the current status, but I should have looked it up.
- 11:57Much in the way that software transactional memory is supposed to do that for PyPy.
- 12:02Interesting. Okay.
- 12:03So I don't think I've talked about software transactional memory previously.
- 12:07Maybe you could just give us the quick elevator pitch for what that is.
- 12:11Well, it's like ZODB, but not persistent.
- 12:13I see.
- 12:15You know, there are lots of different sort of models for managing concurrency.
- 12:19And so some of the traditional models like locking are very expensive.
- 12:24And what a lot of systems have moved towards is something called the actor model, where you
- 12:31have different independent actors and message queues.
- 12:33And that's a model that works really well.
- 12:35But of course, it's fairly invasive.
- 12:37You have to architect your model or your application around that.
- 12:41I think what the PyPy people were wanting to do was to get rid of the GIL and trying to find some way to get rid of the GIL without being crushed by all the locking overhead of managing concurrency.
- 12:52So with transactions, you basically have multiple copies of the object space, possibly with shared and copy and write, etc.
- 13:00I'm not really super familiar with either their implementation or their status.
- 13:04But the idea is that you have basically different copies of memory.
- 13:09Those copies get synchronized when you reach a transaction boundary.
- 13:14And that means that at the transaction boundary, that's when you sync everything up.
- 13:18And everything else is completely independent.
- 13:20So you don't need any locks because you've only got one logical thread of control accessing the data.
- 13:25Right.
- 13:26And so that sounds really cool.
- 13:28Like, basically, it's a very optimistic view of the world, right?
- 13:30We're going to grab all this stuff in memory and we're going to try to make a bunch of changes.
- 13:33And it's probably fine.
- 13:34But if it's not fine, then we're actually going to have to retry that function or whatever that was working at it.
- 13:40Right. So there's this instead of taking locks, it'll basically restart parts of your code, which is really quite a different way of thinking about solving this problem, isn't it?
- 13:49It's how most modern databases work now.
- 13:52I know Postgres uses multiversion concurrency control, which is basically the same idea.
- 13:57I think Oracle does as well.
- 13:58But yeah.
- 13:59And so you sort of have to come to terms with what we call conflict errors.
- 14:03Yeah.
- 14:03Yeah.
- 14:04You have to instead of being blocked, you have to deal with here's how I resolve it when something went wrong.
- 14:09I mean, it's fine if it's all within one database or within your memory.
- 14:13But if I've called two web services and written a file and then it says, no, no, roll back.
- 14:19Right.
- 14:19Well, now what, right?
- 14:20Yep.
- 14:21Already charged your credit card.
- 14:22Roll back.
- 14:22What are you talking about?
- 14:23Yep.
- 14:23So it's just a, yeah, it's interesting.
- 14:26So would you call ZODB a NoSQL database?
- 14:30I mean, was it NoSQL before NoSQL is a thing?
- 14:33Well, one of the stories I like to tell about how I learned Python was I was at USGS and we were using this system called RANDRDB, which was based on an earlier system.
- 14:45But basically it was based on managing relational data as flat files.
- 14:49And since I stopped using that project, it sort of evolved and it called itself NoSQL because it didn't use SQL.
- 14:56Right.
- 14:58Really, NoSQL is a terrible name.
- 15:00To me, in my mind, modern NoSQL databases have nothing to do with not having SQL.
- 15:05Yes, I agree.
- 15:06Some of them do have SQL.
- 15:07You know, really the, the, a better characterization of the, most of the NoSQL databases that I'm familiar with is that they're no transaction.
- 15:16And they're no transaction because transactions at some point do limit scalability.
- 15:23Although there's, you know, continuing to be work to make databases like Oracle and Postgres scalable even with transactions.
- 15:30But the NoSQL databases have much weaker notions of consistency and really are optimized to allow very fast writes.
- 15:38And I, the sort of problem domain that I think they're really well suited to is collecting massive amounts of data that you collect and, and analyze, but never really have to update and aren't really part of any business processes.
- 15:50Some kind of analytics or something.
- 15:51Right.
- 15:52And so, so in that sense, ZADB is not a NoSQL database, but it doesn't use SQL.
- 15:56Although with Newt, you can, you can now start to leverage SQL in ZADB.
- 16:02Yeah.
- 16:03We'll talk about Newt as well.
- 16:04Yeah.
- 16:04I saw a really great quote by somebody who was trying to talk about NoSQL and said something like, my toaster doesn't use SQL.
- 16:10Is it NoSQL?
- 16:11No.
- 16:12I'm a better definition.
- 16:14And I really feel like, I feel like, like my definition and your definition are probably quite similar from what you said.
- 16:20I feel like NoSQL databases are the ones that give up some relational features in order to be more scalable, possibly more horizontally scalable, things like that.
- 16:31Right.
- 16:32Like a lot of them give up joins.
- 16:33A lot of them give up transactions, but not all of them.
- 16:37Right.
- 16:37They, they give up different things here and there for different things to optimizing.
- 16:40I'm not aware of many, there was a foundation DB, which is no longer a thing that had transactions, but some databases will talk about atomicity, but their notion of atomicity is kind of laughable because, well, we update a single record atomically.
- 16:57Yes, exactly.
- 16:58But that's not really, I'm sure there's some NoSQL databases out there that are transactional, but if there are, they're probably not scalable the way that some of the other ones are.
- 17:08I mean, I think that's, I, to me, in my mind, transactions are the big trade-off.
- 17:12And I think it's a trade-off that most people don't really understand.
- 17:16Yeah, I think you're probably right.
- 17:17If I, if I think of them, the one, the thing they give up first is probably transactions.
- 17:20The thing they give up second is probably joins.
- 17:22Right.
- 17:23I mean, MongoDB does have the isolated operator, which does let you work on multiple documents, but it's, it's not quite the same as, as this just global isolation level serializable that you get in a lot of relational databases.
- 17:36Well, and in fact, the giving up joins is really closely related to that because giving up joins means that there are more problems for which only being able to do one operation at a time atomically makes sense.
- 17:48Yep.
- 17:48Absolutely.
- 17:49Nice.
- 17:49Okay.
- 17:50So if I want to use ZeoDB, how do I get started?
- 17:52Can I just pip install it?
- 17:53Yep.
- 17:53Okay.
- 17:54What's it written at?
- 17:55Is it written in Python?
- 17:55Yep.
- 17:56It has some C extensions.
- 17:57It has some C extensions, but it also works with PyPy.
- 18:00There's all of the C extensions have Python versions.
- 18:03Right.
- 18:03So if you run it with, if you run it with PyPy, then it'll, it'll use the Python versions.
- 18:08And zeoDB.org has some pretty decent documentation.
- 18:11I was, I was noticing yesterday that I, some topics that I need to add, but getting started is pretty easy.
- 18:17You can run it with an in-memory database if you want, just while you're playing around.
- 18:21Okay.
- 18:21Yeah.
- 18:22That's really nice.
- 18:22Nice for testing as well, right?
- 18:24Well, it's testing stories is especially strong.
- 18:27ZeoDB has a, what I call a pluggable storage architecture.
- 18:31So the, there's a defined API or set of APIs that storages can provide.
- 18:36And then there are a bunch of different storage implementations ranging from an in-memory implementation to a, a file-based implementation to a client server implementation to, or to an implementation that sits on top of, well, there are a couple of client server implementations actually.
- 18:53And then there's a implementation that sits on top of a relational database.
- 18:56And then there are also, we sort of follow a pattern of, of layering those with adapters.
- 19:01And so one of the interesting adapters for testing is something called the demo storage.
- 19:06And with a demo storage, you have a demo storage, wraps two storages, a base storages, a storage and a changing storage.
- 19:14Okay.
- 19:14And so in testing, what you'll typically do is you'll have for a suite or a set of tests, you'll, you might set up a base database.
- 19:22And then each test will use a demo storage on top of that.
- 19:26And then, you know, whatever changes are made are made in the changes.
- 19:29And then the demo storage is discarded.
- 19:31And then next test creates a new one.
- 19:33Oh, that's a really cool feature because one of the super painful things of testing is, well, how do I load up the test data?
- 19:39How much is enough to be representative, et cetera, et cetera.
- 19:42So you can put like, a snapshot on top of the data in a sense, right?
- 19:46Basically.
- 19:46And you can layer that as many levels deep as you want.
- 19:49In fact, we've had, I've written Selenium tests where basically there were sort of push and pop operations on your database.
- 19:55So you make some changes and then push another demo storage on top of that.
- 20:00And then for, for staging, what, what, what we've often done was to, one of the, one of the layers, one of the layers you can add is something called a before storage.
- 20:08And what it does is it wraps a, a, a, a writable storage, like our client server storage.
- 20:12But it, it, it says, okay, only show me the data as of this point in time.
- 20:17And then that becomes the base for a demo storage.
- 20:20And then you have a file storage as your changes.
- 20:22And now you can stage a large production database, make substantial changes to it, but it's all in, in, in this sort of layered snapshot.
- 20:30So, which you can then discard after staging and it doesn't affect any of the actual production data.
- 20:37Yeah, that's really cool.
- 20:38Okay. So that sounds like the storage system is, is really robust there.
- 20:43And of course that's going to play into zero DB when we get into it.
- 20:48But let me ask you two quick questions on zero DB before we move on.
- 20:52When is it a good idea to use zero DB?
- 20:54Like what's the ideal use case for this?
- 20:57I think a really good use time to use it is when you don't want to spend a lot of time writing software.
- 21:01Yeah, sure.
- 21:03So it makes writing software a lot easier in a lot of ways because you're, you're, again,
- 21:08you've, you don't have that database impedance mismatch.
- 21:11Does it store things in the basically pickled form or something to that effect?
- 21:16Right.
- 21:16Okay.
- 21:17So you could just say, these are the things I want in the database, put them in the database
- 21:21and they're the database, right?
- 21:22As long as, as long as they're pickleable.
- 21:23And we could or could not have a discussion about pickle.
- 21:26Pickle, pickle, pickle has a bit of a bad reputation.
- 21:30That's a little bit fudtastic.
- 21:32Yeah, sure.
- 21:34But, but anyway, yeah, it basically uses pickle.
- 21:36So you can store anything that's pickleable.
- 21:38All right.
- 21:39Nice.
- 21:40And you talked about the good testing story as well.
- 21:42When should we not use ZODB?
- 21:44You shouldn't use ZODB.
- 21:46And I think this is changing actually, but.
- 21:49Maybe it's being changed by things like NewtDB, right?
- 21:52Well, it's being changed by, for example, when, when you, I think Newt, I think Newt can help
- 21:57quite a bit.
- 21:58Yeah.
- 21:58Because ZODB can sit on top of say Postgres or Oracle, it can scale more or less as far
- 22:06as they can scale.
- 22:06Right.
- 22:07Okay.
- 22:08Traditionally, ZODB has managed its own, provided its own search facilities on the client side.
- 22:13And so you, when you do that aggressively, you end up with lots of extra objects in the
- 22:19database to support indexing.
- 22:21So, so there are ZODB based implementations of B-trees.
- 22:24And then on top of that, various sorts of indexes like inverted indexes and regular B-trees
- 22:29indexes and things that are sort of like Postgres GIN indexes a little bit.
- 22:35But that tends to bloat the database quite a bit and cause lots of extra rights and lots
- 22:39of opportunities for conflicts.
- 22:41So I've in the past sort of said, well, don't necessarily use, if your application is very
- 22:46search intensive, then maybe you don't want to use ZODB.
- 22:50If your application is sort of object intensive and, you know, you're, you're primarily working
- 22:55on application objects and traversing application objects, then, then it's a much better fit.
- 23:00But I think especially with Newt, by pushing the search back into the relational database,
- 23:06it can greatly reduce some of the challenges.
- 23:10And plus you just have a much more powerful search engine.
- 23:12Sure.
- 23:13So let's talk about NewtDB a little bit, then we'll come back to ZODB.
- 23:17So Newt is kind of a marriage between ZODB, which we talked about a lot of the features
- 23:23there.
- 23:23And it's one of its shortcomings, I guess you could say, is it is really hard to query.
- 23:28You talked about how your app is search intensive, then maybe you don't want to use it because
- 23:34this is not really normalized.
- 23:36It's not flat text and integers and stuff in columns, but it's object graphs as binary
- 23:42stuff.
- 23:42So doing that is challenging, but something like Postgres is really good at storing that
- 23:49data and querying it.
- 23:50So NewtDB, you called this the amphibious database, which I think is really interesting.
- 23:55Right.
- 23:56What is it?
- 23:56Okay.
- 23:56Well, I'd like to argue with your previous assertion, but let's, let's come back to that.
- 24:00Which one is that?
- 24:02Well, so in terms of searching, it's the issue isn't so much that the search capabilities
- 24:07of ZODB catalogs, which is sort of the common pattern for this, are not really that different
- 24:13from a lot of the NoSQL database search mechanisms.
- 24:17In fact, a lot of the NoSQL mechanisms, even something like SQLAlchemy, to a fault, I think,
- 24:22tries to express searches as data.
- 24:25And so the catalog is often quite good at that.
- 24:29In fact, if you're indexing data fits in memory, the search, the searching in ZODB, I mean, I've
- 24:36seen it actually smoke Postgres.
- 24:39Wow.
- 24:40Okay.
- 24:40But for larger databases where it's not all in memory, then, you know, Postgres ends up
- 24:45being a win.
- 24:46But it's not so much that it's hard to search, other than that you can't use SQL.
- 24:50But I think most humans can't use SQL anyway.
- 24:52Right.
- 24:53But anyway, so the ease of search is debatable, but I think it's reasonable to expect that on
- 25:00average, Postgres is going to do a lot better.
- 25:02And so the reason I called Newt the amphibious database was that it sort of gives you two views
- 25:09on your data.
- 25:09It gives you a very Python-centric, object-oriented view on your data via ZODB.
- 25:13One of the problems that traditional object-oriented databases have had in terms of what they've
- 25:20been criticized for is that they're kind of closed.
- 25:22They're limited to a single language.
- 25:23And they may even depend very heavily on the classes.
- 25:27I mean, that's the whole point is, you know, in ZODB, when you're storing objects, they're
- 25:31objects that have specific classes.
- 25:32And traditionally in ZODB, if you wanted to access the data, you had to have the class around.
- 25:37So it's a little bit more of a restrictive environment.
- 25:40Right.
- 25:41So if I want to call it from like JavaScript, it's not going to be fun.
- 25:44Right.
- 25:44Right.
- 25:44So what the idea is, is in Newt, you've got your regular OO Python view of your data.
- 25:51And then you also have a Postgres view of your data.
- 25:53And in Postgres, you can see your data as JSON.
- 25:56You can access it from anything that can access JSON in Postgres.
- 26:00So you could conceivably write reporting applications that reported against it.
- 26:04You can index it and you can search it using PostgresQL.
- 26:08Okay.
- 26:09Interesting.
- 26:09So basically it stores two copies of any given record and it keeps them in sync.
- 26:13One pickled version and one JSON version.
- 26:16And then you leverage the JSON capabilities of Postgres to work with that thing from other
- 26:21languages.
- 26:22Okay.
- 26:23There's also sort of lurking around there some interesting patterns about synchronizing
- 26:28your data.
- 26:28So Newt has sort of two modes you can use it in.
- 26:32It has the sort of default mode where it writes the JSON data as it's committing the transaction.
- 26:37But there's also sort of asynchronous mode where you can run a separate updater process that
- 26:43watches the database and generates the JSON asynchronously.
- 26:47And one of the things I think that's interesting about that is that you can generalize that.
- 26:52So you could, for example, eventually, instead of updating JSON in Postgres, you could update
- 26:59an Elasticsearch database.
- 27:01Or you could even conceivably asynchronously update a relational representation of the data.
- 27:06Right.
- 27:06Exactly.
- 27:07Right now you're just taking it and turning it into JSON because it's such a close fit.
- 27:12But theoretically, you could have a SQLAlchemy type representation as well.
- 27:18Something to that effect, right?
- 27:20So what flexibility does the Postgres add besides just other clients or other technologies?
- 27:27Is there better searching?
- 27:28Can I work with more data?
- 27:31What's the story?
- 27:32Postgres has a large community behind it.
- 27:34So there are lots of people working on scaling Postgres in various ways.
- 27:38So yes, I'm sure you can work with more data than you can with, say, the built-in client server
- 27:45storage in ZODB.
- 27:47Although there is a project called Neo where they're doing some interesting things in terms
- 27:52of scaling database without Postgres.
- 27:56But also, Postgres has this interesting model.
- 27:59I don't know if Oracle does this, but in Postgres, when you create an index, you can index expressions
- 28:07rather than indexing columns.
- 28:08Okay.
- 28:09And that gives you a lot of power.
- 28:11So for example, if you're building a text index, you can have, instead of saying, I want to
- 28:16index this column, you can say, well, here's a Postgres function, which could be written
- 28:20in Postgres's stored procedure language, or it could conceivably be written in Python.
- 28:27But here's a function that will extract the text from this data record.
- 28:32And this function that's extracting the text from the data record could actually make queries
- 28:37and get text from related data records.
- 28:40We're actually using that in the project.
- 28:42And then what happens is then you say, okay, now I want to build an index on this function.
- 28:48And what happens is that at index time, it goes through the data and calls that function,
- 28:54gets the result of that function, and builds the index based on that.
- 28:57And so the function could be doing pretty interesting, possibly expensive things,
- 29:03and none of that has to happen at search time.
- 29:06It can all happen at index time.
- 29:08Right.
- 29:09Okay.
- 29:10That's really interesting.
- 29:10So basically, your inserts might get a little slower and your updates might get a little slower,
- 29:15but it could be really worth it if it dramatically improves your query speed.
- 29:19Something that came to mind, I was thinking, it's like, well, if you have, say, an email address,
- 29:23you could index just the domain part of the email address.
- 29:27I want to find everybody in this company, which has this google.com or whatever in there,
- 29:33their email address, right?
- 29:34Would something like that?
- 29:35Absolutely.
- 29:36Okay.
- 29:37Absolutely.
- 29:37Well, for example, I think most people index their, in Postgres, for example,
- 29:42when you have a text column, and it's not a free text.
- 29:45It's like a person's name or a city name or something like that.
- 29:49I think most people tend to index those incorrectly because they index it based on,
- 29:56just by creating an index on the column.
- 29:59And A, there's a certain way that you build those indexes so that they're usable in like queries.
- 30:06But also, if you want it to be able to search a case insensitively,
- 30:11what you really need to do is you need to index calling lower on it.
- 30:14Exactly.
- 30:15Yeah.
- 30:16Yeah.
- 30:17I find that lowercase, lowercase or case insensitivity in a lot of databases can be really challenging
- 30:24if you want to index the thing that has to be case insensitive, right?
- 30:27You've got to maybe even change your schema a little bit,
- 30:30like store the original and a lowercase version and put the index on the lowercase version
- 30:34or something funky like that, right?
- 30:36But you don't have to do that.
- 30:37See, that's the beauty of this feature of Postgres.
- 30:40And I have to be careful to say this feature of Postgres because I don't know that it's not
- 30:44in other databases.
- 30:45But this pattern of indexing expressions is wildly powerful.
- 30:50And it's one of these things that people should zen up on because once you start thinking about
- 30:57it that way, then lots of doors open up.
- 31:00Yeah.
- 31:01It sounds really powerful to me.
- 31:02And I can certainly think of some places I would have used it had I had it available,
- 31:07but I don't.
- 31:08Another interesting example is that in a lot of applications that I work with, the data are
- 31:13hierarchical.
- 31:14Think of a content management system where the content is arranged hierarchically, possibly
- 31:19by organization.
- 31:20And there's often interesting security policies about what you can access based both on who
- 31:26you are and where you are in the tree.
- 31:27And so you can – and the most common – the sort of most common case is to ask, can you view
- 31:35this document?
- 31:36And so you can write a function that says, okay, for any particular piece of content, which
- 31:42principles can view this document?
- 31:44And then – and you can write a function that returns an array of principles that indexes that
- 31:49document and then create something called the GIN index, which is basically an inverted index
- 31:54that allows you to say, okay, here's a set of principles.
- 31:57Can any of them view this document?
- 31:59Where the set of principles may be the user and the groups that they're in.
- 32:02Yeah.
- 32:03And you basically can say, okay, can this set of principles access this particular record?
- 32:08And that can be an index query, even though in order to make that decision, at some point
- 32:13you have to walk the tree to find all the security assertions.
- 32:17Excuse me, security assertions.
- 32:19Yeah, yeah.
- 32:20You can have sort of inherited security stuff that flows down the tree and use your little
- 32:25function to build the index without actually putting on every single level.
- 32:29Okay.
- 32:30That sounds awesome.
- 32:31All right.
- 32:32So NewtDB is definitely an interesting project.
- 32:36What's – how does its, like, ideal use case vary from, say, ZODB?
- 32:42Well, it addresses two of the major objections to ZODB.
- 32:46I would say the major objections to ZODB would be it's transactional, which I believe limits
- 32:53scalability at some point, although, again, that limit is getting higher and higher all
- 32:56the time.
- 32:57But the other – and I actually think that's a limitation that most people should ignore.
- 33:01But then I'd say the two biggest objections are the searchability and the overhead associated
- 33:08with trying to support that and the complexity associated with trying to support that and access
- 33:13from outside.
- 33:13So people with ZODB databases, there's a temptation to feel like their data is imprisoned, especially
- 33:19if you're not very familiar with the technology.
- 33:22So Newt basically gives you – sort of makes the datable accessible without Python, without
- 33:28any special skills.
- 33:29It's just sort of sitting there in JSON.
- 33:31You can search it using a much more powerful search mechanism.
- 33:34Now, you still – you know, there's no free lunch.
- 33:37So you can search it using clever tricks like indexing functions against the JSON, but you
- 33:43have to learn how to do that.
- 33:44And you have to understand how to use Postgres as explained so you can see how the query optimizer
- 33:52is analyzing the query.
- 33:55Sure.
- 33:55That's a good thing to do anyway if you're working with data.
- 33:57Know how to ask, are you using an index?
- 34:01Which index are you using?
- 34:02And so on.
- 34:02Right.
- 34:03But still, interesting.
- 34:05Okay.
- 34:05Can you update the JSON and have it update – those updates flow to the ZODB Python side?
- 34:11Or is it read-only on the JSON and read-write on the ZODB side?
- 34:16The latter.
- 34:16Okay.
- 34:17Yep.
- 34:17The JSON is a read-only representation.
- 34:19Gotcha.
- 34:19Okay.
- 34:21That seems pretty reasonable.
- 34:22All right.
- 34:23Very, very nice.
- 34:24So let's come back and talk about ZODB.
- 34:27So the ZODB stuff that you've been doing kind of led you to work with ZODB.
- 34:32And they actually were the catalyst for a really cool move for you.
- 34:36But let's start with just what is ZODB?
- 34:39Well, so ZODB was about trying to have your data be encrypted at rest.
- 34:44So the only client – so with ZODB, the goal was that only the database client, the applications would be able to unencrypt the data, would be able to access the data because the encryption would happen on the client.
- 34:57Right.
- 34:57There's different levels of encrypted at rest.
- 35:01But you're talking about even encrypted in the memory of the database, and the database itself can't get it, right?
- 35:06That's a different level than I've set up a file system where when I save the data finally to disk, that part is encrypted.
- 35:13Like there's more to it than just that, right?
- 35:15Well, not much more to it than that.
- 35:17I mean, it was certainly encrypted in the memory of the database server.
- 35:20So the database server itself couldn't see the data.
- 35:23But by the time it reached the application, it was unencrypted in the application's memory.
- 35:28Sure.
- 35:28So they sell this – they position this as a really great database for the cloud because your data might live in the cloud.
- 35:38But even if somebody were to get access to it and, you know, walk away with your virtual machine in some unknown way or even just log into the database server, potentially your data is still safe, right?
- 35:50Right.
- 35:51Okay.
- 35:51That's pretty unique.
- 35:52I don't really know a lot of other databases that have that.
- 35:55And the fact that, you know, one of ZVDB's – I mean, a decision that I made a long time ago with ZVDB was that the search – basically all the sort of application logic would happen on the client, that the server was really dumb.
- 36:11That was partly a reflection of my ability to write a smarter server.
- 36:15But that actually, you know, fit ZeroDB's use cases really well because, you know, by doing everything on the client, only the client needs to have unencrypted data.
- 36:26I see.
- 36:27So basically the client or the application, even if it's like a web app, it has some kind of private key that it can decrypt its data with.
- 36:35So how does it do queries and things like that?
- 36:37In ZVDB, when you're – in doing a query the sort of the traditional way, you're accessing B-trees and higher-level facilities built on B-trees that are regular database objects just like any other object.
- 36:52So they're encrypted.
- 36:54They're part of your database.
- 36:55So when you – let's say that you want to look up something in a B-tree.
- 36:59What happens is you access the top of the B-tree and that gets loaded from the server.
- 37:04And then you start walking the nodes of the B-tree to find the value you're looking from.
- 37:08And those nodes get loaded from the server as necessary.
- 37:11And then they're all cached locally.
- 37:13I see.
- 37:13Then the execution of the actual way of clause or whatever happens on the client.
- 37:21And so you said it was the 0DB guys that made it possible for you to make this transition to sort of being independent, working on these open source projects and so on.
- 37:29Yeah.
- 37:30Yeah.
- 37:30You want to tell us that story?
- 37:31Well, I don't know that there's much to tell.
- 37:33They needed some scalability help.
- 37:38And also they didn't really have a lot of deep knowledge of ZODB.
- 37:40So I could sort of provide a lot of help in terms of how they architect their application.
- 37:46They funded – the sort of client-server part of ZODB was written a long, long time ago and it used async core.
- 37:54And it really needed to be modernized for performance, for maintainability, and also to facilitate adding SSL support.
- 38:05Sure.
- 38:06And so they funded that along with a bunch of other work.
- 38:08Nice.
- 38:09And I saw they released 0DB on GitHub not too long ago.
- 38:13So that's pretty cool.
- 38:13They've really sort of switched gears.
- 38:15In fact, I think they've renamed the company.
- 38:17So I don't think that the project of 0DB on top of ZODB – I don't think it's actually active at this point.
- 38:24Okay.
- 38:24Their customers were banks and that sort of financial people.
- 38:29And so having a Python database wasn't really all that interesting to them.
- 38:34Sure.
- 38:34And so they've changed their focus towards dealing with big data.
- 38:39And I don't really know all the details, but basically it's the same sort of thing.
- 38:44Your data is encrypted at rest, but while you're processing it, then it's encrypted in the processing pipelines.
- 38:52Sure.
- 38:53Okay.
- 38:53I see maybe they've changed the underlying storage engine, but the general idea is still probably more or less the same.
- 39:01There's three databases that are probably not super familiar to people.
- 39:06Four if you count Postgres, but that one's more familiar to folks.
- 39:10I think it's really interesting to look at all these different tradeoffs and study the different databases.
- 39:14It gives you a sense for what the value of the tradeoffs are, right?
- 39:19Yep.
- 39:19Yeah.
- 39:19Cool.
- 39:20All right.
- 39:21So let's switch gears just a little bit towards the process side of things and talk about two projects that you're working on.
- 39:27One, a tool for continuous integration like things, and one that's more about Kanban type stuff.
- 39:35So first one I want to talk about is Buildout.
- 39:39So this is an automation tool written in and extended with Python.
- 39:43So is this a continuous integration server, or is this more than that, or what is Buildout?
- 39:49It's something different than that.
- 39:51So it's really about, let's say you want to work on a Python project.
- 39:56So you check out the code, and now you want to actually run stuff.
- 40:01And so for a lot of people, what they do is there's a requirements text file sitting around.
- 40:06Maybe they create a virtual ENV, and then they run pip against that requirements.txt file.
- 40:11Or sadly, what many people will do is they'll just run pip from their machine's system Python
- 40:18and install a bunch of things in there, and then they'll have things in there.
- 40:22And then they'll run whatever scripts are generated.
- 40:26And if the scripts need configuration files, well, maybe they'll write them,
- 40:30and they'll check them into version control.
- 40:33And if they need extra processes on top of that, it's sort of outside the realm of pip.
- 40:39And then the question is, well, what do you do to automate all of that?
- 40:42And so Buildout, you know, when we were working on projects many years ago at Zoop Corporation,
- 40:49we would, and this was actually before there was even distutils,
- 40:53we were in a mode for a while of creating applications for customers.
- 40:57And then the customers would run them on their machines,
- 41:00and their environments were totally different.
- 41:02Their environments were typically completely uncontrolled,
- 41:04and usually bad things would happen.
- 41:06And so we needed to automate that.
- 41:09And in those days, the automation typically involved building Python from source
- 41:14because most people's Python environments are in an unpredictable state.
- 41:17Okay.
- 41:18So you would get like some well-known version and download it and compile it and say,
- 41:22we're going to start from here?
- 41:23Well, not just, the biggest problem isn't the well-known version,
- 41:27although that certainly is part of it, but the contents of site packages.
- 41:30Right. Okay.
- 41:31Over the years, that evolved.
- 41:32And so Buildout was very much geared towards installing exactly the packages you need
- 41:39and then generating the artifacts around that.
- 41:41So, for example, I have a project related to the Kanban where the JavaScript client is significant,
- 41:48and I need to assemble all those artifacts.
- 41:50And I, maybe I'm old-fashioned, but it offends me to check them into version control.
- 41:55Yeah.
- 41:55I have a Buildout configuration that among the things it does is it runs Grunt to,
- 42:00what is it Grunt or, I forget what it runs, maybe Grub.
- 42:03It runs some JavaScript tools to assemble all the JavaScript requirements.
- 42:08And, of course, it uses Buildout's own mechanisms to assemble the Python requirements.
- 42:13It generates configuration files that something like PaceScript would need to use.
- 42:18It generates daemon configs.
- 42:22So, for example, when I run the process, I usually don't run it in the foreground.
- 42:25I mean, I may, but I may want to run it in the background.
- 42:28And so there's a tool called zdaemon, which is kind of like SupervisorD, but a little bit more.
- 42:34Okay.
- 42:35A bit simpler.
- 42:36And so that has a configuration file.
- 42:38Or if you're using Supervisor, you would want to have a Supervisor configuration file.
- 42:43And those files may depend on things that are specific to your environment.
- 42:48They might depend on, you know, files that are outside the environment that have paths in them.
- 42:53I mean, there are all sorts of reasons why you may not be able to have static configurations that are just checked in.
- 42:59Right.
- 42:59Okay.
- 42:59So Buildout will look at the system, look at all the requirements, and put it together in just the way needed for that location, huh?
- 43:07That's one way of putting it.
- 43:08Basically, with Buildout, you give it a single configuration file that represents all of the parts of what you're trying to deploy, whether you're trying to deploy to production or to CI or staging or to production.
- 43:21And it basically says, okay, I've got all these parts that I need to build, and it just basically builds them.
- 43:26And it also keeps track of what it's built so that it can unbuild them.
- 43:29And, like, if a part specification changes, it knows to uninstall what it did before and then reinstall it.
- 43:37Okay.
- 43:37That's really cool.
- 43:38How much of this is a general software assembly tool and how much of this is for Python projects?
- 43:44Like, could I work on a C++ project only with Buildout?
- 43:48You could.
- 43:49And there are people using Buildout in non-Python environments, but the vast majority is Python.
- 43:54Right.
- 43:54Because it's written in Python.
- 43:55People, Python folks are automatically attracted, you know, disproportionately to it.
- 43:59Right.
- 44:00And, of course, it has built-in support for assembling Python applications in a particular way that's interesting.
- 44:06Right.
- 44:06Okay.
- 44:07There's a project called SlapOS, which seeks to be a lightweight virtualization environment that's built on top of...
- 44:14Buildout.
- 44:15And the things that they deploy in that environment, the vast majority of them are not Python.
- 44:20All right.
- 44:21Yeah, that sounds really interesting.
- 44:22Cool.
- 44:23One of the comments you made on the page is that software deployment should be highly automated and really should be able to, like, run one or two commands and just you're ready to go.
- 44:34And I feel like the more of that that we can do, the better.
- 44:38The more frequently we're at least smaller versions because it's not such a challenge for people to get the new version and all sorts of stuff.
- 44:45So I think that's a great philosophy there.
- 44:48And I think that the sort of DevOps movement has kind of gotten stalled in too much of an ops rut.
- 44:54So I see way too little automation in a lot of things that I see.
- 44:59At Zone Corporation, we had things to the point where basically we had a representation of our system as a tree that we stored in Zookeeper.
- 45:11Each service was, you know, anywhere from two or three to ten lines of very high-level specification.
- 45:17And then we had textual models of our entire system for multiple customers and multiple services and multiple applications and how they interconnected.
- 45:26And when we wanted to deploy a change, all we did was modify that tree and check it into Git.
- 45:33That's really cool.
- 45:35And a few minutes later, it would be deployed.
- 45:36Yeah, that's the way it should be, right?
- 45:38Definitely the way it should be.
- 45:41Cool.
- 45:42Okay, so let's talk about your final project called Two-Tiered Kanban.
- 45:47So I suspect most people know what Kanban is, but maybe you just give us the elevator pitch and then we can talk about the two-tiered version.
- 45:55Sure.
- 45:55The compelling thing about, well, there's sort of two compelling things about Kanban.
- 46:00And one is sort of philosophical, which is that it's very focused on providing value as quickly as possible.
- 46:05Whereas in contrast to something like Scrum that I think focuses on doing work.
- 46:10Sure.
- 46:11So the concept of providing value as quickly as possible.
- 46:15We sort of grew this culture at Zove Corporation both as part of trying to be better software developers as well as trying to follow some lean startup kinds of ideas.
- 46:29Part of that was related to the fact that we could develop software and check it into Git, but until it was actually in front of customers, it wasn't really providing any value.
- 46:38And then the other part of it is really sort of old-fashioned common sense of finish what you start, which Kanban has the highfalutin term of work in progress, limiting work in progress.
- 46:53But that's just a fancy-pants way of saying finish what you start before you start something else.
- 46:57Right.
- 46:57Don't put more stuff on the board.
- 46:58Yeah.
- 46:59Get it to the end.
- 46:59Right.
- 47:00Then you put something on the board, right?
- 47:01This is kind of like Trello boards if people haven't seen the Kanban boards, right?
- 47:04You've got the columns.
- 47:05You move the cards from left to right, like from planned to assigned to in-dev and test, whatever.
- 47:12But you said that, or the project says, that typical Kanban boards focus on development.
- 47:17And products don't, just because they've had development done on them, don't provide value.
- 47:22They provide value in features, land, and customers' hands, hopefully through a single button press to deploy them, right?
- 47:28And actually, when we started doing this, we were nowhere near a single button press.
- 47:31So being able to track things beyond development was actually pretty valuable.
- 47:35And often, even with a single button press, there are things that you have to do.
- 47:39Like, for example, if your schema changes, you may have to migrate the schema, and you might have to do that before the software is deployed, and there are things.
- 47:47But I'd put it a slightly different way.
- 47:49So a traditional Trello board or a traditional Kanban board, or even a Scrum board, you have all these trees sitting on the board, but you can't really see the forest.
- 47:59Scrum addresses that a little bit through Sprint.
- 48:02So perhaps in a Sprint, you're all focused on a single goal, which is good.
- 48:07But whereas, you know, the problem with Kanban is it's always been just sort of this sea of separate tasks, and it's hard to know how they relate, and it's hard to know how they relate to value.
- 48:18This idea of two-tier Kanban, which, you know, I read about as I was learning about Kanban, but have to this date never really found an implementation of, although I've heard rumors of implementations.
- 48:30The basic idea of a two-tier Kanban is that you have a high-level Kanban that represents units of value, typically, you know, features.
- 48:40Right.
- 48:41Where a feature may require a number of development tasks, and ideally as few as possible, but sometimes, for example, there might be a new feature that requires lots of UI components, and then lots more sort of below the waterline.
- 48:54Right.
- 48:54Like the designer work, the database work, the APIs to make it go, the data, the backup, the management.
- 49:01There can be many things, right?
- 49:02Right.
- 49:02Of course.
- 49:03So the idea is that you want to be able to have – you want to be able to represent the feature as a whole, the value as a whole, and really focus on moving that value to completion and getting the benefit of it.
- 49:15But you also need to be able to manage the things that make that up.
- 49:18And so you have this high tier, which is the features, and then the low tier, which is, you know, once you've entered development, all the things you need to do to actually, you know, implement that feature.
- 49:29And so typically what you have is you have a board where you have features that move across various columns, and then they hit the development column, and then they explode into the various pieces that make up that feature.
- 49:40Okay.
- 49:40And each – yeah, each one of the things that moves down the board that is a feature, that's basically its own Kanban board as well, right?
- 49:48Essentially, yeah.
- 49:48Yeah.
- 49:49Okay.
- 49:50That's the two-tier part.
- 49:50Yeah, it sounds really valuable to me.
- 49:52I always find these hierarchical things in Scrum or in Kanban really hard to deal with, like, okay, well, this feature costs this much, but the thing I'm working on actually costs this other thing, and someone else has to work on the data part of it, and they need to estimate that.
- 50:07And just, you know, it's challenging to represent those.
- 50:11So this seems like a nice way to organize it.
- 50:13And it provides a little bit of automation around that.
- 50:15I mean, you know, most Kanban people will sort of poo-poo estimation.
- 50:20And I've been around enough people who needed estimates to know that you can't sort of completely punt on that.
- 50:27But I really am a fan of really low-rent estimation and then automation to track the low-rent estimates and basically keeping the process really simple.
- 50:38I've been exposed to some environments, some Scrum environments where, and I think this is actually the norm, is that people sort of go through a bunch of motions, and there's a lot of ceremony.
- 50:49And a heck of a lot of time gets sucked up in ceremony.
- 50:53Right.
- 50:53Yep.
- 50:54I've seen it as well.
- 50:55Okay, cool.
- 50:56So we'll definitely include a link.
- 50:58And the link goes to a GitHub project that looks like it is executable code.
- 51:02What do you actually get when you go to that GitHub repo?
- 51:05Well, you get – right now you get a substantial amount of bit rot.
- 51:08Okay.
- 51:10But that's why I need to – I want to get back to it.
- 51:14Some of the bit rot is because initially I punted on authentication and used Persona, Mozilla Persona Project, which actually worked really well, but it relied on Mozilla doing a bunch of work.
- 51:27And they finally got tired of doing that work.
- 51:29And so they've – they no longer run that service.
- 51:33And so I have to go back and –
- 51:34That's a challenge for your authentication and identity management.
- 51:38Yeah.
- 51:38Yeah.
- 51:39So my – I need to go back and I want to add hooks to be able to use things like – I don't really want to manage – I don't really particularly want to manage usernames and passwords.
- 51:49So I want to be able to work with like Google Auth and various others, you know, Facebook Auth, et cetera, and let people choose that.
- 51:56Some other bit rot that I've sort of got is that it was written for ZODB 4 and ZODB 5 changed in ways.
- 52:05There's actually discussion on the ZODB list right now about – I don't know if you're familiar with RethinkDB.
- 52:10Yeah.
- 52:10But so there's this idea of having data pushed to you.
- 52:14And that's actually how ZODB works under the hood.
- 52:17But that's never really been exposed.
- 52:20Right.
- 52:20With the transaction commits and sort of refreshing the objects people have memory, right?
- 52:25Yeah.
- 52:25Right.
- 52:26So when you use a number of the ZODB storages, when a transaction commits, then the IDs of all the objects that were modified are pushed to all of the other clients.
- 52:36And they're invalidated.
- 52:38So there's already interesting information being pushed to clients.
- 52:41But that's never really been surfaced at the application level.
- 52:44And in ZODB 4, it was really easy with a small monkey patch to get at that.
- 52:49And the Kanban relied on that.
- 52:52But now in ZODB 5, that's no longer possible.
- 52:55So I'm in the process of adding that feature to ZODB 5, adding it as an official feature.
- 53:01Yeah.
- 53:01That's the way to do it anyway, right?
- 53:03Officially?
- 53:03Yeah.
- 53:04Right.
- 53:04Well, the Kanban has been – the original version that we used at Zope Corporation was actually a client server thing on top of the Asana API.
- 53:13And so the one that we used there was built on top of Asana.
- 53:17And Asana's API became really, really slow.
- 53:21They, too, got tired of providing an expensive service for free.
- 53:24Yeah.
- 53:25Yeah.
- 53:26We'll run on this one $10 server over there.
- 53:28Exactly.
- 53:29So since that, it's been kind of an R&D side project.
- 53:35And I'd like to really push it to completion and maybe even try to offer some sort of – offer it as a service.
- 53:42Because I wouldn't care so much, especially my last job, which the company was a great company, but they really struggled with process.
- 53:52And I think they would have liked to have used the Kanban, but it wasn't quite ready.
- 53:56And that was really frustrating for them and for me.
- 53:59So I'd like to soon take some time to actually get it much closer to completion.
- 54:04Yeah.
- 54:04It sounds like a great software-as-a-service type thing.
- 54:07So hopefully you can do that.
- 54:08All right.
- 54:09Very cool.
- 54:09Well, it looks like we should probably leave it there.
- 54:11We've covered a lot of ground on this episode, but we're pretty much out of time.
- 54:15So before we move on, let me ask you two final questions.
- 54:18We now have over 100,000 packages on PyPI, so hooray for that.
- 54:23And there's many that I'm sure you've come across that are noteworthy, that are not necessarily the most popular, but would be really cool to find out about.
- 54:30So what one would you like to recommend people look into?
- 54:32Well, it really depends.
- 54:34I mean, obviously it depends on what you do.
- 54:36But Bodo has delighted me over the years whenever I've had to touch AWS.
- 54:40So I'm a big fan of Bodo.
- 54:42Yeah, I use Bodo as well.
- 54:43I'm also a huge fan of Mach.
- 54:46Right.
- 54:46Okay.
- 54:47I think he did a really nice job of balancing dynamism and functionality.
- 54:52I could go on and on, but those are a couple that sort of come to mind.
- 54:57And of course, ZODB.
- 54:58Of course.
- 54:59Yeah.
- 54:59And NutDB as well, right?
- 55:01Very nice.
- 55:03Very nice.
- 55:03Okay, cool.
- 55:03So thanks for that.
- 55:05And finally, when you write some Python code, what editor do you open up?
- 55:08Emacs, of course.
- 55:09Emacs.
- 55:10All right.
- 55:10Right on.
- 55:12That's definitely a popular one.
- 55:14I'm giving a webinar next week on PyCharm.
- 55:16And I have to say, I'm actually pretty impressed with PyCharm.
- 55:20I like the, you know, as a straight text editor, I still like Emacs a lot.
- 55:25But they really assemble a nice package of things along with that, like, you know, database access and REST clients.
- 55:34And it's an interesting pile of functionality.
- 55:37Yeah, absolutely.
- 55:38And when you give that one, maybe if they have it recorded by the time we release this, we can put the link to your webcast in there.
- 55:44That'd be cool.
- 55:44Okay.
- 55:45Awesome.
- 55:46All right.
- 55:47Well, that all sounds great.
- 55:48Any final call to action for the listeners?
- 55:50Anything you want them to check out or do?
- 55:53Learn about transactions and then check out Newt.
- 55:55I'll definitely have Newt, DB, and all the other ones in the show notes so people should be able to get right to them.
- 56:00Cool.
- 56:01Yeah.
- 56:01Jim, thank you for being on the show.
- 56:02It's been great to learn about all these different projects with you.
- 56:05Thank you for having me.
- 56:05You bet.
- 56:06Bye.
- 56:09This has been another episode of Talk Python To Me.
- 56:11Our guest on this episode has been Jim Fulton.
- 56:14And this episode is brought to you by GetStream.
- 56:17If you're building an app with a feed, make sure to check out GetStream at talkpython.fm/stream.
- 56:23They have the intelligent, scalable, and tested feed API you need to be one step closer to launching your app.
- 56:30Are you or a colleague trying to learn Python?
- 56:32Have you tried books and videos that just left you bored by covering topics point by point?
- 56:37Well, check out my online course, Python Jumpstart, by building 10 apps at talkpython.fm/course to experience a more engaging way to learn Python.
- 56:46And if you're looking for something a little more advanced, try my WritePythonic code course at talkpython.fm/pythonic.
- 56:53Be sure to subscribe to the show.
- 56:55Open your favorite podcatcher and search for Python.
- 56:58We should be right at the top.
- 56:59You can also find the iTunes feed at /itunes, Google Play feed at /play, and direct RSS feed at /rss on talkpython.fm.
- 57:08Our theme music is Developers, Developers, Developers by Corey Smith, who goes by Smix.
- 57:14Corey just recently started selling his tracks on iTunes, so I recommend you check it out at talkpython.fm/music.
- 57:20You can browse his tracks he has for sale on iTunes and listen to the full-length version of the theme song.
- 57:25This is your host, Michael Kennedy.
- 57:27Thanks so much for listening.
- 57:29I really appreciate it.
- 57:30Smix, let's get out of here.
- 57:32Smix.
- 57:32I'll pass the mic back to who rocked it best.
- 57:42I'll pass the mic back to who rocked it best.
- 57:54you