使用magento api进行电子商务网站 [英] using magento apis for ecommerce website

查看:82
本文介绍了使用magento api进行电子商务网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是magento的初学者,并且正在使用magento创建网站.我注意到magento具有大量的API,这些API公开了创建电子商务网站所需的所有功能.因此,我想使用magento的api来获取数据,但要单独开发UI,而又不依赖于magento.我发现了很多参考资料,它们都是通过magento主题开发网站的,但不是那些UI是在单独的MVC中开发并且纯粹将magento用作服务层的参考.我的方法是否有任何问题/问题?

I am a beginner in magento and am working on creating a website using magento. I have noticed that magento has a good number of apis that expose all of the functionality that I would need to create an ecommerce website. So, I would like to use magento's apis to fetch data, but develop the UI separately without any dependencies on magento. I have found a lot of references that develop the website via magento theming, but not those where the UI is developed in a separate MVC and uses magento purely as service layer. Are there any problems/issues in my approach?

我对api中的数据库性能问题以及外部缓存如何缓解该问题有了很多了解,但是我仍然不了解magento作为服务层的广泛使用(即通过使用magento的api),还有其他陷阱吗?

I have gained a lot of clarity on db performance issue in apis and how external caching can alleviate the issue, but I still don't understand the underwhelming use of magento as a service layer (i.e. fueling the website by using magento's apis), are they any other gotchas?

推荐答案

在这里,我们克服了Magento API中的速度过慢的问题:

Here is how we overcame slowness in Magento APIs:

  1. 在Spring MVC J2EE中创建了一个Web服务提供者,充当Magento和最终用户之间的代理.
  2. J2EE Web服务提供程序公开了Magento几乎所有的API,但还支持带有REST的JSON和SOAP& RPC.
  3. J2EE Web服务提供者使用基于文档的数据库(MongoDB)将产品目录的快照存储在MongoDB中.
  4. J2EE Web服务提供者使用本机MongoDB缓存来快速提供数据,而无需运行任何昂贵的SQL查询.
  5. 为避免脏缓存问题,我们在Magento Admin中创建了一个钩子,以便每当Magento中的数据发生更改时就将数据推送到MongoDB中.

对于某些人来说,这听起来有些过头,但我们已经能够实现相当高的吞吐量,而不会出现任何慢速情况.

This might sound like overkill to some but we have been able to achieve pretty high throughput without any slowness.

这篇关于使用magento api进行电子商务网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