Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6240377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:33:32+00:00 2026-05-24T11:33:32+00:00

As a result of a previous post ( Architecture: simple CQS ) I’ve been

  • 0

As a result of a previous post (Architecture: simple CQS) I’ve been thinking how I could build a simple system that is flexible enough to be extended later.

In other words: I don’t see the need for a full-blown CQRS now, but I want it to be easy to evolve to it later, if needed.

So I was thinking to separate commanding from querying, but both based on the same database.

The query part would be easy: a WCF data service based on views to that it’s easy to query for data. Nothing special there.

The command part is something more difficult, and here’s an idea: commands are of course executed in an asynchronous way, so they don’t return a result. But, my ASP.NET MVC site’s controllers often need feedback from a command (for example if a registration of a member succeeded or not). So if the controller sends a command, it also generates a transaction ID (a guid) that is passed together with the command properties. The command service receives this command, puts it into a transactions table in the database with state ‘processing’, and is executed (using DDD principles). After execution, the transactions table is updated, so that state becomes ‘completed’ or ‘failed’, and other more detailed information like the primary key that was generated.

Meanwhile the site is using the QueryService to poll for the state of this transaction, until it receives ‘completed’ or ‘failed’, and then it can continue its work based on this result. If the transactions table is polled and the result was ‘completed’ or ‘failed’, the entry is deleted.

A side effect is that I don’t need guid’s as keys for my entities, which is a good thing for performance and size.

In most cases this polling mechanism is probably not needed, but is possible if needed. And the interfaces are designed with CQS in mind, so open for the future.

Do you think of any flaws in this approach? Other ideas or suggestions?

Thanks!

Lud

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T11:33:34+00:00Added an answer on May 24, 2026 at 11:33 am

    I think you are very close to a full CQRS system with your approach.

    I have a site that I used to do something similar to what you are describing. My site, braincredits.com, is architected using CQRS, and all commands are async in nature. So, as a result, when I create an entry, there is really no feedback to the user other than the command was successfully submitted for processing (not that it processed).

    But I have a user score on the site (a count of their “credits”) that should change as the user submits more items. But I don’t want the user to keep hitting F5 to refresh the browser. So I am doing what you are proposing — I have an AJAX call that fires off every second or two to see if the user’s credit count has changed. If it has, the new amount is brought back and the UI is updated (with a little bit of animation to catch the user’s attention — but not too flashy).

    What you’re talking about is eventual consistency — that the state of the application that the user is seeing will eventually be consistent with the system data (the system of record). That concept is pretty key to CQRS, and, in my opinion, makes a lot of sense. As soon as you retrieve data in a system (whether it’s a CQRS-based one or not), the data is old. But if you assume that and assume that the client will eventually be consistent, then your approach makes sense and you can also design your UI to account for that AND take advantage of that.

    As far as suggestions, I would watch how much polling you do and how much data you’re sending up and back. Do go overboard with polling, which is sounds like you’re not. But target what should be updated on a regular basis on your site and I think you’ll be good.

    The WCF Data Service layer for the query side is a good idea – just make sure it’s only read-enabled (which I’m sure you’ve done).

    Other than that, it sounds like you’re off to a good start.

    I hope this helps. Good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First, here is the previous post that deals with the ListBox AccountListBox data binding
This post is the continuation of my previous post . Now I have a
(moved from previous post) - sorry if this is seen as a repeat! Hi
As an addition to my previous post on Creating a web server in pure
This is not duplicate on my previous post - now I would like to
on my previous post I needed to distribute data of pgm files among 10
This is related to my previous post here . Running the actual script, I
According to my previous post I am trying to get back some information from
Following on from a previous post , I've found I'm totally stuck. I'm trying
Still dealing with quirky files (see my previous post ), I am using SED

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.