neilzhu 6dd8e59864 first commit 1 month ago
..
static 6dd8e59864 first commit 1 month ago
00000000_template.md 6dd8e59864 first commit 1 month ago
20200520_exactly_once_kafka.md 6dd8e59864 first commit 1 month ago
20210310_compressed_s3_sources.md 6dd8e59864 first commit 1 month ago
20210311_prometheus_source.md 6dd8e59864 first commit 1 month ago
20210401_volatile_sources.md 6dd8e59864 first commit 1 month ago
20210405_key_value_formats.md 6dd8e59864 first commit 1 month ago
20210406_mapfilterproject.md 6dd8e59864 first commit 1 month ago
20210408_timelines.md 6dd8e59864 first commit 1 month ago
20210412_postgres_sources.md 6dd8e59864 first commit 1 month ago
20210413_source_sink_resource_sharing.md 6dd8e59864 first commit 1 month ago
20210426_temporal_filters.md 6dd8e59864 first commit 1 month ago
20210504_manage_external_state.md 6dd8e59864 first commit 1 month ago
20210505_kafka_keys_in_sql.md 6dd8e59864 first commit 1 month ago
20210601_build_mirrelationexpr.md 6dd8e59864 first commit 1 month ago
20210608_one_shot_sinks.md 6dd8e59864 first commit 1 month ago
20210707_qgm_sql_high_level_representation.md 6dd8e59864 first commit 1 month ago
20210713_S3_sources_with_headers.md 6dd8e59864 first commit 1 month ago
20210714_reclocking.md 6dd8e59864 first commit 1 month ago
20210715_table_update.md 6dd8e59864 first commit 1 month ago
20210728_error_handling_surfacing_connector_failures.md 6dd8e59864 first commit 1 month ago
20210811_disable_user_indexes.md 6dd8e59864 first commit 1 month ago
20210831_correctness.md 6dd8e59864 first commit 1 month ago
20210910_include_kafka_metadata.md 6dd8e59864 first commit 1 month ago
20220109_monotonic_topk.md 6dd8e59864 first commit 1 month ago
20220214_create_cluster.md 6dd8e59864 first commit 1 month ago
20220228_kafka_headers.md 6dd8e59864 first commit 1 month ago
20220303_secrets.md 6dd8e59864 first commit 1 month ago
20220330_persist.md 6dd8e59864 first commit 1 month ago
20220404_connectors.md 6dd8e59864 first commit 1 month ago
20220404_metadata_storage.md 6dd8e59864 first commit 1 month ago
20220411_reclocking_implementation.md 6dd8e59864 first commit 1 month ago
20220413_cluster_replica.md 6dd8e59864 first commit 1 month ago
20220511_command_and_response_binary_encoding.md 6dd8e59864 first commit 1 month ago
20220516_transactional_consistency.md 6dd8e59864 first commit 1 month ago
20220718_envelopes.md 6dd8e59864 first commit 1 month ago
20220728_persisting_introspection_data.md 6dd8e59864 first commit 1 month ago
20220819_bounded_input_reliance.md 6dd8e59864 first commit 1 month ago
20221204_with_mutually_recursive.md 6dd8e59864 first commit 1 month ago
20230126_designs_reviews.md 6dd8e59864 first commit 1 month ago
20230209_invalid_accumulations.md 6dd8e59864 first commit 1 month ago
20230210_storage_persist_sink_redux.md 6dd8e59864 first commit 1 month ago
20230216_role_based_access_control.md 6dd8e59864 first commit 1 month ago
20230223_stabilize_with_mutually_recursive.md 6dd8e59864 first commit 1 month ago
20230225_compute_introspection_schema.md 6dd8e59864 first commit 1 month ago
20230227_external_introspection.md 6dd8e59864 first commit 1 month ago
20230306_persist_mfp_pushdown.md 6dd8e59864 first commit 1 month ago
20230315_backup_restore.md 6dd8e59864 first commit 1 month ago
20230322_metrics_since_granularity.md 6dd8e59864 first commit 1 month ago
20230330_recursion_limit.md 6dd8e59864 first commit 1 month ago
20230411_envelope_upsert_order_by_timestamp.md 6dd8e59864 first commit 1 month ago
20230411_faster_dataflow_shutdown.md 6dd8e59864 first commit 1 month ago
20230418_persist_state_pubsub.md 6dd8e59864 first commit 1 month ago
20230418_subscribe_output.md 6dd8e59864 first commit 1 month ago
20230419_stash_migrations.md 6dd8e59864 first commit 1 month ago
20230421_stabilize_monotonic_select.md 6dd8e59864 first commit 1 month ago
20230512_mir_cost_model.md 6dd8e59864 first commit 1 month ago
20230519_statement_logging.md 6dd8e59864 first commit 1 month ago
20230528_managed_clusters.md 6dd8e59864 first commit 1 month ago
20230531_compute_metrics.md 6dd8e59864 first commit 1 month ago
20230531_system_privileges.md 6dd8e59864 first commit 1 month ago
20230602_default_privileges.md 6dd8e59864 first commit 1 month ago
20230607_shift_status_updates.md 6dd8e59864 first commit 1 month ago
20230613_cloudtest_improvements.md 6dd8e59864 first commit 1 month ago
20230615_webhook_source.md 6dd8e59864 first commit 1 month ago
20230705_v2_txn_management.md 6dd8e59864 first commit 1 month ago
20230714_optimizer_interface.md 6dd8e59864 first commit 1 month ago
20230717_alter_set_cluster.md 6dd8e59864 first commit 1 month ago
20230720_single_statement_explitic_transaction.md 6dd8e59864 first commit 1 month ago
20230721_persist_fast_path.md 6dd8e59864 first commit 1 month ago
20230728_left_join_stack_consolidation.md 6dd8e59864 first commit 1 month ago
20230801_sink_conn_mgmt.md 6dd8e59864 first commit 1 month ago
20230802_explain_running_dataflows.md 6dd8e59864 first commit 1 month ago
20230806_durable_catalog_state.md 6dd8e59864 first commit 1 month ago
20230810_alter_connection.md 6dd8e59864 first commit 1 month ago
20230814_unbilled_replicas.md 6dd8e59864 first commit 1 month ago
20230829_topk_size_hint.md 6dd8e59864 first commit 1 month ago
20230903_avro_doc.md 6dd8e59864 first commit 1 month ago
20230921_distributed_ts_oracle.md 6dd8e59864 first commit 1 month ago
20231027_refresh_mvs.md 6dd8e59864 first commit 1 month ago
20231102_read_holds.md 6dd8e59864 first commit 1 month ago
20231103_privatelink_status_table.md 6dd8e59864 first commit 1 month ago
20231110_aws_connections.md 6dd8e59864 first commit 1 month ago
20231113_optimizer_notice_catalog.md 6dd8e59864 first commit 1 month ago
20231117_copy_to_s3.md 6dd8e59864 first commit 1 month ago
20231127_pv2_uci_logical_architecture.md 6dd8e59864 first commit 1 month ago
20231201_catalog_migration_to_persist.md 6dd8e59864 first commit 1 month ago
20231204_query_lifecycle_events_logging.md 6dd8e59864 first commit 1 month ago
20231204_wmr_type_casts.md 6dd8e59864 first commit 1 month ago
20231213_compute_operator_hydration_status_tracking.md 6dd8e59864 first commit 1 month ago
20240108_source_metrics_2.md 6dd8e59864 first commit 1 month ago
20240117_decoupled_storage_controller.md 6dd8e59864 first commit 1 month ago
20240205_cluster_specific_optimization.md 6dd8e59864 first commit 1 month ago
20240328_persist_columnar.md 6dd8e59864 first commit 1 month ago
20240401_persist_inline_writes.md 6dd8e59864 first commit 1 month ago
20240411_graceful_reconfiguration_of_managed_clusters_v1.md 6dd8e59864 first commit 1 month ago
20240531_zero_downtime_upgrades_milestone1.md 6dd8e59864 first commit 1 month ago
20240609_error_handling.md 6dd8e59864 first commit 1 month ago
20240610_unified_compute_introspection.md 6dd8e59864 first commit 1 month ago
20240625_source_versioning__table_from_sources.md 6dd8e59864 first commit 1 month ago
20240919_dataflow_expiration.md 6dd8e59864 first commit 1 month ago
20240925_attribution_profiling.md 6dd8e59864 first commit 1 month ago
20240925_network_policies.md 6dd8e59864 first commit 1 month ago
20241008_expression_cache.md 6dd8e59864 first commit 1 month ago
20241015_add_columns_to_tables.md 6dd8e59864 first commit 1 month ago
20250127_multi_replica_scheduling_singleton_sources.md 6dd8e59864 first commit 1 month ago
20250226_postgres_style_explain.md 6dd8e59864 first commit 1 month ago
20250307_column_names.md 6dd8e59864 first commit 1 month ago
20250321_password_authentication.md 6dd8e59864 first commit 1 month ago
20250415_large_select_result_size.md 6dd8e59864 first commit 1 month ago
README.md 6dd8e59864 first commit 1 month ago
fg.png 6dd8e59864 first commit 1 month ago
gflv.png 6dd8e59864 first commit 1 month ago
hdv.png 6dd8e59864 first commit 1 month ago
jepsen-plan.md 6dd8e59864 first commit 1 month ago

