WEBVTT

00:00.000 --> 00:05.200
Talk is about building secure reproducible data infrastructure with Nix and NixOS.

00:05.800 --> 00:12.080
So building data infrastructure is still surprisingly... I'm close to the mic.

00:12.080 --> 00:19.140
Building data infrastructure is still surprisingly, to you I assume, manual.

00:19.460 --> 00:26.660
Us data engineers, we stitch together storage and catalogs and query engines with one-off scripts.

00:26.660 --> 00:37.580
And when we try to move that stack across environments, say from dev to a colo, to an air gap lab, things break a lot.

00:37.680 --> 00:47.220
So with Nix and NixOS, it's possible to define everything as code and run the same stack and all its dependencies anywhere in a reproducible way.

00:47.540 --> 00:49.880
So that's the premise behind this talk.

00:49.880 --> 00:59.260
And before we define what a lake house, a data lake house, not real estate here, is, I want to talk about what it isn't.

00:59.420 --> 01:07.960
So traditional data warehouses, databases, they're optimized for reliability and performance, but they're really rigid.

01:07.960 --> 01:10.500
So they require a lot of upfront data modeling.

01:10.500 --> 01:13.460
They rely on ETL pipelines to load data.

01:13.460 --> 01:23.440
They typically only scale vertically, which becomes really expensive and really complex when you have a large volume of data, which everybody wants to have.

01:23.440 --> 01:27.300
So data lake houses took the opposite approach.

01:27.300 --> 01:30.300
So this was born in the era of Hadoop.

01:30.300 --> 01:37.060
These are store-everything-first data tools.

01:37.520 --> 01:39.160
They worry about structure later.

01:39.160 --> 01:44.140
Store-it-first, just the E of the ETL, put it all in, figure it out later.

01:44.440 --> 01:46.160
They scale horizontally.

01:46.460 --> 01:52.460
They're great for collecting a bunch of stuff all at once, but they're messy, they're disorganized.

01:52.460 --> 01:56.720
It's really hard to actually extract any information or value from.

01:57.040 --> 02:02.640
The combination, the game changer, is the two combined.

02:02.640 --> 02:11.100
So a data lake house brings all of the benefits from both types of data storage.

02:11.100 --> 02:24.900
It's built on object storage like a data lake, but it layers on transactional guarantees, ACID transactions, metadata management, all the things you expect from a warehouse.

02:25.200 --> 02:30.120
And the critical layer of this is the open table formats.

02:30.740 --> 02:33.480
And I'll explain what those are.

02:33.820 --> 02:40.020
But these support features like time travel and version control, these are things that make a data lake house functional.

02:40.220 --> 02:43.100
So I told you what it wasn't.

02:43.860 --> 02:45.300
So what is it?

02:45.300 --> 02:50.100
There's three main minimal components for a data lake house.

02:50.420 --> 02:52.360
The first is object storage.

02:52.780 --> 02:57.780
To work for large amounts of data, that object storage has to be optimized for scale and throughput.

02:57.780 --> 03:02.220
It has to be able to store structured, unstructured, semi-structured, all kinds of data.

03:02.220 --> 03:05.560
Anything from parquet to logs to models.

03:05.680 --> 03:07.500
And then on top of that is open table format.

03:07.500 --> 03:11.300
So this is where I tell you what I told you in the last slide, but more in detail.

03:11.420 --> 03:15.640
So this is Apache Iceberg, Apache Hudi, Delta Lake.

03:15.720 --> 03:22.620
The OTFs are what introduces transactional semantics into object storage.

03:22.620 --> 03:32.220
What takes the data lake, the database, and puts it in the data lake, making a data lake house.

03:32.700 --> 03:36.680
So it tracks data files, schema changes.

03:37.460 --> 03:43.020
This gives us really cool things like time travel, partition pruning, consistent multi-rider support.

03:43.020 --> 03:48.040
It's what makes it worthwhile as a data infrastructure.

03:48.600 --> 03:51.040
And the last part is compute.

03:51.730 --> 03:57.420
This is your query engine, and this could be something like Trino, or Dremio, or DuckDB.

03:57.660 --> 04:04.540
Depending on whether or not you need distributed execution, or BI dashboards, or fast local analytics.

04:04.660 --> 04:09.220
And the beauty of this architecture, the whole point of it, is that you can swap and drop.

04:09.220 --> 04:12.400
So your compute can be anything, or it can be many things.

04:13.160 --> 04:20.060
But together, all of these three things is the minimal requirement for a data lake house.

04:21.460 --> 04:27.500
But if you're actually going to do it, if you're actually going to make a data lake house, you also need a catalog.

04:27.820 --> 04:32.680
So catalogs, anything but futzing around, need a catalog.

