2

I need to store a set of information (for example, poll results, article comments, etc,).

I would like to use the Sitecore pattern to manage information (templates, items and content tree) in order to not deploy custom logic for custom SQL database.

Of course, I don't want to use the master (CM) database since items are not available in the web (CD) database (unless I publish them). On the other site I cannot create items in web (CD) database since they are lost on publishing.

Is there a way to add a customer database to the content tree structure avoiding the publication.

Thanks in advance, Tex

1 Answer 1

6

Yes

You can add as many databases as you like.

I have an admittedly very old tutorial that takes you through the steps. Having just skimmed through it, I would say it's probably still perfectly valid - as Sitecore's Data Provider model hasn't changed significantly in a decade.

But if you want to go on your own, the steps to add an additional database to your solution is roughly this:

  • Clone one of your existing SQL databases. E.g. "master" or "web".
  • Add a new <database> section to your configs. Patch it in. Give it a unique id, i.e. change "master" to "ugc" or something similar.
  • Add a matching connection string for your cloned database in ConnectionStrings.config

And that's more or less it. As long as you can access this database, you can access the content in it - no publishing required or even wanted.

If you really wanted this information to come into your "master" content tree, you could set up a proxy for it. I'm not sure I would recommend you do however.

3
  • Thanks a lot for you suggestions, I'll check and let you know!! Commented Apr 13, 2018 at 7:15
  • @Mark-Cassidy is this supported on Sitecore 9.1.1 PaaS? We have a small custom database we need to run which holds customer details. Thanks
    – geedubb
    Commented Apr 2, 2020 at 6:21
  • Absolutely. This is supported in any version and topology since version 5.
    – Mark Cassidy
    Commented Apr 2, 2020 at 12:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.