README.md

Design Process

What's the purpose of a design document?

A design document is a tool we use to thoroughly discover problems and examine potential solutions before moving into the delivery phase of a project. Design documents can tackle different classes of problems, including customer needs and internal technical challenges. The important part of a design document is being crisp about the exact problem we're tackling, explaining all of the options being considered for tackling that problem, and recording why we ended up moving forward with a particular solution.

Writing a design document takes time. It requires a certain amount of legwork to get started, and it can require a meaningful amount of collaboration to get to a shareable state. We actively are making a choice here: to move slower at the beginning of the project management process in order to move faster and more confidently when we enter the delivery phase.

Once a design document is written, it is required to host a discussion meeting. Asynchronous, text-only communication tends to drag out the process and doesn't get the same kind of broad feedback that live meetings solicit. It is expected that attendees are given time to read, digest, and engage with the design document before the meeting. It is not expected that all open questions will be answered before the meeting starts.

Design document meetings are not meant for open-ended brainstorming, nor are they meant to act as a review body. The intention of this process is not to design by committee. Instead, the author is responsible for driving the process to a conclusion that is satisfactory to the relevant stakeholders. Not every design document will result in complete consensus. Outcomes from the meeting are recorded as a comment on the respective PR.

Examples (some "in spirit", because the design doc template changed over time):

