Here are some answers to your questions. Hopefully they help to clarify things:
Q1. What is the best approach for publishing to the Broker database
A1. Whether items are stored in the Broker database or on the web server’s filesystem (or elsewhere!) is normally determined by the configuration in the Deployer’s cd_storage_conf.xml file, rather than by the templating TBBs used. This can be configured per-Publication and/or by the type of item being published (Page, DCP, PDF binary, etc.).
The TBBs will determine the output of the publishing (e.g. JSON, HTML, XML, etc.).
Q3. Do we have OOTB feature to Publish items as JSON format
(My answers are deliberately out of order!).
A3. If you want to publish JSON from your templates then you probably have three options:
- (i) Write your own TBBs that take the component fields and output the content of these (plus any ‘transformations’) in your own defined JSON structure.
- (ii)Install and then use the DD4T TBBs to output the DD4T style of JSON
- (iii) Install and then use the DXA TBBs (and Custom Resolver (optional, depending on your requirements)) to output the DXA style of JSON. If you just want the templating TBBs of DXA (and none of the other parts - Publications, Pages, etc.), then you’ll have to use the Content Manager part of the DXA installer and just unpick the templating parts (TBBs, Component Templates and Page Templates) that you need.
Q2. 8.5 CIL APIs are restful so does the output response will be in JSON
A2. Both DXA and DD4T have built-in mechanisms for retrieving the published JSON and then making the content of this easily available in your MVC views.
If you don’t want to use either of these frameworks/products then you could retrieve the JSON yourself (using the Assemblers that you mention), parse the JSON (probably into objects) and output the content as required from within your web application code. However, if you’re taking this approach then you may want to consider whether it’s better to just publish HTML in the first place and then simply retrieve and render this.
Hope this helps!