---
description: There are many paths. What's the simplest thing that could possibly work?
---

# Paths To Production

<figure><img src="https://2402701329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6wzqgDHj9mZbFxabiEbc%2Fuploads%2Fljwnt5sHkBqibLhoNU4T%2Fcode_green_buttons.png?alt=media&#x26;token=ed9e0b67-086d-482b-8076-785cb5147087" alt="" width="371"><figcaption></figcaption></figure>

As you saw in [Your First Validation](../../getting-started/csv-and-excel-validation/your-first-validation) and [Another Example Part 2](../../getting-started/how-tos/another-longer-example/another-example-part-1), there are two ways to use the CsvPath library.&#x20;

* Single csvpath pointing to a single file, simple results
* Multi-csvpath

Both can work in a production setting. The latter is more flexible and offers more capabilities with little additional complexity. We'll focus on the multi-csvpath option.&#x20;

The path to production starts with just getting the simplest possible thing working—a proof of concept. We can quickly sketch that out.&#x20;

As our starting point, here is a high-level view of everything you need to know about the library. (Setting aside how to write csvpaths using the built-in functions, for now).

<figure><img src="https://2402701329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6wzqgDHj9mZbFxabiEbc%2Fuploads%2FIKI0HzG4GyNFhbvtn4kx%2Fcsvpaths-classes.png?alt=media&#x26;token=72c755b4-274d-4195-bf0a-0377272c0093" alt=""><figcaption></figcaption></figure>

Our goal is to create an automated CSV validation capability. We're not actually picking the right technologies that work for your specific situation, obviously! Writing the minimal implementation code for this is an exercise for you and [Claude](https://claude.ai/). A POC like what we are sketching should be pretty quick.

Here's what we think the simplest-possible thing might be, at least for some companies. _(Apologies to non-AWS users)._ Could you do something simpler? Probably. Is reality more complicated. For sure!

<figure><img src="https://2402701329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6wzqgDHj9mZbFxabiEbc%2Fuploads%2Fb4xhRMtTV7UtkBHF7TLV%2Fsimplest-poc.png?alt=media&#x26;token=d0bf0c9b-fd1e-4edd-894c-88a4e92bda42" alt=""><figcaption></figcaption></figure>

Imagine your CSV files are arriving by SFTP. You need a landing zone for your CSV files and csvpaths. Let's say you use AWS Transfer Family fronting S3. When a file arrives it triggers a Lambda that runs your csvpath validation. This scenario is [similar to this tutorial](https://aws.amazon.com/blogs/storage/customize-file-delivery-notifications-using-aws-transfer-family-managed-workflows/).

<figure><img src="https://2402701329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6wzqgDHj9mZbFxabiEbc%2Fuploads%2F9f85IHSfhjmsjuAmvr3O%2Ftransfer_family_setup.png?alt=media&#x26;token=d6105ffd-9f93-44ad-8ade-f71794a3ecf3" alt=""><figcaption></figcaption></figure>

Your Lambda, where CsvPath runs, is pretty simple. (Remembering this is just a sketch to give you ideas). In mostly accurate pseudo-code, it might look like:&#x20;

<figure><img src="https://2402701329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6wzqgDHj9mZbFxabiEbc%2Fuploads%2FjHRRfaB4r00eTqbUwl2D%2Flambda_code.png?alt=media&#x26;token=02f60123-bc69-45e7-86af-e3e06999b224" alt=""><figcaption><p>Pseudo-code for setting up CsvPaths in an AWS Lambda</p></figcaption></figure>

And we can repurpose the multi-csvpath file from [Another Example, Part 2](../../getting-started/how-tos/another-longer-example/another-example-part-2) to stand in for your inbound file validation rules.

<figure><img src="https://2402701329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6wzqgDHj9mZbFxabiEbc%2Fuploads%2FSeW2VfYCGPQUfibVucnM%2Finbound_validation_csvpaths.png?alt=media&#x26;token=744f84f8-51ac-49b2-927a-03bc9960980d" alt=""><figcaption></figcaption></figure>

Adding a simple email giving validation results using SES is an easy add-on. The Web is littered with SES email examples.&#x20;

<figure><img src="https://2402701329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6wzqgDHj9mZbFxabiEbc%2Fuploads%2F3g2tc7nLhf0en2NIoup3%2Fses-example.png?alt=media&#x26;token=7d2faf93-5b07-4c4a-a587-1c4dff450d94" alt=""><figcaption></figcaption></figure>

Likewise, pushing metadata or lines from the Results object into a database would be a straightforward database insert—at least if we're sticking with the [simplest-thing-that-could-possibly-work ethic](https://ronjeffries.com/xprog/articles/practices/pracsimplest/).&#x20;

And that's pretty much all of it. Obviously, some assembly required. As they say, an exercise for the reader.&#x20;