04:32.680 --> 04:37.540
So Iceberg Catalog is where your actual metadata gets managed.

04:37.980 --> 04:45.660
It maps logical table names to metadata, so every time you write to a table, Iceberg will generate a new snapshot.

04:45.660 --> 04:58.580
And this snapshot references a manifest list, which naturally points to manifest, which then points to the actual data files that are in Parquet.

04:58.580 --> 05:00.560
So it's a metadata tree.

05:00.840 --> 05:06.520
So the catalog stores the latest snapshot ID, the schema versions, the partition specs, the table properties.

05:06.520 --> 05:09.720
It's the GitHead pointer for your data.

05:10.580 --> 05:19.480
So you can use a catalog for a snapshot-based query, so you can select all the data as it existed in this specific point in time.

05:19.480 --> 05:25.720
You can do rollbacks, so if you mess up your data, which happens a lot, you can just roll back to the point when it was good.

05:25.800 --> 05:34.780
You can do branching, so you can do a Git-like... it turns your data lake house into a Git-like system.

05:34.780 --> 05:45.740
So you can do branching, so you can have dev and prod, you can have, this is my fudsing around space, this is Daniel who always drops all his tables space, so on and so forth.

05:45.740 --> 05:53.200
You can do auditability, so metadata is appended... auditability... so metadata is append-only.

05:53.200 --> 05:55.000
Object storage is immutable.

05:55.100 --> 06:01.140
So you get a full history of all the changes that you have ever made, if you want to.

06:01.740 --> 06:16.060
Decide what your snapshot retention will be, but that means you can... it's really important for fields where auditability is an important feature for enterprise data.

06:16.060 --> 06:19.320
Then you... so there's a couple... that's what it does.

06:19.320 --> 06:23.220
There's like three or four really good ones.

06:23.220 --> 06:24.800
They are open source.

06:24.800 --> 06:31.940
It's Nessie Polaris, which is donated to the Apache Foundation by Snowflake.

06:32.180 --> 06:35.620
It's designed to be embedded, which is kind of a neat feature.

06:35.780 --> 06:41.000
Gravitino is really neat, because it works past and forward.

06:41.000 --> 06:48.300
So it works with things like Hive and stuff like that, but also with Delta Lake, Apache Iceberg.

06:48.300 --> 06:53.020
So you can go front, and you can go back, and it can go all around, and it's also an Apache project.

06:53.020 --> 06:54.180
Great.

06:54.900 --> 07:00.620
If you're bridging legacy and modern, this is your guy for catalog.

07:01.200 --> 07:12.600
So all three support REST APIs, which makes it really easy to plug into engines that I was talking about, those query engines like Trino and Spark and Dremio, and also, of course, object storage that also relies on REST.

07:12.600 --> 07:16.520
This whole stack is based on REST API.

07:16.520 --> 07:19.920
So, Nessie, you probably spent all that time explaining what it is.

07:19.920 --> 07:24.060
You're probably asking yourself, but why would I do that?

07:24.280 --> 07:33.460
So this is a diagram showing where the lake house sits in an entire AI infrastructure.

07:33.460 --> 07:42.060
So the center, data lake house, this is where everything lands, tabular data, training sets, vector embeddings, models, sensor logs.

07:42.060 --> 07:43.680
And I'm not trying to just repeat buzzwords.

07:43.680 --> 07:46.280
I'm just trying to explain why you'd want to build one, right?

07:46.600 --> 07:52.300
Your application data, it's your storage, it's your retrieval layer, it's everything.

07:52.920 --> 07:55.080
It's the heart of your stack.

07:55.080 --> 08:00.180
And then on the left, it's like your hugging face.

08:00.420 --> 08:06.160
It's where you manage your models, data sets, your collaborative spaces, all that stuff.

08:06.520 --> 08:09.460
It's where you can store and share and reuse models.

08:09.460 --> 08:12.180
And on the right, you have your ML op stack.

08:12.180 --> 08:23.480
So this is the AI lifecycle and action and data moves back and forth from this space as you make and create features, as you make and recreate models.

08:24.440 --> 08:26.380
And then you have a vector database.

08:26.380 --> 08:29.400
So those are the cool things like LanceDB and PineconeDB.

08:29.520 --> 08:34.280
And those are optimized for fast similarity search and powers rack.

08:34.280 --> 08:39.140
And all of this is querying object storage directly without migration.

08:39.140 --> 08:42.020
So you can't have, it's the minimum file requirement.

08:42.020 --> 08:47.140
If you want any of that stuff, you want all that stuff, you have to have a data lake out.

08:48.280 --> 08:57.740
Okay, so and then of course, at the foundation, you have Nix, which declaratively defines and deploys the whole, all of it, right?

