Hi community! As an Airflow user, I feel really in...
# ask-community
r
Hi community! As an Airflow user, I feel really inspired after I read most Dagster blogs, you are real rock stars. Now I want to have some practical work to do like migrating some existing airflow jobs to Dagster. I'm still a little confused on the concepts
Assets
and
Ops
, correct me if I'm wrong.
Asset
is an advanced version of
op
, for new jobs we should always prefer
Asset
than
op
unless we need some features from
graph
, right?
r
My understanding is that Assets represents data (a database, a collection of files, etc) and Ops represents operations over the data. If one of you job consists in populating a database, for instance, you can define several ops describing the steps required to do so (download, transform, store) and group them within an asset representing the state of the database (stale, updated, etc). In short, assets represent durable data whereas ops represent transient processes.
r
Great answer! I have a further question. Because I don't see an example of let
Assets
,
Ops
and
Graphs
work together, so if my job only needs
assets
at the beginning, but (maybe several weeks) later I found I need to populating a database, should I refactor the
assets
to
ops
?
s
Hey @Renkai Ge - assets, ops and graphs do work together. Here's an example of how: https://docs.dagster.io/concepts/assets/software-defined-assets#graph-backed-assets. If you start using assets now and want to use graphs in the future, you shouldn't need to make big changes to refactor your code. Here's a more general guide to how to think about how assets relate to ops & graphs: https://docs.dagster.io/guides/dagster/enriching-with-software-defined-assets#upgrading-to-software-defined-assets.
❤️ 1
if you have questions about how to migrate particular aspects of your airflow job to dagster assets, I'm happy to answer those too