Goals

As stated earlier, the goal of a design document is to thoroughly discover problems and examine potential solutions before moving into the delivery phase of a project. In order to do this, each design document should:

  • Clearly and succinctly state the problem it aims to solve, along with any required context.
  • Document evidence of the problem via customer interviews, metrics, or any other means.
  • Crisply articulate the author's preferred solution to the problem, and why.
  • Document all alternative solutions that were considered, and why they weren't chosen.
  • Document any dependencies that may need to break or change as a result of this work.
  • Record any decisions that resulted from the document.

If any of these goals are unclear to you, or if the specific requirements of the document are unclear once you kick off a design process, reach out to your manager.

Non-Goals

These are not explicitly required for a good design document. You should, however, use your own judgment to determine what is and isn't required for your specific case.

  • Allow a drive-by commenter without any context to fully understand the design: the intention is that a group of people with common context can come together, understand the design and come to a decision. Some context might be gathered from previous design documents, from reference documentation, or from looking at the code.
  • Provide a fully spec'ed reference implementation. Prototypes on the other hand are crucial for de-risking the design as early as possible and a minimal viable prototype is required in most cases.

When should you make a design document?

Design docs should be written for all changes where an implementation does not immediately follow from the problem.

Definitely write a design document:

  1. If there are multiple alternative implementations and no clear best option.
  2. If it changes a customer-facing/public API, or a major private API (for example, the API for implementing new sinks).
  3. If the change is large/cross-cutting, e.g., will be spread over multiple PRs and/or multiple teams.