08:58.080 --> 09:05.360
From infrastructure to services, to pipelines, to security, to, you know, the whole networking, everything.

09:05.360 --> 09:09.340
Soup to nuts, that's where it is, ideally, you know.

09:09.500 --> 09:19.000
Okay, so what, you're probably asking me right now, so what if I already have Docker or Podman or Kubernetes?

09:19.000 --> 09:21.660
Because I feel like I'm not tall enough for this, sorry.

09:22.220 --> 09:24.680
I don't think it's an either or situation.

09:24.720 --> 09:28.920
You know, you can integrate Nix with two existing workloads.

09:28.920 --> 09:37.880
So in fact, you might need to do that because not everything is a Nix OS package yet, which is why you lovely people are here supporting the community.

09:38.600 --> 09:47.480
But, you know, many teams, data teams, particularly, that's what I know about, we use Docker for deploying services and running analytics jobs already.

09:47.480 --> 09:51.520
So Nix can slot into those workflows and actually make it better.

09:51.580 --> 10:01.960
I've heard it said that Nix is a better Docker compose than Docker, but I'll leave that to your interpretation.

10:02.620 --> 10:07.820
But you can use Nix to build container images reproducibly, and there's a couple of different ways to do that.

10:07.820 --> 10:14.780
You can use docker-tools.build-image, and it lets you define the container and all of its dependencies entirely in Nix.

10:14.780 --> 10:20.000
Or you can use Nix 2 container to build OCI images and push them to a registry.

10:20.860 --> 10:28.540
But either way, you get fully versioned deterministic containers that behave in the same way in dev, in CI, in prod.

10:28.540 --> 10:32.600
And this makes Nix a great tool, even in container-heavy environments.

10:32.600 --> 10:36.420
And you can use this to lock down builds and remove guesswork from your Docker pipeline.

10:36.420 --> 10:40.420
So you can have it all.

10:41.840 --> 10:44.980
So but where does Nix actually fit in?

10:44.980 --> 10:51.240
So at its core, I mean, you might be familiar, but for those who aren't, Nix is a package manager.

10:51.240 --> 10:56.200
It builds software and systems with declarative specifications.

10:56.200 --> 11:01.080
So that means if your inputs don't change, your outputs don't either.

11:01.080 --> 11:02.240
Not ever.

11:02.260 --> 11:07.740
So it should work wherever you put it.

11:07.740 --> 11:21.220
So with Nix OS, that extends to an operating system, and you define your full system configuration of the file, things like services, user, firewall, rules, TLS, certs, file systems.

11:21.740 --> 11:25.080
Nix OS builds those all.

11:25.080 --> 11:28.100
So this is a real declarative infrastructure.

11:28.240 --> 11:37.340
There's no provisioning script, no bash, glue, no step 14 install, JDK once again, over and over again.

11:38.220 --> 11:47.520
It's the same configuration builds your entire stack on your laptop, on your rack, on an edge box, wherever you want to put it.

11:47.520 --> 11:53.720
It's portable, reproducible, version-controlled, and that's exactly what we want.

11:54.480 --> 12:11.180
When we're designing critical infrastructure like data infrastructure, I'm giving this talk in part because I feel like data infrastructure is being left behind out of when we talk about critical infrastructure, but it is, as I said, in the heart of this stack.

12:11.180 --> 12:16.200
So do protect your data.

12:16.200 --> 12:24.420
So this is how, essentially, we move from fragile, one-off setups to infrastructure that you can deploy like software.

12:24.420 --> 12:33.020
Okay, so a flake house, flake house is data lake, lake house on Nix, right?

12:33.020 --> 12:38.980
So what do you exactly do you want to define in a Nix flake?

12:38.980 --> 12:44.740
So you want MinIO, which is, or whatever, your on-prem object storage software.

12:44.740 --> 12:55.200
You need Iceberg, that's your open table format, that's where all the cool stuff about data lake house, time travel, evolution, partition, you need it.

12:55.960 --> 13:02.880
A catalog like Nessie or Gravitino or Polaris, so you get version control on your data.

13:03.140 --> 13:13.460
Chino, Spark, DuckDB for compute, TLS, IAM, network policies, you need systemd to manage the whole thing.

13:13.460 --> 13:18.460
So the stack is entirely in Nix, or it could be.

13:18.460 --> 13:28.060
This is somewhat aspirational, which we will get into why or how the aspiration begins or becomes, right?

13:29.480 --> 13:38.260
All right, so, and then once the stack is defined in a flake, once your flake house is defined in a flake, we can deploy it anywhere.

13:38.260 --> 13:43.180
So it can go, like I said, on a laptop, in dev, edge, wherever.

