= Packed deployments

We use the term 'packed deployment' to mean that everything required at runtime is built (if necessary) and packed into an archive, ready for deployment and execution in the target operating environment.

It is common to create 'uberjars' containing pre-compiled Clojure code, togther with dependent pre-compiled library code from Clojure and other JVM languages.

Advantages of this approach include:

* Start up time is fast, ideal for AWS Lambdas and for coping with sudden spikes in traffic, for example, using AWS auto-scaling groups.
* Immutable

Disadvantages include:

* Uberjars can be large, meaning they _can_ be costly to build, store and transfer across network links.
* Lossy uberjar build process, possible licensing issues and ambiguities.
* Require a full redeploy on every change
* Distance between dev and prod

NOTE: Coming soon, documentation about integration with `pack`.

= Packed deployments

We use the term 'packed deployment' to mean that everything required at runtime is built (if necessary) and packed into an archive, ready for deployment and execution in the target operating environment.

It is common to create 'uberjars' containing pre-compiled Clojure code, togther with dependent pre-compiled library code from Clojure and other JVM languages.

Advantages of this approach include:

* Start up time is fast, ideal for AWS Lambdas and for coping with sudden spikes in traffic, for example, using AWS auto-scaling groups.
* Immutable

Disadvantages include:

* Uberjars can be large, meaning they _can_ be costly to build, store and transfer across network links.
* Lossy uberjar build process, possible licensing issues and ambiguities.
* Require a full redeploy on every change
* Distance between dev and prod

== Creating an uberjar

From the top-level directory, run the following:

[source]
----
edge$ bin/uberjar main
----

This creates an uberjar named `main.jar`.

NOTE: By default, uberjars are built using the https://github.com/juxt/pack.alpha#capsule[*capsule* strategy] in
JUXT's https://github.com/juxt/pack.alpha[pack] tool.


== Running the uberjar

[source]
----
edge$ java -jar main.jar
----

Add documentation on building uberjars
Add documentation on building uberjars
