Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Command Query Framework

Command Query Framework

Command Query Framework

Eko Kurniawan Khannedy

June 21, 2016
Tweet

More Decks by Eko Kurniawan Khannedy

Other Decks in Technology

Transcript

  1. COMMAND QUERY FRAMEWORK SEARCH COMBINATIONS (2) ▸ Order Id ▸

    Order Id + Order Date ▸ Order Id + Order Date + Fraud Case Date ▸ Order Id + Order Date + Fraud Case Description ▸ Order Id + Order Date + Fraud Case Description + Risk ▸ Order Id + Order Date + Fraud Case Description + Risk + Task ▸ Order Id + Fraud Case Date ▸ …
  2. COMMAND QUERY FRAMEWORK READ TO SOLR ▸ Fast search by

    default. ▸ Only return Id from Solr, and get the content from MongoDB or PostgreSQL.
  3. COMMAND QUERY FRAMEWORK WRITE TO MONGODB / POSTGRESQL ▸ Fast

    write, because we don’t need to create many indexes anymore. ▸ Just findById() or findByIds(List<Id>)
  4. COMMAND QUERY FRAMEWORK WE DON’T WANT TO CREATE MULTIPLE ENTITY/MODEL

    CLASS CUSTOMER MONGO / CUSTOMER POSTGRESQL CUSTOMER SOLR CUSTOMER MONGO SERVICE / CUSTOMER POSTGRESQL SERVICE CUSTOMER SOLR SERVICE
  5. COMMAND QUERY FRAMEWORK WHAT IS COMMAND QUERY FRAMEWORK? ▸ Small

    library that read all entity classes, and magically transform its to Solr data structures. ▸ Pluggable using @Annotation. ▸ For now, only support Apache Solr. ▸ ElasticSearch will be supported soon (waiting for GDN approval) :D
  6. COMMAND QUERY FRAMEWORK COMMAND QUERY ANNOTATIONS ▸ @QueryDocument for Entity

    Class. ▸ @QueryId for ID attribute. ▸ @QueryEmbedded for embed nested object. ▸ @QueryEmbeddedCollection for embed collections or array. ▸ @QueryIgnore if we don’t care the attribute. ▸ @QueryPattern for date format pattern.
  7. COMMAND QUERY FRAMEWORK CURRENT LIMITATION ▸ We only support Apache

    Solr, not support ElasticSearch. ▸ We only support AND query operation. ▸ Minimum Java Version is 8.