13:43.460 --> 13:52.300
The point is, there's no manual tweaks, no drifts, no reconfiguring, just deploys like code.

13:52.980 --> 13:56.920
So this approach gives some really clear advantages.

13:57.980 --> 14:12.840
Obviously, security and control, so all your services, object storage, your catalog, your query engine, they should all deploy behind your trust boundary if you deploy it on-prem.

14:13.600 --> 14:19.240
You have all your access control is defined for everything, every place you try to deploy this.

14:19.240 --> 14:24.720
This means you know what's running, who can talk to what, and how it was built.

14:25.180 --> 14:27.800
The operational simplicity is another point.

14:27.800 --> 14:39.160
So Nix OS modules make deployment and update consistent across environments, which is really important, especially since so many in data, when so much is done locally.

14:40.140 --> 14:44.520
You know, data exploration, feature selection is often done on a laptop.

14:45.800 --> 14:54.980
But it needs to be extrapolated to a full data set, your full production system, and this can do that.

14:55.580 --> 14:59.120
It makes automation safer and onboarding safer.

14:59.940 --> 15:02.460
And then the third is scale and portability.

15:02.760 --> 15:13.820
Like I was saying, you can deploy it from your laptop to your colo, and there's no drifts, it's reproducible.

15:13.820 --> 15:19.560
It's scaling out becomes a matter of just replicating known good systems.

15:19.560 --> 15:26.640
So it makes your data infrastructure predictable, testable, easier to move.

15:32.460 --> 15:36.860
But there's some challenges with this approach.

15:36.860 --> 15:53.080
So the primary problem is that, or challenge, is that key components like Iceberg, Apache Iceberg, Nessie, Polaris, the catalogs, and Iceberg itself aren't available as Nix packages yet.

15:53.080 --> 16:04.680
So there's no official modules or system services for these components, which means you'd have to wrap them as binaries or run them as containers, or Docker, or whatever.

16:04.680 --> 16:10.040
But that breaks the full declarative integration, which is the cool part of what I was talking about.

16:10.040 --> 16:13.720
So , you know, a little, a tiny bummer.

16:14.480 --> 16:17.100
And then service orchestration.

16:17.100 --> 16:25.040
So there's really not a great way to express service dependencies across components.

16:25.040 --> 16:37.180
So, for example, ensuring that, you know, MinIO is online before the catalog initializes, or that Trino doesn't start before the Iceberg tables are reachable.

16:37.180 --> 16:43.780
It has to look manually scripted, so it's not...

16:43.780 --> 16:59.780
And then, you know, defining the networking policy, defining encrypted communication across access control is possible, you can do it, but it's still a little fragile, especially with self-search.

17:00.880 --> 17:05.640
It's a little, it's a little, it's a little pain point.

17:05.640 --> 17:15.860
And then at secret management, so in object storage and MinIO and anything that's S3, you saw the whole stack, it's all S3, like, compatible.

17:15.860 --> 17:33.940
And the problem is that, or challenge, is that there's a tool called SOPS Nix that helps with integrating services that expect secrets as environmental bars like S3 compatible.

17:34.940 --> 17:35.980
Anything?

17:36.440 --> 17:44.160
But these, it's a little inconsistent, so it would be cool if it was, like, you know, more, less friction.

17:44.640 --> 18:05.580
So the, you know, the foundation, as we saw, the benefits are really clear, but, you know, there's room to grow, and I think primarily the room to grow, the where to grow is to have modules, modules for Nessie, Polaris, Gravitino, and Apache Iceberg.

18:05.680 --> 18:08.100
And those are really foundational elements.

18:08.100 --> 18:09.580
You got two out of the three of the stack.

18:09.580 --> 18:12.100
Remember the three components of a data lake house?

18:12.280 --> 18:15.640
Object storage, open table format, and query engine.

18:15.640 --> 18:26.020
Well, you got query engines, because you got Spark, and you got Trino, and you got object storage, because you have MinIO, but you're, you know, it's that middle bit.

18:26.540 --> 18:28.880
It's a little, you know.

18:29.760 --> 18:36.900
So if you care about data infrastructure, or you just want to expand what Nix can do, you know, this is your moment.

18:39.400 --> 18:44.200
And, you know, sort of the idea that building data infrastructure is still really fragile.

18:44.200 --> 18:56.360
You know, it's stitched together with scripts and tribal knowledge, and it's just tuned for one environment, so it makes it really hard to move without breaking.

18:57.060 --> 19:09.980
So this is a really great alternative that Nix and NixOS offer to treat data infrastructure like code, where you can define your whole stack declaratively, version it, run it anywhere.

19:11.580 --> 19:18.180
And so if you're working on anything like this or want to, you know, let's talk.

19:20.120 --> 19:20.780
Thank you.