Consider writing a design document:

  1. If it's going to involve multiple people and/or teams coordinating changes. You have to use your gut feeling/common sense here. A change that involves two people from the same team might not need a document.
  2. If the change will take more than a week to implement or will proceed in phases that need clearly delimited scope.

Many smaller changes do still benefit from a quick design doc to clarify thinking. Err on the side of writing a design document. If in doubt, keep it short.

Feel free to do prototyping or experimental work before writing a design document. Prototypes and experiments can be an effective way to further clarify your thinking and inform the writing process.

How should you make a design document?

Creation

  1. Copy the design document template to a new date-prefixed file in the design directory of the repository you're working in, and fill it in.
  2. Submit a pull request of your filled in design document. This makes it easy for others to add written comments.
  3. Identify your key stakeholders and socialize the design document with them. Typically, there is a small set of people who have a vested interest in the area the design touches. If it's not clear who your stakeholders for the design document are, check in with your manager.
  4. Schedule a meeting to discuss the design document live with your stakeholders. Rule of thumb is that you should give your reviewers about a week to thoroughly review and engage with your document.
  5. Optional: announce that the design document is ready for review in #epd-announce. It may be useful to get extra eyes on your design, but remember that this process is not intended to design by committee. Use your judgment in engaging with feedback from outside of your group of stakeholders. Note that we have a bot that automatically posts notifications about new design documents in #rnd-design-docs.

Iteration

  1. As you begin to get feedback on your document, address the comments and answer the questions on your PR. Continue to iterate.
  2. Drive the design document meeting and attempt to gather explicit approvals from your stakeholders, the set of people that you identified in Step 3. Record relevant outcomes from the meeting as a PR comment.
  3. If you do not get explicit approvals in the meeting, keep iterating until you do. You can do this asynchronously or synchronously. If you've gone through multiple iterations and are struggling to get the required approvals, get help from your manager.

Approval

  1. Once you have gotten the required approvals, merge the design document. Do not assume silent consensus. If you did not hear back from important stakeholders, do not take this as approval. Make sure the relevant people have in fact seen your design and had a chance to object or propose changes.

Refinement

Once you've had your design document approved, you will move into the delivery phase of the project management process. On the happy path, your design will work as planned and the implementation will match what you've already documented. In that case, your design document will not require any refinement. On the unhappy path, you might discover that the design you proposed needs to be updated.

If you discover major flaws in your design during implementation, you will need to update your design document and get a new round of approvals (effectively repeating Steps 3-9 above). If you discover minor flaws, you can correct the design document alongside the implementation changes, instead.

Use your judgment as to which scenario applies, and reach out to your manager if you need guidance.

Finalization

You should not maintain the design doc forever. The doc is meant to be a point-in-time artifact that describes the historical context for the design. Once the described work is complete, you can stop updating the design doc.

Instead, invest in evergreen content. Add comments in the code itself (module comments can be particularly valuable) and reference documentation. For larger components, consider putting together an architecture presentation (see, for example, the persist lectures (internal)); slides and a talk track can be a more efficient means of communicating some types of technical content.

How should you review a design document?

As a reviewer, you play a key role in making the design review process a pleasant and productive experience:

  • Keep the goals and non-goals outlined above in mind. We need authors and reviewers aligned on the overall expectations for design documents in order for the overall process to be productive.
  • If you can only provide input on parts of the design doc, point that out explicitly and focus on those areas.
  • Avoid bikeshedding. Bikeshedding can drain the author's energy without adding any value.

If you don't know how to productively push back on aspects of a design document, consult the draft Raising an objection about a design Rustacean doc for guidance.